POV-Ray : Newsgroups : povray.general : help with splines : Re: help with splines Server Time
30 Apr 2024 08:48:13 EDT (-0400)
  Re: help with splines  
From: yoyodunno
Date: 11 Dec 2010 14:30:00
Message: <web.4d03d077464c1137cd2e0a0a0@news.povray.org>
Ok so I tried sampling points along the spline like this:

#declare curve_Vectors=0;
     //try to average curve length with averaging vectors
     #declare curve_loop=2;
        #while(curve_loop<11)
                #declare
curve_Vectors=curve_Vectors+vlength(spline_A(Nr+(stepValue*curve_loop))-spline_A(Nr+(stepValue*(curve_loop-1))));
                #declare curve_loop=curve_loop+1;
        #end
     #declare curve_Average=curve_Vectors/9; //try to get average length of 9
subdivisions
     #declare CumulativeDistance=CumulativeDistance+curve_Average;

      object{tracks Spline_Trans(spline_A,CumulativeDistance,y,.1,.8)}

So it does give slightly better spaced tracks, I made that while loop to try and
average more vectors along the spline and it also helped slightly. But still not
that much better than originally.

Is there anything else to give a better approximation of the curve distance? And
yeah that colefax macro didn't work for what I have since I'm using a natural
spline, and also the Spline_Trans macro.


Post a reply to this message

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