Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2014

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: BSplineSurface & BSplineFunction_Extracting Data

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132239] Re: BSplineSurface & BSplineFunction_Extracting Data
  • From: Itai Seggev <itais at wolfram.com>
  • Date: Tue, 21 Jan 2014 03:48:35 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20140120090005.1529C69D2@smc.vnet.net>

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



  • Prev by Date: Re: Why does _+_==2_ (or, why is HoldPattern required
  • Next by Date: Re: Unnecessary parentheses around TagBox for
  • Previous by thread: Re: BSplineSurface & BSplineFunction_Extracting Data
  • Next by thread: Distance Between a B-Spline Surface & Point