Fix poly_ComputeInteriorPoint() to work correctly for holes
The step where the algorithm finds a convex node to start from must
take into account whether the polygon vertices are ordered as a hole
or an outer contour. We now correctly compute a point inside the hole,
rather than possibly outside it.
This fixes an assertion on the following test-case. Prior to this
commit, the incorrect "interior" point tested for the concave hole
happens to lie inside the polygon's other hole, causing it to fail
an assert during processing.
Layer(2 "solder")
(
Line[340000 160000 183700 108000 1500 3000 "clearline"]
Line[92000 121000 120000 90000 1500 3000 "clearline"]
Line[270000 90000 120000 90000 1500 3000 "clearline"]
Polygon("clearpoly")
(
[40000 40000] [320000 40000] [320000 200000] [40000 200000]
)
)
The bug was created in my attempt to speed up poly_ContourInContour:
commit
3d0a8bd1dae0816d364a774bf9b958faf2983ec7