Problem Performing Facet Union

I have two circles in the same plane that I’m try to create a union.

But it creates a screwed up out of plane facet. Attached is the file. Running version 2.9.27 on MacOS Serria.

I Also tried to do an XOR on a facets in another model with very similar shapes and it also generated the same problem. However, when I tried version 9.2.26 it worked fine.

Cricle Union.zip (201.7 KB)

Hi Alan: there’s clearly a problem in creating facet unions when two facets intersect like that, with no real intersection points, I tried it now on my laptop running versions Win 2.9.27, same result as you.
As I understand, Marton’s algorithm (different and much more powerful compared to the simple one I had implemented in the DOS-based version of the code) can do unions only when two sides of the neighboring polygons are common, i.e. exactly the same. Whether they need to be defined by the same vertices I don’t know, I mean the common segment to unite… Marton can clarify that, I’m sure.
In your case I managed to create the “boolean union facet” by extruding the 3 circles by 10 cm, and using the split command on the appropriate intersecting facets. I did this after I created copies of the 3 original facets and moved in the +X directions by +50 cm (just not to overlap them to the 3 original ones), and then again +50 cm (see screenshot).
I then created 3 separate facets having one side in common with another one, by selecting the vertices and using the “Vertex” “Create Facet from Selected” “Convex Hull” command, so that the “Facet” “Union” command in Molflow+ now can work as intended.
The result is in attachment, see also screenshot.
There are several intermediate facets, you may want to deleted. The “final” composite facet union of the bigger circle and the two side smaller ones is facet no. 2675. To put this final union facet in the right place you need to select it and move it by -100 cm in the X direction.
On the screen shot you can also see the additional vertices that were created when I had extruded the 3 circles separately, and I had removed the extruded facets after finding the 4 intersections/splits on the copy moved by +50 cm (in the middle of the 3)… hope it is clear what I mean. You can obsviously delete these additional, unused vertices.
Cheers.


Cricle Union_mod.zip (211.4 KB)

Hello Alan,

I updated the Clipper2 library that performs the Boolean operations between facets from 2.9.26 to 2.9.27. It seems that there is something wrong, we’ll investigate. If the source of the problem is with the third-party library, it might take more time. I’ll report back,

Marton

Hello Alan,

Thanks to the quick diagnosis by @ptrifuno , when updating the library, a certain default value that we use to mark if a vertex is new, changed from -1 to 0. Because of this, every new vertex of the union pointed to the first vertex in your geometry, the tip of the triangle:

Screenshot 2025-03-05 at 12.21.46

I adapted our code and now it works as expected:

Many thanks for reporting this.
You can download the new version from here (build-artifact column), wait for 2.9.28, or use Roberto’s workarounds. @rkerseva , thank you for tricks that save the day!

Marton, glad you guys figured it out quickly, and Roberto, thank you for continuing contributions to the Molflow+ community. My interterm solution was just to use the older version when I run into this problem while building my geometry. I’m still in the novice learning stage on how to use GitLab to make changes and compile the code.

Cheers,
Alan

Thanks Alan.
Just to be clear (I hope I didn’t misunderstand your last sentence): you don’t need to compile the code yourself.

You follow the link above, click on build-artifact-macos-arm:

Click download on the right side:

And it gives you a custom Molflow version that you can run the usual way, after extracting the ZIP:

Screenshot 2025-03-06 at 12.30.09