-
-
Notifications
You must be signed in to change notification settings - Fork 890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix xy-support distance #2000
Merged
Merged
Fix xy-support distance #2000
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
But instead calculate for each point the closest point on the "other" layer. Unfortunatly this means a nest for loop, looping through all points of the current layer, and for each of those points looping through all points of the other layer. This could mean a decrease in performance, but code is a lot more managable. CURA-11098
# Conflicts: # src/support.cpp
This reverts commit b33c2e5
saumyaj3
reviewed
Dec 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Some history
PR with some fixes regrading the xy-distance. The XY-distance was a bit broken before. The issues were introduces by a feature called varying xy-distance (https://ultimaker.atlassian.net/browse/CURA-10297). The feature was nice, in theory, but the implementation was a bit over complicated. In cura we have two xy-distances; xy-disance and minimum xy-distance. The idea was that for vertical walls we would use the xy-distance to avoid support from coming too close to the walls. However, for angled walls we would use the min xy-distance. Reason for this is that, when using the xy-distance, the support would be to far away and not properly support the walls.
This has always worked quite nicely in the past. However, there is one somewhat unexpected consequence from this behavior, and that is that when a wall transitions from being "angled" to being completely vertical the xy distance would jump from the min xy-distance to the xy-distance.
In the example this behavior is a bit odd, but quite alright. However, when we have models with "organic near straight walls" the behavior would be come unpredictable and a bit chaotic. Case in point the screen shot below. Here the xy distance is visualized.
This is solved using the varying xy-distance feature. Here the xy-distance is gradually changes with the wall angle. So for completely vertical walls the xy-distance is used, but as the wall changes angle the xy-distance gradually transitions with this angle.
When the feature first was implement a voronoi diagram was used to calculate the distance between a point on the current layer and the closest point to this point on the next layer. As you can imagine this produced some weird results. The particular code in question is now changed in this PR by a simple for loop that for each point$p_a$ on the current layer loops through all points $p_b$ of the next layer in order to find the closes point to $p_a$ .
Reviewer, please pay attention to the performance of this ticket; the algorithm in question is changed from a$O(\log(n))$ algorithm to a $O(n^2)$ algorithm. However, since voronoi performance was a bit unpredictable anyways, and the new code is much simpler I don't think this is a big issue.
xy-distance before
xy-distance after