The Persistence of Vision Raytracer (POVRay).
This is the legacy Bug Tracking System for the POVRay 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.
FS#186  numeric precision problem with polygon start/end points
Opened by Christoph Lipka (clipka)  Tuesday, 04 January 2011, 21:21 GMT
Last edited by Christoph Lipka (clipka)  Saturday, 26 February 2011, 00:36 GMT

Detailspolygon objects comprised of multiple “subpolygons” don’t work properly if start/end points of subpolygons 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 POVRay 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.