Alternative fix for 'encompassing hole' tree support issue #2152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request does 3 things:
I think explicitly excluding holes with branches inside them from being removed is better than re-adding the branches later.
My opinion about the fix in [CURA-12153] Fix 'encompassing hole' issue (tree support). #2145:
In the best case if the branches are added back, there is no difference between the hole being removed or not. Worst case something breaks:
If I understood the change there correctly it adds all branches in a hole aka negative-holes in a positive-hole, as a positive-hole, which later is then reversed and added back to the support area as a negative-hole. This should mean that if support density is larger than 0 this fix will cause confused people wondering why suddenly the area around the branches is filled with support infill, but the branch itself is not:
This is what it looks with this pull request:
(Why the branch paths are different between these two screenshots is an investigation for another day)
It correctly adds the change from Fix Tree-support lines overlapping with the model #2088
How the other solution, where I tried to solve it without an offset found its way back I do not understand. As seen by the example file given in the pull request [CURA-12153] Fix 'encompassing hole' issue (tree support). #2145 it sadly does not work and can cause inconsistent hole removal.
While debugging I noticed that this function takes longer than I would have expected. I found a small change that drastically increases the performance in this test-case. While it is not related to the things above, I don't see any reason to not include it.
Type of change
How Has This Been Tested?
Checklist: