I did a simple example of unioning three adjacent rectangles. I was expecting a single polygon returned, but instead I got two.
Starting point - 3 independent closed polygons:
e.g., the orange and green paths are both adjacent to the yellow path. But the resulting union solution set still includes the orange path as an independent entity.
Result of unioning those 3 polygons shown in black:
If I perform a second union on the results of the first, then it does indeed produce a single polygon.
A second observation is that if I OMIT the green path, then indeed the returned solution shows an actual union of the other two:
I don't really understand this output, if I am doign something wrong or if this is just a corner-case for the Clipper library?
Sample code is below. This is using C# Clipper labelled version 6.4.2 which came from the SourceForge download.
polygons may rarely share a common edge (though this is now very rare as of version 6)
I'm working on a perfect fix in a major Clipper update though that's progressing very slowly and no time frame for completion. (Slowly because of health reasons and it's very difficult to get this right.)
Last edit: Angus Johnson 2018-01-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
angus,
are you trying to reorder Active edges at same x pt .I had a version in which i would restart after every vatti scan line.--.I used to reorder the ael edges on x,dx. The polygon output splits disappear.BUT at a cost...the output contours were also regenerated after the vatti lines.
I noticed that one can have extra scan lines ,without effecting output) between the vatti lines.
And if onr somehow selects these extra scan lines to pass through the intersection points then martinez would be delightedto a tango with vatti.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One workaround would be to do n-1 union operations in order to union n objects. But that seems simplistic. Instead, is a better approach to keep unioning the contents of the solution set until it diminishes to a single contour or at least reduces to an unchanging minimum number of (possibly non-overlapping) contours?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you are lucky.In the vatti algorithm used the only assurance is that the the filled clipped area is available.There is NO gaurantee that 2 output contours in the solution will NOT share a edge....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did a simple example of unioning three adjacent rectangles. I was expecting a single polygon returned, but instead I got two.
Starting point - 3 independent closed polygons:

e.g., the orange and green paths are both adjacent to the yellow path. But the resulting union solution set still includes the orange path as an independent entity.
Result of unioning those 3 polygons shown in black:

If I perform a second union on the results of the first, then it does indeed produce a single polygon.
A second observation is that if I OMIT the green path, then indeed the returned solution shows an actual union of the other two:

I don't really understand this output, if I am doign something wrong or if this is just a corner-case for the Clipper library?
Sample code is below. This is using C# Clipper labelled version 6.4.2 which came from the SourceForge download.
Thanks!
Last edit: DaveInCaz 2018-01-09
From the FAQ:
From Clipper.Execute:
I'm working on a perfect fix in a major Clipper update though that's progressing very slowly and no time frame for completion. (Slowly because of health reasons and it's very difficult to get this right.)
Last edit: Angus Johnson 2018-01-10
angus,
are you trying to reorder Active edges at same x pt .I had a version in which i would restart after every vatti scan line.--.I used to reorder the ael edges on x,dx. The polygon output splits disappear.BUT at a cost...the output contours were also regenerated after the vatti lines.
I noticed that one can have extra scan lines ,without effecting output) between the vatti lines.
And if onr somehow selects these extra scan lines to pass through the intersection points then martinez would be delightedto a tango with vatti.
Thank you, I did not see that FAQ entry.
One workaround would be to do n-1 union operations in order to union n objects. But that seems simplistic. Instead, is a better approach to keep unioning the contents of the solution set until it diminishes to a single contour or at least reduces to an unchanging minimum number of (possibly non-overlapping) contours?
you are lucky.In the vatti algorithm used the only assurance is that the the filled clipped area is available.There is NO gaurantee that 2 output contours in the solution will NOT share a edge....