POV-Ray : Newsgroups : povray.beta-test : Spline inconsistencies : Re: Spline inconsistencies Server Time
30 Jul 2024 06:22:29 EDT (-0400)
  Re: Spline inconsistencies  
From: Coridon Henshaw
Date: 22 Feb 2002 14:47:31
Message: <Xns91BD96793F24BCQ@204.213.191.226>
Warp <war### [at] tagpovrayorg> wrote in news:3c761b7b@news.povray.org:

> But with an existing macro you can achieve the same thing with a lot
> less work. For example:
> 
> #declare Points = array[6]
> { <1,1,1>, <2,2,2>, <3,3,3>, <3.5,3.5,3.5>, <4,4,4>, <5,5,5> }
> 
> CreateSpline(Points)

Quoted code is from your own post:

#macro CreateSpline(cspoints)
// Keep parameter names lowercase to prevent
// name collisions with functions and other macros.

> spline
> { cubic_spline
>  #declare Ind = 0;
   #declare EndInd = dimension_size(cspoints, 1)-1;
>   #while(Ind <= EndInd)
      Ind/EndInd, cspoints[Ind]
>    #declare Ind = Ind+1;
>   #end
> }

#end

> Using the current spline syntax is certainly not "much easier". In
> fact, it's a lot more tedious and difficult.

Macros will fix that.


Post a reply to this message

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