hxGeomAlgo icon indicating copy to clipboard operation
hxGeomAlgo copied to clipboard

ADDED self-intersecting polygon decomposition

Open pshtif opened this issue 10 years ago • 2 comments

Added a method decomposeSelfIntersecting which will decompose specified polygon into an array of simple polygons. Its just a first draft out of my mind with possible optimizations, I didn't use any source material.

pshtif avatar Jul 15 '14 09:07 pshtif

Thanks for taking a crack at this. It would be really nice to have this feature.

From testing your initial impl. I can see that the resulting decomposing polys can sometimes overlap, which could be unwanted (you can try it with a star-shaped self-intersecting poly).

azrafe7 avatar Jul 16 '14 17:07 azrafe7

Yea I am well aware that results can overlap thats what I was after instead of substraction of such polys which is common behavior in some other poly renderers. Anyway this method has bugs and will not work when first/last segment intersect with something I already fixed that and will commit new.

pshtif avatar Jul 16 '14 17:07 pshtif