|
![](/i/fill.gif) |
in news:3c78dc4b@news.povray.org Warp wrote:
> or something similar.
>
Us it as you want it.
---%<------%<---
// The macro allways expects one point
// before t=0 and one after t=1, also for linear splines.
// Use: #declare SPL=BuildSpline(ArrayIdentifiers, "string")
// where string is C|c|L|l|Q|q
#macro BuildSpline(Arr, SplType)
#local Ds=dimension_size(Arr,1);
#local Asc=asc(strupr(SplType));
#if(Asc!=67 & Asc!=76 & Asc!=81)
#local Asc=76;
#debug "\nWrong spline type defined (C/c/L/l/Q/q), using default
linear_spline\n"
#end
spline {
#switch (Asc)
#case (67) //C cubic_spline
cubic_spline
#break
#case (76) //L linear_spline
linear_spline
#break
#case (81) //Q Quadratic_spline
quadratic_spline
#break
#end
#local Add=1/((Ds-2)-1);
#local J=0-Add;
#local I=0;
#while (I<Ds)
J
Arr[I]
#local I=I+1;
#local J=J+Add;
#end
}
#end
---%<------%<---
Post a reply to this message
|
![](/i/fill.gif) |