The Persistence of Vision Raytracer (POV-Ray).
This is the legacy Bug Tracking System for the POV-Ray project. Bugs listed here are being migrated to our github issue tracker. Please refer to that for new reports or updates to existing ones on this system.
Opened by Christoph Lipka - 2011-01-04
Last edited by Christoph Lipka - 2011-02-26
FS#186 - numeric precision problem with polygon start/end points
polygon objects comprised of multiple “sub-polygons” don’t work properly if start/end points of sub-polygons do not exactly match, as can be demonstrated by the following code:
#default { texture { pigment { rgb 1 } finish { ambient 1.0} } } camera { orthographic up 3.5*y right 3.5*x*image_width/image_height location <0,0,-4> look_at <0,0,0> } polygon { 8, // outer triangle 0.70 * < cos( 0 *pi/180),sin( 0 *pi/180),0> 0.70 * < cos(120 *pi/180),sin(120 *pi/180),0> 0.70 * < cos(240 *pi/180),sin(240 *pi/180),0> 0.70 * < cos(360 *pi/180),sin(360 *pi/180),0> // inner triangle 0.35 * < cos( 0 *pi/180),sin( 0 *pi/180),0> 0.35 * < cos(120 *pi/180),sin(120 *pi/180),0> 0.35 * < cos(240 *pi/180),sin(240 *pi/180),0> 0.35 * < cos(360 *pi/180),sin(360 *pi/180),0> }
Note that the end points /should/ be identical. There are however some minor rounding differences, which mess up polygon computations. Compare with the following code, which leads to the desired results:
polygon { 8, // outer triangle 0.70 * < cos( 0 *pi/180),sin( 0 *pi/180),0> 0.70 * < cos(120 *pi/180),sin(120 *pi/180),0> 0.70 * < cos(240 *pi/180),sin(240 *pi/180),0> 0.70 * < cos( 0 *pi/180),sin( 0 *pi/180),0> // inner triangle 0.35 * < cos( 0 *pi/180),sin( 0 *pi/180),0> 0.35 * < cos(120 *pi/180),sin(120 *pi/180),0> 0.35 * < cos(240 *pi/180),sin(240 *pi/180),0> 0.35 * < cos( 0 *pi/180),sin( 0 *pi/180),0> }
Code inspection shows that the polygon insideness testing code tests for precise equality of the points, whereas the general policy of POV-Ray is to accept slight rounding differences.
fixed with change #5343
I'm ok with that change (tested with my original scene: no more problem) with RC2/#5347, source linux, 64bits.