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

How to set property per (triangle, vertex) tuple? #1114

Closed
shikui08 opened this issue Dec 18, 2024 · 3 comments
Closed

How to set property per (triangle, vertex) tuple? #1114

shikui08 opened this issue Dec 18, 2024 · 3 comments

Comments

@shikui08
Copy link

AFAIK, the function Manifold::SetProperties don't distinguish vertex shared by multiple triangles.

const int numTri = NumTri(); triProperties.resize(numTri); for (int i = 0; i < numTri; ++i) { for (const int j : {0, 1, 2}) { triProperties[i][j] = pImpl->halfedge_[3 * i + j].startVert; } }
Say I want a cube with sharp edges, so normal don't blend. How can I possibly do that?

@pca006132
Copy link
Collaborator

I think you need to use MeshGL for this. Duplicate the vertices, and set the appropriate mergeFromVert and mergeToVert.

@shikui08
Copy link
Author

shikui08 commented Dec 18, 2024

I think you need to use MeshGL for this. Duplicate the vertices, and set the appropriate mergeFromVert and mergeToVert.

Thanks for your reply. Also checking test cases TEST(Boolean, Normals) in boolean_test.cpp. Seems to work this way.

@pca006132
Copy link
Collaborator

Feel free to open a discussion if needed. Closing for now.

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

No branches or pull requests

2 participants