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

Fix custom indexing for edge picks #256

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MarkGillespie
Copy link
Contributor

Update picking logic to use custom indices when picking edges and halfedges.

I'm not totally sure if I got all of the recomputeIfPopulated(); calls correct in surface_mesh.ipp: this code works for my use case, but it's possible that there are more arrays that should really be recomputed when the edge, halfedge, or corner permutations are set. Also, now the code calls triangleAllEdgeInds.recomputeIfPopulated(); three times if the permutations are all set at once via SurfaceMesh::setAllPermutations is called.

@nmwsharp
Copy link
Owner

nmwsharp commented Mar 3, 2024

Thank you for this!

I'm looking over this and I've totally forgotten how this logic works :) What is the change in behavior before-after this PR? Is the old code buggy/crashing? Or did it ignore custom indexing in the picking UI?

@nmwsharp
Copy link
Owner

nmwsharp commented Mar 3, 2024

Also for these

size_t nCorners() const { return cornerDataSize == INVALID_IND ? nCornersCount : cornerDataSize; }

We probably ought to create two separate functions

size_t nCorners() const { nCornersCount; }
size_t cornerDataSize() const { return cornerDataSize == INVALID_IND ? nCornersCount : cornerDataSize; }

otherwise the nCorners() function will return something other than the number of corners, which could be super confusing.

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