POV-Ray : Newsgroups : povray.newusers : Prism Problem : Re: Prism Problem Server Time
26 Apr 2024 00:24:14 EDT (-0400)
  Re: Prism Problem  
From: Le Forgeron
Date: 18 Apr 2016 12:52:48
Message: <571510e0$1@news.povray.org>
Le 18/04/2016 17:37, Sereib a écrit :
> Hello,
> 
> I think I understood how a prism with cubic_spline works: The first and last
> point are controls points, and the second and second from last points needs to
> be identical (P1 = P1), such as:
> 
> prism{cubic_spline 0, 1, 7, P0, P1, P2, P3, P4, P1, P5}
> 
> using the points P0 ... P5 I calculate in a loop using #declare ...
> which, however, results in "Too few points in a prism"
> 
> If I substitute the point P1 as follows:
> 
> prism{cubic_spline 0, 1, 7, P0, <1,1>, P2, P3, P4, <1,1>, P5}
> 
> it works. has POV-Ray a problem with using predefined points instead of using
> the
> numerical value in the prism statement?
> 
> Thank you!

Prism can have more than one loop/fold.

I can reproduce the issue with :

#declare P0=<0,0>;
#declare P1=<1,0>;
#declare P2=<2,1>;
#declare P3=P1;
#declare P4=<4,1>;
#declare P5=<5,0>;

prism{cubic_spline 0, 1, 7, P0, P1, P2, P3, P4, P1, P5}

Notice that the problem is between the keyboard and the chair: as P1 == P3, the first
line is closed and stop at P3,P4.
P1,P5 is another prism (control at P1, first point at P5) but we are lacking points.
A non flat cubic_spline prism should have at least about 6 coordinates: 1 first
control point, 1 start point, at least 2 non aligned other points (with start point),
and repeating start point, and finally a control point for the end.

Of course, you can nest another closed curve (to perform prism operation) in the
definition. As soon as the start point is duplicated, the curve is closed, the next
point is a control, the next-next is the control of the next curve and the third next
is the start of the
new curve which need to be closed too...

http://wiki.povray.org/content/Reference:Prism


Post a reply to this message

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