I have several closed paths generated with another API. I want to use clipper to create the parent-child relationship among these closed paths. All the closed paths are separated and not self-intersecting.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Clipper makes those relationships automatically if you use PolyTree as a solution structure instead of Paths. Something like:
Clipper c = new Clipper();
PolyTree solution = new PolyTree();
c.AddPaths(subj, PolyType.ptSubject, true); // subj is your source paths as Paths structure
c.Execute(ClipType.ctUnion, solution);
Solution PolyTree is now filled with data representing the solution. Execute() makes an UNION operation, so it can change your coordinates in case of overlapping source polygons. But if none are overlapping, it just organizes the paths to represent their parent-child relationships.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello forum,
I have several closed paths generated with another API. I want to use clipper to create the parent-child relationship among these closed paths. All the closed paths are separated and not self-intersecting.
Thanks
Clipper makes those relationships automatically if you use PolyTree as a solution structure instead of Paths. Something like:
Clipper c = new Clipper();
PolyTree solution = new PolyTree();
c.AddPaths(subj, PolyType.ptSubject, true); // subj is your source paths as Paths structure
c.Execute(ClipType.ctUnion, solution);
Solution PolyTree is now filled with data representing the solution. Execute() makes an UNION operation, so it can change your coordinates in case of overlapping source polygons. But if none are overlapping, it just organizes the paths to represent their parent-child relationships.