POV-Ray : Newsgroups : povray.general : Subdividing a spline : Re: Subdividing a spline Server Time
31 Jul 2024 22:11:01 EDT (-0400)
  Re: Subdividing a spline  
From: Tor Olav Kristensen
Date: 14 Jul 2006 15:52:30
Message: <44b7f5fe$1@news.povray.org>
Skip Talbot wrote:
> Is there a way to accurately, or quickly and fairly accurately, 
> subdivide a spline into equal lengths?  I've written a macro that takes 
> small steps along the spline and sums up the distance between the steps. 
>   I then divide this length by the number of segments I want, and 
> traverse the spline again until this divided distance is reached.  The 
> lengths always fall short (as well they should as I lose the curvature). 
> The smaller the step the better the accuracy but the parse times start 
> getting fairly high.  Less obvious though is that the error increases as 
> I increase the number of divisions.  It almost seems like its skipping 
> the last step and distance sum for the segment, and thus they the error 
> adds up with more segments.
> 
> Does anyone have a better approach to this problem or should I scour my 
> macro for bugs?

You could google for numerical methods to approximate line integrals.

-- 
Tor Olav
http://subcube.com


Post a reply to this message

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