Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1777
| From | "Christopher O. Young" <cy56@comcast.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: BezierCurve vs. BezierFunction |
| Date | 2011-04-19 10:56 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <iojppi$i5b$1@smc.vnet.net> (permalink) |
| References | <hjbvdr$2vj$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
>
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: BezierCurve vs. BezierFunction "Christopher O. Young" <cy56@comcast.net> - 2011-04-19 10:56 +0000
csiph-web