POV-Ray : Newsgroups : povray.newusers : Something amiss in my Prism {} object : Re: Something amiss in my Prism {} object Server Time
7 Jun 2023 01:15:57 EDT (-0400)
  Re: Something amiss in my Prism {} object  
From: William F Pokorny
Date: 3 Nov 2018 09:41:01
Message: <5bdda56d$1@news.povray.org>
On 11/2/18 8:56 PM, Bald Eagle wrote:
> Having some trouble getting my prism to work.
> Can anyone catch where the bug is?
> 
...
>   #local _Tooth = prism {
>    cubic_spline
>    0, 0.1, _Spline
>    #for (SplinePoint, 0, _Spline)
...
> 
> _Points = 0-288 points
> _Spline has 0-288 elements
> [  0] =  14,  14
> [  1] =  14,  -0     <---------- this
> [  2] =  15,  -0
> 
> ....
> 
> [286] =  15,   0
> [287] =  14,  -0   <---------- DOES match this
> [288] =  14, -14
> 

See a couple things.

You have 289 points (0-288) but specify 288 in the line:

0, 0.1, _Spline

(Guessing no syntax issue because the spline not closed error comes 
first. Parser thinks [286] 'should be' the on curve closing point and 
[287] the off curve ending control point)

Second, I 'suspect' the last three points should likely be:

[286] = 14, 14
[287] = 14, -0
[288] = 15, -0

Believe it the case you only need match point_list 2 to point_list end-1 
to close the cubic prism. However, if you want to match the continuity 
about that closing point, the effective control points previous and 
after must match too. In other words, it's common to repeat the first 
three points as the last three points with the prism's cubic spline.

Bill P.


Post a reply to this message

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