Repository navigation
Replies: 2 comments 7 replies
|
I am implementing a similar idea. After the sweep process is finished, I sort all collected intersection points by segment index. Then, for each segment, I sort its intersection points by their distance from one endpoint of the segment. After sorting along the segment, we get: Now the original segment can be split in the correct order. This avoids modifying the sweep-line structure while it is running, which reduces many corner cases. And it also 2x faster then breaking segments on the fly. |
|
For this example my lib convert it to AD'BCD'A where AD' and D'A will be opposite vectors and after merging we get D'BC. The core rule not to keep original points (some times it's just impossible) but to keep contours closed. And yes in subgrid dimensions it can give lots of artefacts. The advantage is a stable topology. Here is a similar case bellow you can play with it online in some tests (test_9) where grid is visible you can see how it's snapping
|


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have write a new Boolean lib based on snap rounding algorithm. Here is an introduction to snap rounding algorithm in CGAL page.
Snap rounding promise topo consistent, so there will be no robust problem like mentioned in the clipper2 page.
There are still many works to do, if you have interest, you can try and help to complete it.
(I use BVH but not scan line, because there are too many corner cases to combine snap rounding algo and scanning line and I don't know how to write it. If anybody can write snap rounding with scanning line, please let me know, thanks.)
All reactions