Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16458

Re: BSplineSurface & BSplineFunction_Extracting Data

From Itai Seggev <itais@wolfram.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: BSplineSurface & BSplineFunction_Extracting Data
Date 2014-01-21 08:41 +0000
Message-ID <lblbrs$mhi$1@smc.vnet.net> (permalink)
References <20140120090005.1529C69D2@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


On Mon, Jan 20, 2014 at 04:00:05AM -0500, Bill wrote:
> Hi:
> 
> I have the following Mathematica 8.0.4. code which plots the following:
> 
> In[1]:=  cpts={{{1,1,-0.5740579178735179`},{1,2,0.3902669640296943`},{1,3,0.6162142022057271`},{1,4,-0.11572153782589911`},{1,5,0.436662579150056`}},{{2,1,0.8096824307907462`},{2,2,-0.7419265507701529`},{2,3,-0.8659156744537175`},{2,4,-0.0998628811371658`},{2,5,-0.24185346526195106`}},{{3,1,-0.1969086942688163`},{3,2,0.7961076758026819`},{3,3,-0.060290070096196136`},{3,4,0.48665856202059254`},{3,5,-0.013419247141178037`}},{{4,1,0.6573342854316904`},{4,2,-0.9170657725998455`},{4,3,0.9830103505987027`},{4,4,-0.8759376369982923`},{4,5,-0.03030297194593956`}},{{5,1,-0.549653902873303`},{5,2,0.7865815336945703`},{5,3,-0.6672322036832838`},{5,4,0.5688838564868042`},{5,5,0.5541079809436917`}}};
> surf1=Graphics3D[BSplineSurface[cpts]];
> 
> (*Plot omitted.*)
> 
> I then used the following code to extract data:  Note "Automatic" at the end in Out[4].
> 
> In[3]:=  f=BSplineFunction[cpts]
> 
> Out[3]=  BSplineFunction[{{0.,1.},{0.,1.}},<>]
> 
> In[4]:= f[[5]],f[[6]]
> 
> Out[4]= {{{{1.,1.,-0.574058},{1.,2.,0.390267},{1.,3.,0.616214},{1.,4.,-0.115722},{1.,5.,0.436663}},{{2.,1.,0.809682},{2.,2.,-0.741927},{2.,3.,-0.865916},{2.,4.,-0.0998629},{2.,5.,-0.241853}},{{3.,1.,-0.196909},{3.,2.,0.796108},{3.,3.,-0.0602901},{3.,4.,0.486659},{3.,5.,-0.0134192}},{{4.,1.,0.657334},{4.,2.,-0.917066},{4.,3.,0.98301},{4.,4.,-0.875938},{4.,5.,-0.030303}},{{5.,1.,-0.549654},{5.,2.,0.786582},{5.,3.,-0.667232},{5.,4.,0.568884},{5.,5.,0.554108}}},Automatic}
> 
> Out[5]= 
> {{0.,0.,0.,0.,0.5,1.,1.,1.,1.},{0.,0.,0.,0.,0.5,1.,1.,1.,1.}}
> 
> In[6]:= {uk,vk}=%;
> 
> In[7]:=surf2=Graphics3D[{BSplineSurface[cpts,SplineKnots->{uk,vk},SplineDegree->3,SplineWeights ->Automatic];
> 
> (*Plot omitted.*)
> 
> Question:  Is there some way to extract the SplineWeights values that Mathematica used for "SplineWeights ->Automatic"?

That is documented to weight all points equally, so it is effecively equal to 
ConstantArray[1, Most @ Dimensions[cpts]]. 

--
Itai Seggev
Mathematica Algorithms R&D

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar


Thread

Re: BSplineSurface & BSplineFunction_Extracting Data Itai Seggev <itais@wolfram.com> - 2014-01-21 08:41 +0000

csiph-web