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

BOUNDARY-LIST only works with some of the meshes that cl-wavefront produces #3

Open
scymtym opened this issue Sep 24, 2023 · 3 comments

Comments

@scymtym
Copy link
Collaborator

scymtym commented Sep 24, 2023

Background: cl-wavefront puts vertex data, that is vertex positions and possibly things like vertex normals and uv coordinates into a flat array.
Faces are described as indices into this array.
Vertices with identical positions but differences in other attributes appear to be stored as distinct spans of values in the vertex data array.

The problem: boundary-list relies on vertex indices to identify edges that are incident to multiple faces and thus distinguish boundary edges from inner edges.
This does not work if the "same" vertex is referenced through multiple different indices.

How should this be addressed?
One option would be to make boundary-list accept an optional vertex position array and identify edges by the positions of the referenced vertices.
Another options would be to just not support meshes with this structure.

@Shinmera
Copy link
Member

For our current use-case you should be able to use normalize first to fuse identical vertex positions.

@Shinmera
Copy link
Member

Otherwise I don't think it should be a requirement that vertices be fused in general, since it would lead to situations where information has to be destroyed, for instance if you keep extra vertex data out of band.

@scymtym
Copy link
Collaborator Author

scymtym commented Sep 25, 2023

Otherwise I don't think it should be a requirement that vertices be fused in general, since it would lead to situations where information has to be destroyed, for instance if you keep extra vertex data out of band.

To achieve that, the interface would have to be extended with an additional way of recognizing identical vertices. As one idea, we could add a key parameter which would be supplied by the caller to map vertex indices from the faces array to canonical vertex indices.

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