Given that all your rings are wound in the same direction (e.g. outer rings anti-clockwise and holes clockwise), you could perform a union operation with your rings as subject polygon, an empty clip polygon, and a fill rule of NonZero.
Last edit: Jay Tee 2021-12-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, if your rings / contours are randomly generated, which rule do you apply to decide which parts are inside / outside? The EvenOdd rule? In that case, I don't understand how you want to union them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I am just playing with a odd even rule based old program.The
output shows intersections.
And I thought Doinga union might help.
The union can be done over the filled regions in each polygon. no.?.
Sorry, I don't understand what you are trying to achieve. Let's consider an example. I randomly generated some rings and filled them via the EvenOdd rule (see below). What do you expect the union to look like?
I want the image to be same if i add individual contours incrementally to previous result ..one contour at a step,Initial result contour can be any one of the input contours. ..Filled Area covered by the contours is what i require...?
Last edit: Ignorant 2021-12-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, in that case, you can successively set your previous result (initially, an empty polygon) as subject, your new contour as clip (or vice versa) and execute a union operation with the EvenOdd rule for the new contour. You will need one complete iteration over all scanbeams (i.e. one run of Vatti's algorithm) per contour you add. In the general case, it won't become computationally "cheaper" than that . I think we already discussed the topic of "partial" invocations of the algorithm (i.e. starting at an arbitrary scanline), but I still don't see how to implement that in a robust manner.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes ..Thank you a lot for your explanation.
Murtas method does work for even odd to start at arbitrary scan line and terminate also at a scan line above it...but holes at boundry scan Lines disappear though the non holes change accordingly..
Angus clipper and Murta easily allow to terminate at any scan line for Even-odd.
I have done that with clipper for odd even only. I have not tried with other windings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You're welcome :) Yes, terminating at an arbitrary scanline should work if you artificially close the open outputs there (even with different fill rules), but starting in the middle is a problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jay,
I got hold of a original release announcement for the general polygon
clipper..very old ..got it from wayback archives.
It says multiple polygons are allowed on either side only if they are
disjoint in the subject group and clip group. for gpc.
In the XOR operation it shows some unexpected behaviour if edges within
a beam are bundled.(Murta transform of edges).
The XOR was introduced in the vatti family by MURTA with his Generic
Polygon Clipper.
I have edit his version 2.32 and 2.33(later withdrawn!) to get equivalent
results with Angus Clipper which uses Murta Qudrants while extending to
other
windings.
You had educated me that for oddeven windings only 2 codes are required
for intersectedges in Angus Clipper .
That is true for gpc without bundles...but fails in a very surprising way
for MURTA bundles within a scan beam...
what is your say on XOR,?
Yes, I'm still sure this is correct, but only for the even-odd wind rule. In that case, every edge is contributing (= associated with an output polygon). Subsequently, there are only two possible constellations for intersecting edges (see attachments). Both are handled by pushing the intersection point to both outputs.
I am not familiar with the definition of "Murta bundles", but I guess the term refers to coincident edges that are "bundled together" (?) ... This approach is not necessary for Vatti's Algorithm to work correctly as long as the sort function is stable and does not unexpectedly swap coincident edges without generating an intersection for them. And I don't think it accelerates the algorithm in the general case, but complicates it instead. Anyway, XOR is not affected by coincident edges at all, there are still only two cases.
Do I Understand that for the XOR operation all edges are HOT (i.e. have a attached output contour) only for odd even.?. I never played with other windings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Ignorant. Once again, it would be really helpful if you stopped quoting previous messages in you reply posts. People can already see previous messages so you're just adding a lot of noise with this quoting.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How does one do a union of polygon collections....in the minimal passes over the data sets...
Given that all your rings are wound in the same direction (e.g. outer rings anti-clockwise and holes clockwise), you could perform a union operation with your rings as subject polygon, an empty clip polygon, and a fill rule of NonZero.
Last edit: Jay Tee 2021-12-18
Thank you ..Thank you...
So there is a usage of NONZERO fill rules for my explorations....
I tried with odd/even and got sore eyes...
But how do I orient my randomly generated Closed Contours ..They may be self intersecting ...No meaning of clockwise./anticlockwise
Last edit: Ignorant 2021-12-20
Well, if your rings / contours are randomly generated, which rule do you apply to decide which parts are inside / outside? The EvenOdd rule? In that case, I don't understand how you want to union them.
Well, I am just playing with a odd even rule based old program.The
output shows intersections.
And I thought Doinga union might help.
The union can be done over the filled regions in each polygon. no.?.
On Mon, Dec 20, 2021 at 4:44 PM Jay Tee jay-tee@users.sourceforge.net
wrote:
Last edit: Ignorant 2022-02-27
Sorry, I don't understand what you are trying to achieve. Let's consider an example. I randomly generated some rings and filled them via the EvenOdd rule (see below). What do you expect the union to look like?
I want the image to be same if i add individual contours incrementally to previous result ..one contour at a step,Initial result contour can be any one of the input contours. ..Filled Area covered by the contours is what i require...?
Last edit: Ignorant 2021-12-22
Okay, in that case, you can successively set your previous result (initially, an empty polygon) as subject, your new contour as clip (or vice versa) and execute a union operation with the EvenOdd rule for the new contour. You will need one complete iteration over all scanbeams (i.e. one run of Vatti's algorithm) per contour you add. In the general case, it won't become computationally "cheaper" than that . I think we already discussed the topic of "partial" invocations of the algorithm (i.e. starting at an arbitrary scanline), but I still don't see how to implement that in a robust manner.
Yes ..Thank you a lot for your explanation.
Murtas method does work for even odd to start at arbitrary scan line and terminate also at a scan line above it...but holes at boundry scan Lines disappear though the non holes change accordingly..
Angus clipper and Murta easily allow to terminate at any scan line for Even-odd.
I have done that with clipper for odd even only. I have not tried with other windings.
You're welcome :) Yes, terminating at an arbitrary scanline should work if you artificially close the open outputs there (even with different fill rules), but starting in the middle is a problem.
Jay,
I got hold of a original release announcement for the general polygon
clipper..very old ..got it from wayback archives.
It says multiple polygons are allowed on either side only if they are
disjoint in the subject group and clip group. for gpc.
In the XOR operation it shows some unexpected behaviour if edges within
a beam are bundled.(Murta transform of edges).
The XOR was introduced in the vatti family by MURTA with his Generic
Polygon Clipper.
I have edit his version 2.32 and 2.33(later withdrawn!) to get equivalent
results with Angus Clipper which uses Murta Qudrants while extending to
other
windings.
You had educated me that for oddeven windings only 2 codes are required
for intersectedges in Angus Clipper .
That is true for gpc without bundles...but fails in a very surprising way
for MURTA bundles within a scan beam...
what is your say on XOR,?
Last edit: Ignorant 2022-02-27
Yes, I'm still sure this is correct, but only for the even-odd wind rule. In that case, every edge is contributing (= associated with an output polygon). Subsequently, there are only two possible constellations for intersecting edges (see attachments). Both are handled by pushing the intersection point to both outputs.
I am not familiar with the definition of "Murta bundles", but I guess the term refers to coincident edges that are "bundled together" (?) ... This approach is not necessary for Vatti's Algorithm to work correctly as long as the sort function is stable and does not unexpectedly swap coincident edges without generating an intersection for them. And I don't think it accelerates the algorithm in the general case, but complicates it instead. Anyway, XOR is not affected by coincident edges at all, there are still only two cases.
Last edit: Jay Tee 2022-02-24
Last edit: Ignorant 2022-02-27
Do I Understand that for the XOR operation all edges are HOT (i.e. have a attached output contour) only for odd even.?. I never played with other windings.
Not necessarily. Yes, all edges will be HOT when using EvenOdd filling. But they won't be HOT when using NonZero filling and Abs(edge.WindCount) > 1;
Hi Ignorant. Once again, it would be really helpful if you stopped quoting previous messages in you reply posts. People can already see previous messages so you're just adding a lot of noise with this quoting.
Sorry, I dont know how to use gmail properly.I will be careful when i use the reply option.!
Thanks. 👍