POV-Ray : Newsgroups : povray.advanced-users : Equal spacing along curve : Re: Equal spacing along curve Server Time
30 Jul 2024 06:31:25 EDT (-0400)
  Re: Equal spacing along curve  
From: Chris Colefax
Date: 16 Feb 2000 17:50:30
Message: <38ab29b6@news.povray.org>
Sigmund Kyrre Aas <as### [at] studntnuno> wrote:
> I agree if you mean:
> integral of sqrt(X'(t)^2 + Y'(t)^2 + Z'(t)^2) from 0 to t1 equals l/n.
>
> .. and the next would be from t1 to t2 right?
> But I can't solve this equation analytically.
>
> As I see it I can
> a) produce splines in pov using LSpline3
> b) produce splines in Matlab
> c) solve the 13 equations above numerically in Matlab
>
> -- think I'll start with a) even though I'm a spline virgin.

I had the same problem when creating my own Spline macro system: it creates
multi-segment cubic interpolating splines, and there is no known way of
integrating the spline function.  My solution, both for calculating the
length of the spline and finding evenly spaced intervals along it, was to
first sample the spline segment's length (L) at equal values of the control
parameter (t), and then reverse interpolate to get equal length intervals.

I've optimised the macros to precalculate all possible coefficients from the
original point data, and I've added a cache-file feature, so the performance
is (to me, at least) quite acceptable.  If you would like a preview copy
feel free to email me for details.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.