POV-Ray : Newsgroups : povray.bugreports : Re: Bug in Bezier-spline prisms? Server Time
23 Jun 2024 15:25:16 EDT (-0400)
  Re: Bug in Bezier-spline prisms? (Message 1 to 1 of 1)  
From: Ron Parker
Subject: Re: Bug in Bezier-spline prisms?
Date: 5 Nov 1999 00:03:21
Message: <38226519@news.povray.org>
On Thu, 04 Nov 1999 20:55:32 GMT, Jeff Lee wrote:
>I'm not sure if this is a bug, or an undocumented feature, or if I'm
>merely doing something wrong, but when I attempt to create subprisms
>within a prism made of Bezier splines, I receive the message: 
>
>   warning: Prism not closed. Ignoring it.

It's a bug.  The bezier spline prism code verifies that the end point
of each spline is the same as the start point of the next spline, and 
that the last point is the same as the first.  This is fine for simple
prisms, as you discovered, but it breaks for subprisms.  Either that
or you're not supposed to be able to use subprisms with bezier splines,
but I find that difficult to believe.  (If so, it's a doc bug.)

Here's how to fix it:  The loop needs to be rewritten first, so as to 
remove the hokey one-size-fits-all method of checking the end against 
the start.  After that we need to remember what point we started at
and check that point against any seeming discontinuities and at the 
end of the array.  If we see what looks like a discontinuity, but it
matches the starting point we saved, save the starting point of the
new loop and start checking again.

------------- 
remainder of original message follows for the benefit
of those reading this in .bugreports for the first time.
------------- 

>However, each of the subprisms appears to be correct; I can comment out
>bits and render each subprism separately, and the result is what I
>expect it to look like.  But when I put them together again, they still
>fail to work.
>
>Here's a small example file, showing one linear_spline prism and one
>bezier_spline prism, each with an outer and inner subprism.  The former
>prism works exactly as the documentation says it should.  The latter
>does not.
>
>Any ideas on what I'm doing wrong, or can Bezier-spline prisms simply
>not contain subprisms?
>
>//------------------------------ Cut here ------------------------------
>
>#declare LinearPrism = prism { linear_spline linear_sweep 0, 5, 10,
>  <0,10>, <10,0>, <0,-10>, <-10,0>, <0,10>,  // outer prism
>  <0, 5>, < 5,0>, <0, -5>, < -5,0>, <0, 5>   // inner prism
>  pigment { colour rgb <1,1,0> }
>}
>
>#declare BezierPrism = prism { bezier_spline linear_sweep 0, 5, 32,
>  <  0, 10>, < 10, 10>, < 0, 0>, < 10,  0>,
>  < 10,  0>, < 10,-10>, < 0, 0>, <  0,-10>,
>  <  0,-10>, <-10,-10>, < 0, 0>, <-10,  0>,
>  <-10,  0>, <-10, 10>, < 0, 0>, <  0, 10>,  // outer prism
>  <  0,  5>, <  0,  0>, < 5, 5>, <  5,  0>, 
>  <  5,  0>, <  0,  0>, < 5,-5>, <  0, -5>,
>  <  0, -5>, <  0,  0>, <-5,-5>, < -5,  0>,
>  < -5,  0>, <  0,  0>, <-5, 5>, <  0,  5>   // inner prism
>  pigment { colour rgb <0,1,1> }
>}
>
>object { LinearPrism translate x*-11 }
>object { BezierPrism translate x* 11 }
>
>camera { location <0,30,-30> look_at <0,2.5,0> }
>light_source { <-10000,10000,-10000> colour rgb <1,1,1> }
>plane { y, 0 pigment { colour rgb <1,1,1> }}
>
>//------------------------------ Cut here ------------------------------
>
>
>-- 
>Jeff Lee         shi### [at] gatenet         http://www.gate.net/~shipbrk/
>


-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

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