|
 |
On 2026-05-09 09:36, ingo wrote:
> The CatmullRom is a case of Cardinal spline
Added Cardinal and played with tension.
---%<------cardinal for curve.inc---%<------%<---
#macro CIcardinal(CIarr, Tension)
//:Quadratic Cardinal curve
#local DimSeg = 4;
#local Step = 1;
#local Div = 1;
#local T = (1 - Tension) / 2;
#local Matrix = array[4]{
array[4]{ -T, 2.0 - T, T - 2.0, T},
array[4]{2.0 * T, T - 3.0, 3.0 - (2.0 * T), -T},
array[4]{ -T, 0.0, T, 0.0,},
array[2]{ 0.0, 1.0}
}
_CIinit(CIarr, DimSeg, Step, Matrix)
#end
---%<------%<------%<------%<---
---%<------cardinal for scene file---%<------%<---
#declare Test = CIcardinal(vC, 0.65);
#for(T, 0, 1, 0.0015)
sphere{CIget(Test, T), 0.05 pigment{rgb <1,0,0>} translate <0.1,0,0>}
#end
---%<------%<------%<------%<---
neither of both curves give the C2 continuity that a natural cubic
spline gives. The slight curvature in the glass and the stem. My guess
would be SOR is a natural cubic spline. I.i.r.c. ABX had the SOR spline
implemented as a spline in one of patched versions. SuperPov, UeberPov?
ingo
Post a reply to this message
Attachments:
Download 'compare_sor_cardinal.png' (37 KB)
Preview of image 'compare_sor_cardinal.png'

|
 |