Clipper lib can produce single loop that in fact contains more than one Polygon.
There is existing SplitInternalLoops function but often I has no opportunity to be called since exception is thrown.
I only covered Profile creation but issue is reproducible for both Polygon and Profile.
DESCRIPTION:
Internal SplitInternalLoops and RemoveSequentialDuplicates are moved to Vector3 static section for better reusability.
In ToPolygon, use DeleteVerticesForOverlappingEdges, RemoveSequentialDuplicates and SplitInternalLoops so Polygons are created from already split loops.
Internal ToPolygon now returns list of Polygon.
Change Profile.Union so it uses PolyTree as other functions and not List<List<ClipperLib.IntPoint>>();
Remove internal Profile.Clip as it was not used and was hard to update. In my opinion there is no value in keeping it around.
BACKGROUND:
DESCRIPTION:
SplitInternalLoops
andRemoveSequentialDuplicates
are moved to Vector3 static section for better reusability.DeleteVerticesForOverlappingEdges
,RemoveSequentialDuplicates
andSplitInternalLoops
so Polygons are created from already split loops.ToPolygon
now returns list of Polygon.Profile.Union
so it usesPolyTree
as other functions and notList<List<ClipperLib.IntPoint>>();
Profile.Clip
as it was not used and was hard to update. In my opinion there is no value in keeping it around.TESTING:
DifferenceProduceTwoResultsInOneLoop()
test.REQUIRED:
CHANGELOG.md
.This change is ![Reviewable](https://reviewable.io/review_button.svg)