POV-Ray : Newsgroups : povray.general : rolled up maps Server Time
1 Aug 2024 12:26:51 EDT (-0400)
  rolled up maps (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Jim Charter
Subject: Re: rolled up maps
Date: 17 Jan 2006 04:22:11
Message: <43ccb743$1@news.povray.org>
Mike Williams wrote:

> Is there a utility that will take a spline and reorganize the control
> points to be evenly spread without changing the shape?
> 
I usually use this:

#macro SmoothSpline( Spline, Grain )
	//get total length of spline
         #local TL=0;
         #local Ptr=1;#while(Ptr<=Grain)
                 #local TL=
                 TL+vlength( Spline(Ptr/Grain)
                 -Spline((Ptr-1)/Grain) );
         #local Ptr=Ptr+1;#end

         #local L=0;

	//redefine spline
         spline { 

                 natural_spline
                 0 Spline(0)
                 #local Ptr=1;#while(Ptr<=Grain)
                         #local L=
			L+vlength( 		                           			Spline(Ptr/Grain)
			-Spline((Ptr-1)/Grain) );
                         L/TL Spline(Ptr/Grain)
                 #local Ptr=Ptr+1;#end
         }
#end

Seems obvious. Limited testing shows that the resulting
spline is close to the original.  Equal clock increments seem to 
generate equal spacing to some degree of precision.  What am I missing?


Post a reply to this message

From: Jim Holsenback
Subject: Re: rolled up maps
Date: 17 Jan 2006 05:33:41
Message: <43ccc805@news.povray.org>
Thanks folks .... this is definitely a tougher problem than my skill set can 
tackle (I'm learning tho). Again thanks for the code snipets. I'll give it a 
try and post the results if anyone is interested. :-)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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