delorie.com/archives/browse.cgi | search |
On Sat, 2015-02-07 at 15:53 -0500, Dave McGuire wrote: > On 02/07/2015 12:13 PM, Peter Clifton wrote: > > I'm currently taking time out from the PCB+GL and 3D stuff I want to get > > merged in order to fix some polygon bugs that are raising their ugly > > heads. (Long-standing bugs, but perhaps more commonly seen now due to > > the nm core coordinate switch). > > ...and thanks for this, by the way! I'm definitely down the rabbit hole on this one now. Just to cheer myself up, I read a book chapter yesterday on algorithms to do boolean operations on 3D BREP solid models. The 3D cases (even for simple polyhedra, no curves...) makes computing with 2D polygons look so very simple its almost laughable. And yet... we hit bugs, because it really isn't that simple. I think I know the root-cause for the test-case you sent (bad logic in the contour walk gathering result polygon), and am currently chasing down the one or two other bugs that its fix exposes. (How to correctly deal with single vertex touching contours). The remaining nicety will be fixing the clearance polygon generation to avoid the rounding errors that created the geometry in my test-cases that trigger these bugs. Sometimes I think my efforts here would be better spent writing a solid test-suite for the polygon algebra, rather than playing whack-a-mole with these bugs on a case-by-case basis. Peter -- Peter Clifton <peter DOT clifton AT clifton-electronics DOT co DOT uk> Clifton Electronics
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |