|
|
Mark Wagner wrote in message <3c88426c@news.povray.org>...
>Mike Williams wrote in message ...
>>In this example scene, when using the whole length of a cubic_spline
>>(it's tricky to stop at the penultimate control point when using spline
>>functions to generate isosurfaces), the isosurface that uses the spline
>>explodes, and the spline evaluates to <-1.#IND00,-1.#IND00,-1.#IND00> at
>>the endpoint. Replace "cubic_spline" by any other spline type and the
>>isosurface behaves normally, and the spline evaluates to <0,0,-0.6>.
>
>It shouldn't be doing that. It should be evaluating to <0, 0.4, 0.4> at
any
>point beyond the next-to-last. I'll see if I can find the bug.
An embarrassingly obvious bug: it's trying to do Catmull-Rom interpolation
from three valid data points and one invalid one. The fix:
In section "case CATMULL_ROM_SPLINE:" of Get_Spline_Val(), change the line
else if(i == last)
to
else if(i >= last)
--
Mark
Post a reply to this message
|
|