POV-Ray : Newsgroups : povray.beta-test : [Doc] new cubic_spline type endpoints : Re: [Doc] new cubic_spline type endpoints Server Time
29 Jul 2024 20:26:25 EDT (-0400)
  Re: [Doc] new cubic_spline type endpoints  
From: Mark Wagner
Date: 10 Mar 2002 23:39:36
Message: <3c8c3508$1@news.povray.org>
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

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