Skip to content
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

[CURA-11974] better non vertex seams #2100

Merged
merged 9 commits into from
Jun 21, 2024

Conversation

rburema
Copy link
Member

@rburema rburema commented Jun 19, 2024

Split off from: #2087

For user defined seam locations, the last ticket left us in a situation where it was calculated to be the closest point on the polygon. While this is technically correct in a sense, this would not make the newly made vertices (made for the seam) line up 'correclty'. Instead specify a line from the origin of the model and intersect.

Also, while a new vertex was made, the rest of the algorithm would still occasionally pick other vertices. Probably for very defensible reason(s) when dealing with arbitrary vertices, but not wanted when we explicitly make a vertex at the specified location.

rburema and others added 6 commits June 19, 2024 14:13
… center.

In isolation, you'd really want the actual closest point on the polygon, however, that'd make the seams not fit together for polygons with different sizes and shapes, especially if rounding is involved.

start of CURA-11974 (split off from CURA-9474).
…rst, and disable for shortest.

Since as polygons shift over the players, their center also changes, we need to be careful to get the same point each time (or at least try to, since if it's not the polygon center anymore but that of the entire model, the intersection with the line from that center to the requested point might not exist). Also disable _any_ of this new behaviour (also the previously introduced) for the 'shortest.'

part of CURA-11974
Otherwise the algo would still occasionally choose other vertices, despite there being only one that we actually want it to land on. This would make the seams look messy in 3D space.

part of CURA-11974
Copy link
Contributor

@wawanbreton wawanbreton left a comment

Choose a reason for hiding this comment

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

Minor suggestions, feel free to decline them.

include/utils/linearAlg2D.h Outdated Show resolved Hide resolved
include/utils/linearAlg2D.h Outdated Show resolved Hide resolved
@wawanbreton
Copy link
Contributor

wawanbreton commented Jun 21, 2024

I took the liberty of making a last small modification, that IMHO makes the code more readable, and agree with our own standards.
Sorry that I didn't see that during the first review...

@HellAholic HellAholic merged commit f4abac6 into main Jun 21, 2024
27 checks passed
@HellAholic HellAholic deleted the CURA-11974_better_non_vertex_seams branch June 21, 2024 08:20
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.

3 participants