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

Getting rid of black triangle #1

Open
forthtremple opened this issue Feb 27, 2014 · 1 comment
Open

Getting rid of black triangle #1

forthtremple opened this issue Feb 27, 2014 · 1 comment

Comments

@forthtremple
Copy link

Thanks for the great app. A problem I'm finding with it is there is a black triangle that appears occasionally. Do you have any ideas what is causing this?

@aeriksson
Copy link
Owner

Thanks! The holes are caused by an issue in the original marching cubes algorithm (which the code is using).

The marching cubes algorithm works by sampling the scalar field over a 3D grid, and rendering triangles between the points of the grid based on the sign of the scalar field at these points. However, this is a bit naive and will occasionally lead to ambiguities, which have to be resolved by sampling at additional points. When these ambiguities are resolved in the wrong way (which will happen in ~50% of cases), holes appear in the mesh. See http://undergraduate.csse.uwa.edu.au/units/CITS4241/Handouts/ppt/Lect07-Disambig.pdf or http://users.polytech.unice.fr/~lingrand/MarchingCubes/algo.html for details.

The issue can be resolved by switching to a more intricate algorithm (e.g. any of http://swiftcoder.wordpress.com/planets/isosurface-extraction/ or https://en.wikipedia.org/wiki/Marching_tetrahedra) or by identifying the ambiguous cases.

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