POV-Ray : Newsgroups : povray.newusers : Something amiss in my Prism {} object Server Time
8 Oct 2024 18:28:00 EDT (-0400)
  Something amiss in my Prism {} object (Message 1 to 4 of 4)  
From: Bald Eagle
Subject: Something amiss in my Prism {} object
Date: 2 Nov 2018 21:00:00
Message: <web.5bdcf2496fc865db765e06870@news.povray.org>
Having some trouble getting my prism to work.
Can anyone catch where the bug is?

 #local _Spline = dimension_size (ToothPrismArray, 1)-1;
 #debug concat ( "_Points = 0-", str (_Point, 3, 0),  " points \n")
 #debug concat ( "_Spline has 0-", str (_Spline, 3, 0),  " elements \n")

 #local _Tooth = prism {
  cubic_spline
  0, 0.1, _Spline
  #for (SplinePoint, 0, _Spline)
   #debug concat ( "[", str (SplinePoint, 3, 0),  "] = ",  vstr(2,
ToothPrismArray[SplinePoint], ", ", 3, 0),"\n")

   ToothPrismArray [SplinePoint],
  #end
 }

_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

line 190: Possible Parse Error: Too few points in prism.
Fatal error in parser: Uncategorized error.
Render failed

From the docs:
"Likewise, cubic splines need both the first and last points to be control
points, therefore, to close a shape made with a cubic spline, we must match the
second point to the second from last point. If we do not match the correct
points on a quadratic or cubic shape, that is when we will get the too few
points in prism error. POV-Ray is still waiting for us to close the shape, and
when it runs out of points without seeing the closure, an error is issued."


Post a reply to this message

From: jr
Subject: Re: Something amiss in my Prism {} object
Date: 3 Nov 2018 05:10:01
Message: <web.5bdd65bb8c8ce1086427f7f90@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> Having some trouble getting my prism to work.
> Can anyone catch where the bug is?

can you please post a/the complete scene?


regards, jr.


Post a reply to this message

From: William F Pokorny
Subject: Re: Something amiss in my Prism {} object
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

From: Bald Eagle
Subject: Re: Something amiss in my Prism {} object
Date: 3 Nov 2018 14:10:01
Message: <web.5bdde4288c8ce108765e06870@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> See a couple things.
>
> You have 289 points (0-288) but specify 288 in the line:
>
> 0, 0.1, _Spline


And that was it.   I was juggling quite a few things while I was rewriting all
of this, and array size vs array elements is something I often stumble upon,
know that I do, was trying to be vigilant about it --- and failed.

 #local _Tooth = prism {
  cubic_spline
  0, 0.1, _Spline+1

Simply adding 1 did the trick.   :)


> 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.

I understand, not real sure that's the case yet, but I do see an artifact now
that it's functioning and I've gotten some other debugging out of the way.

Very many thanks as always - a dose of clear thinking helps keep me sane.


Post a reply to this message

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