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

Simplify face triangulation #135

Closed
pca006132 opened this issue Jun 5, 2022 · 4 comments
Closed

Simplify face triangulation #135

pca006132 opened this issue Jun 5, 2022 · 4 comments

Comments

@pca006132
Copy link
Collaborator

Currently, vertices coming from different meshes are labelled with different meshID, preventing them from merging. However, when joining manifolds face-to-face, it may be desirable to assign vertices with the same original meshID the same meshID and redo/simplify the face triangulation to reduce the number of vertices.

For example, consider the result of the Boolean.FaceUnion test:
image

Can we make it so that it will not have vertices in the middle?

@elalish
Copy link
Owner

elalish commented Jun 5, 2022

So this is intentional: imagine the two cubes have different textures applied; if these middle verts are removed, there is no way to apply the original textures. To get what you want, you simply need to call AsOriginal on the result. If that is not already calling SimplifyTopology internally, it probably should.

@pca006132
Copy link
Collaborator Author

Oh indeed, SimplifyTopology does work. I'm thinking about removing the originalIDs map and make meshID the same as original mesh ID, so adding two manifolds with the same original mesh ID will automatically give the simplified result.

It seems to me that some of the errors in samples test (mentioned in #125 (comment)) might be related to #102.

Should we keep this open until we fix this (removing the originalIDs map) or close this?

@elalish
Copy link
Owner

elalish commented Jun 5, 2022

No, I don't think we want to do that, for exactly the reason I put above. Even if those two boxes are identical and have the same textures applied to their faces (same originalID), you will still be unable to re-apply those textures to the result if those internal verts are missing.

@pca006132
Copy link
Collaborator Author

Oh OK I see, sorry I wasn't thinking about texture previously. Just thought of a way of optimizing this with lazy evaluation though :).

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