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


Groups > comp.soft-sys.math.mathematica > #1777 > unrolled thread

Re: BezierCurve vs. BezierFunction

Started by"Christopher O. Young" <cy56@comcast.net>
First post2011-04-19 10:56 +0000
Last post2011-04-19 10:56 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: BezierCurve vs. BezierFunction "Christopher O. Young" <cy56@comcast.net> - 2011-04-19 10:56 +0000

#1777 — Re: BezierCurve vs. BezierFunction

From"Christopher O. Young" <cy56@comcast.net>
Date2011-04-19 10:56 +0000
SubjectRe: BezierCurve vs. BezierFunction
Message-ID<iojppi$i5b$1@smc.vnet.net>
On 1/22/10 6:42 AM, in article hjbvdr$2vj$1@smc.vnet.net, "Gianluca Gorni"
<gianluca.gorni@dimi.uniud.it> wrote:

> 
> I am a total beginner with splines. Playing around BSplines and Bezier curves,
> I noticed that while BSplineCurve and BSplineFunction seemed
> to agree in all the examples I tried, there are differences between the
> output of BezierCurve and BezierFunction. For example, the next two
> graphs are different:
> 
> pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}, {5, 2}, {6, -1}, {7, 3}};
> Graphics[{BezierCurve[pts]}, Axes -> True]
> f = BezierFunction[pts];
> ParametricPlot[f[t], {t, 0, 1}]
> 
> Does anybody know of some option settings that make BezierFunction give the
> same curve as BezierCurve?

Specifying SplineDegree -> 6 will give the same result for both cases. It
looks like Mathematica took 5 for the default degree here, for some reason.

Graphics[
 {BezierCurve[pts, SplineDegree -> 6]}, Axes -> True
 ]
f = BezierFunction[pts, SplineDegree -> 6];

To get a table of all the ways of fitting together Bezier curves on these
point, try:

Table[Graphics[
  {Green, Line[pts],
   Red, Point[pts],
   Black,
BezierCurve[pts, SplineDegree -> d]
   }
  ], {d, 1, 6}]

It looks like Mathematica just automatically puts Bezier curves in end-to-end if you use BezierCurve. 
> 
> Moreover, it is nice that BSplineBasis can be expanded out with
> PiecewiseExpand.
> But then, why don't BezierFunction and BSplineFunction expand out with either
> PiecewiseExpand or FunctionExpand?
> 
> pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}, {4, -2}, {5, 1}};
> f = BezierFunction[pts];
> PiecewiseExpand[f[t]]
> FunctionExpand[f[t]]
> 
> Best regards,
> Gianluca Gorni
> 
> 

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web