Re: BSplineSurface & BSplineFunction_Extracting Data

*To*: mathgroup at smc.vnet.net*Subject*: [mg132230] Re: BSplineSurface & BSplineFunction_Extracting Data*From*: Bob Hanlon <hanlonr357 at gmail.com>*Date*: Tue, 21 Jan 2014 03:01:28 -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>

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`}}}; f = BSplineFunction[cpts]; >From documentation for SplineWeights ( http://reference.wolfram.com/mathematica/ref/SplineWeights.html): "SplineWeights->Automatic makes all weights equal, yielding polynomial splines." Consequently, you can use any value. splineWts=ConstantArray[Random[],Most[Dimensions[cpts]]]; Graphics3D[ BSplineSurface[cpts, SplineKnots->f[[6]], SplineDegree->3, SplineWeights->splineWts]] Bob Hanlon On Mon, Jan 20, 2014 at 4:00 AM, Bill <WDWNORWALK at aol.com> 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.616= 2142022057271`},{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.196908694= 2688163`},{3,2,0.7961076758026819`},{3,3,-0.060290070096196136`},{3,4,0.486= 65856202059254`},{3,5,-0.013419247141178037`}},{{4,1,0.6573342854316904`},{= 4,2,-0.9170657725998455`},{4,3,0.9830103505987027`},{4,4,-0.875937636998292= 3`},{4,5,-0.03030297194593956`}},{{5,1,-0.549653902873303`},{5,2,0.78658153= 36945703`},{5,3,-0.6672322036832838`},{5,4,0.5688838564868042`},{5,5,0.5541= 079809436917`}}}; > 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.5541= 08}}},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},Spl= ineDegree->3,SplineWeights > ->Automatic]; > > (*Plot omitted.*) > > Question: Is there some way to extract the SplineWeights values that > Mathematica used for "SplineWeights ->Automatic"? > > > Thanks, > > Bill W. > >

**References**:**BSplineSurface & BSplineFunction_Extracting Data***From:*Bill <WDWNORWALK@aol.com>