Skip to content

Change CGAL Union to join least complex geometries first.#3121

Merged
thehans merged 1 commit intoopenscad:masterfrom
thehans:issue1234
Nov 10, 2019
Merged

Change CGAL Union to join least complex geometries first.#3121
thehans merged 1 commit intoopenscad:masterfrom
thehans:issue1234

Conversation

@thehans
Copy link
Member

@thehans thehans commented Nov 6, 2019

This change uses a priority_queue (min heap) sorted by number of face(t)s in each geometry. So the two least complex objects are always merged first. Temporary results go back into the priority queue so it adapts as complexity changes. The queue is also secondarily sorted by node.progress_mark when complexity matches, which should act as a stable sort.

Reasoning for keeping the sort stable is based on the assumption/heuristic that consecutive sibling nodes are likely to be close to each other in space, which is more likely to cause reduction in complexity for example in a loop of identical translated objects.

Also change to progress bar update during union.

For issue #1234

Update progress more regularly during union.
Copy link
Member

@kintel kintel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

I wonder if such an optimization really belongs in CGAL itself, but this works for us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants