POV-Ray : Newsgroups : povray.advanced-users : Pigment along a sphere_sweep : Re: Pigment along a sphere_sweep Server Time
6 Oct 2024 13:10:21 EDT (-0400)
  Re: Pigment along a sphere_sweep  
From: Tim Attwood
Date: 18 Feb 2007 16:29:07
Message: <45d8c523$1@news.povray.org>
> ... I tried to transform the spline coordinates to something more
> accessible, but that fails because one has no possibility to know how
> far on the spline a given point (x,y,z) is.

This macro can estimate the distance between points on a spline
by summing the linear distance between a number of sub-points.

#macro Len_Spline(Espl begin_at stop_at num)
   #local c = 1/num;
   #local V1 = Espl(begin_at);
   #local result = 0;
   #while (c <= 1)
      #local V2 = Espl( c*(stop_at - begin_at) + begin_at);
      #local result = result + vlength(V2-V1);
      #local V1 = V2;
      #local c = c + 1/num;
   #end
   (result)
#end

#declare sample = Len_Spline(ABC_spl, 0, 0.5, 2000);

You might also want to look at the MSM macro in
Ingo's meshmaker stuf. http://members.home.nl/seedseven/


Post a reply to this message

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