10
$\begingroup$

This example:

pts = {{0, 0}, {1, 1}, {2, 0}, {3, 2}};
f = BezierFunction[pts]
Show[Graphics[{Red, Point[pts], Green, Line[pts]}, Axes -> True], 
 ParametricPlot[f[t], {t, 0, 1}],Graphics[{Blue, Dashed, BezierCurve[pts]}]]

perfectly works producing

curves coincide

However with

pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}, {5, 2}, {6, -1}, {7, 3}};

it produces

curves do not coincide

Why do the curves not coincide and how to access BezierFunction for BezierCurve with npts>4?

$\endgroup$
11
$\begingroup$

BezierCurve normally gives a composition of local 4point-Bezierfunctions.

You get equal curves by setting SplineDegree->1+Length[pts]

 Show[Graphics[{Red, Point[pts], Green, Line[pts]}, Axes -> True], 
 ParametricPlot[f[t], {t, 0, 1}], 
 Graphics[{Blue, Dashed,BezierCurve[pts, SplineDegree -> 1 + Length[pts]]}]]

enter image description here

$\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.