Speed up unsubtraction from polygons when objects are deleted
commit7186efa74e656913be2f7183baf5cbbc38f98d80
authorPeter Clifton <pcjc2@cam.ac.uk>
Thu, 12 Nov 2009 00:17:29 +0000 (12 00:17 +0000)
committerPeter Clifton <pcjc2@cam.ac.uk>
Thu, 12 Nov 2009 00:17:29 +0000 (12 00:17 +0000)
tree6befe07cf4e952052a168fe51cab48de5ac8ed27
parent2682a6fdbae39859190e1527150464412e37c8eb
Speed up unsubtraction from polygons when objects are deleted

This process worked by adding a new "blob" of polygon to cover in the
hole made by the object being deleted. If this "blob" intersected the
contour of the original polygon, it would cause the polygon's contour
to be damaged. To avoid this, the unsubract code would always clip the
resulting polygon against the original (pristine) polygon contour.

Unfortunately.. this clipping operation is gauranteed to intersect the
contour of the polygon - a very expensive operation, since all holes
inside the polygon (many on a complex board) have to be re-processed.

This speed-up is achieved by reversing the order of operation. The
"blob" to be added to the polygon is first clipped against the pristine
contour (a relatively cheap operation). This then allows us to add the
new clipped blob to the more complex polygon on the board without worry
that the contour may be compromised.
src/polygon.c