POV-Ray : Newsgroups : povray.unofficial.patches : new sor spline type : Re: new sor spline type Server Time
19 Apr 2024 08:05:05 EDT (-0400)
  Re: new sor spline type  
From: ingo
Date: 9 Aug 2002 15:09:09
Message: <Xns9265D7D9286D0seed7@povray.org>
in news:m018luklrcip3i7n1f86ktgqm7rccqju0i@4ax.com ABX wrote:

> http://abx.art.pl/pov/patches/sorspline.php
> 
> comments ? suggestions ?
> 

Nice addition. And, as you never seem to stop ;), how about Bezier and 
Kochanek-Bartels?

While reading your expaination my eye was cought by the line
"DBL sor_coeff[5][4];". Now this means nothing to me itself but it 
reminded me of a feature I think is very usefull when working with 
splines. It would be nice if a spline could also be accessed in the same 
way as an array.

#declare SPL= spline {
    	-0.10, <0,0,0>
    	 0   , <1,1,1>
      0.25, <2,3,4>
    	..
    	..
}

#declare dim= dimensions(SPL) //results in 2,
                              //(though could be 5 for Bezier)
#declare P0= SPL[0][0]  //results in -0.10
#declare P2= SPL[2][1]  //results in <2,3,4>
#declare size=dimension_size(SPL,1) //returns the amount of entries

The reason for this is that there are times when you want to interpolate 
the spline piece-wise. 
An example: extruding a rectangular linear spline along the y-axis. To 
get sharp edges with a minimum amout of triangles, you want to build the 
triangles per side of the rectangle = per section of the spline. 
Currently there is no acces to this information, although a rather 
clumsy workaround using arrays to build the splines from is possible.

Ingo


Post a reply to this message

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