|
|
Anthony C. D'Agostino wrote:
> I have a precise bezier curve (from Adobe Illustrator) that I want to
> turn
> into a lathe object for POV-Ray.
>
> I know that a cubic spline takes four points to determine the curve.
> A
> bezier curve also takes four but it doesn't seem to be implemented in
> the
> same way. The main differences are:
>
> * A bezier curve segment has 2 end points and 2 control points. The
> curve
> doesn't pass through the control points.
> * A cubic spline segment has four points; the curve does pass through
> all 4.
>
> Is there a simple mathematical way to convert the bezier to the
> spline?
> Maybe there is an unofficial POV version that allows lathe objects to
> be
> described with the coordinates of a bezier curve?
To be precise, POV uses Catmull-Rom splines. To do the conversion,
matrix multiply (in this order) the inverse of the Bezier basis matrix
by the Catmull-Rom basis matrix. Then matrix multiply (in this order)
the resultant conversion matrix by the Bezier geometry matrix to get the
equivalent Catmull-Rom geometry matrix. If enough of my brain remains
to have done the calculations correctly, call your four Bezier points
<a.x, a.y, a.z>, <b.x, b.y, b.z>, <c.x, c.y, c.z> and <d.x, d.y, d.z>
with A and D being the endpoints and B and C being the control points.
Then your four Catmull-Rom equivalent points should be:
E = <2*b.x, 2*b.y, 2*b.z>,
F = <-1/3*a.x+2*b.x+1/3*c.x, -1/3*a.y+2*b.y+1/3*c.y,
-1/3*a.z+2*b.z+1/3*c.z>,
G = <1/3*b.x+2*c.x-1/3*d.x, 1/3*b.y+2*c.y-1/3*d.y,
1/3*b.z+2*c.z-1/3*d.z>,
H = <2*c.x, 2*c.y, 2*c.z>
If I screwed it up, try permuting my formulae. If that does no good,
the info I calculated this from is in Chapter 11 of the second edition
of Computer Graphics Principles and Practice by Foley, vanDam, Feiner
and Hughes, the section on parametric cubic curves.
Good luck.
Jerry Anning
cle### [at] dholcom
Post a reply to this message
|
|