Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Check For Degenerate Triangles When Building A Mesh #44

Open
1 task
randomPoison opened this issue Dec 5, 2015 · 0 comments
Open
1 task

Check For Degenerate Triangles When Building A Mesh #44

randomPoison opened this issue Dec 5, 2015 · 0 comments

Comments

@randomPoison
Copy link
Owner

This issue was moved from #27, see that issue for previous discussion on remaining questions for handling this.

  • Perform validity checking on the triangle data to make sure there are no degenerate triangles.

The code that needs to be updated is in lib\polygon_rs\src\geometry\mesh.rs in MeshBuilder::build(). Currently MeshBuilder checks for issues like out-of-bounds indices and incorrect attribute counts, but it would also be good to check for other issues that indicate the mesh won't display as intended. Degenerate triangles (triangles where two or more of the vertices are the same) won't necessarily cause anything to break but are indicative of undesired behavior.

To check for degenerate triangles we only have to look at the indices: If two or more indices in a group of 3 are the same then the triangle is degenerate and we should emit a warning. I believe the best option is to emit a warning, rather than having mesh compilation fail and return an error because the mesh still technically works, though this is up for discussion.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant