Re: Cubic spline path (was: rotation in 3D)
- From: James Waldby <no@xxxxx>
- Date: Fri, 11 Apr 2008 00:28:04 -0500
On Fri, 11 Apr 2008 06:17:20 +0200, Steven wrote:
[After I wrote, re Ioannis's comments:]
.................................................... monotonicA search like you propose amounts to the same thing Steven proposed,
calculating a huge number of points, namely 10000 spline evaluations
over the [0,1] interval when placing a handful of points in the
interval. It would be more reasonable to use a bisection search (see
eg http://en.wikipedia.org/wiki/Bisection_method ) which will take
fewer than 100 spline evaluations to place 6 points at .0001 accuracy.
First reaction: why didn't I think of that? But I think I need a line
integral here. POV-ray's spline function returns points on the curve,
and the only thing I know is that the function is monotoneous, i.e. that
if x is in [a,b] then the point Px will lie between Pa and Pb on the
curve.
There's no guarantee that, for x=(a+b)/2, the line integral over [a,x]
will be the same as the l.i. over [x,b]. Indeed most of the times it
won't be. Thanks anyway,
So, if I understand correctly now (earlier I didn't!) and using Ioannis's
notation, you have s(t) which as t goes from 0 to 1 moves along a space
curve monotonically but not necessarily proportionally with respect to t
versus length, and you are looking for points at particular lengths along
the curve. Perhaps you can re-characterize your splines as described in the
papers http://www.cs.uiowa.edu/~kearney/pubs/CurvesAndSurfacesArcLength.pdf
and http://www.saccade.com/writing/graphics/RE-PARAM.PDF about "Arc-Length
Parameterized Spline Curves", but if not consider following. Let L(t)
stand for the curve length from s(0) to s(t). In the bisection search
you would evaluate L(t) rather than s(t). Computing L(t) may take a dozen
or so s(r) evaluations for r between s and t, where s is the left bound of
the current bisection interval and L(s) is accurately computed by numerical
integration in previous bisection steps. That is, the interval over which
numerical integration is done can be kept quite short, holding down the
number of s evaluations needed while still keeping L(t) monotonic.
-jiw
.
- References:
- rotation in 3D
- From: Steven
- Re: rotation in 3D
- From: I.N. Galidakis
- Re: rotation in 3D
- From: Steven
- Re: rotation in 3D
- From: I.N. Galidakis
- Cubic spline path (was: rotation in 3D)
- From: Steven
- Re: Cubic spline path (was: rotation in 3D)
- From: Steven
- Re: Cubic spline path (was: rotation in 3D)
- From: I.N. Galidakis
- Re: Cubic spline path (was: rotation in 3D)
- From: James Waldby
- Re: Cubic spline path (was: rotation in 3D)
- From: Steven
- rotation in 3D
- Prev by Date: Re: Math -- Re: quadratic quadratic non-residue
- Next by Date: Re: Finding minimum in arithmetic series modulo N
- Previous by thread: Re: Cubic spline path (was: rotation in 3D)
- Next by thread: cheap Fashion Shoes Clothing Watches Glasses, Discount Leather Handbag Wallet (Price 8USD-35USD) at www.trade-in-putian.cn
- Index(es):
Relevant Pages
|