2
$\begingroup$

Why are those surfaces different?

cpts = Table[{x, y, RandomReal[{0, 2}]}, {x, 0, 7}, {y, 0, 5}];
surf = BSplineSurface[cpts];
surfFn = BSplineFunction[cpts];


Show[
 Plot3D[surfFn[x/7, y/5][[3]], {x, 0, 7}, {y, 0, 5}, Mesh -> None, PlotStyle -> Red,          
                                              BoundaryStyle -> Red, BaseStyle -> Thick],
 Graphics3D[{EdgeForm[{Blue, Thick}], surf}], 
 Background -> GrayLevel@.7]

enter image description here

$\endgroup$
  • $\begingroup$ Right. More clear. $\endgroup$ – rhomboidRhipper Mar 31 '14 at 21:32
6
$\begingroup$

BSplineFunction[{{0., 1.}, {0., 1.}}, "<>"] is a map from parametric space to "plotting" space, i.e. $\mathrm{BSplineFunction}:(u,v)\mapsto (x,y,z)$, so instead of Plot3D[surfFn[x/7, y/5][[3]], {x, 0, 7}, {y, 0, 5}], it should be written as ParametricPlot3D[surfFn[u, v], {u, 0, 1}, {v, 0, 1}].

cpts = Table[{x, y, RandomReal[{0, 2}]}, {x, 0, 7}, {y, 0, 5}];
surf = BSplineSurface[cpts];
surfFn = BSplineFunction[cpts];

Show[
    ParametricPlot3D[surfFn[u, v], {u, 0, 1}, {v, 0, 1},
        Mesh -> None, PlotStyle -> Red, BoundaryStyle -> Red, 
        BaseStyle -> Thick],
    Graphics3D[{EdgeForm[{Blue, Thick}], surf}],
    Background -> GrayLevel@.7]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.