I need to remove some hidden faces that are inside a closed triangular mesh. I've found a way to do it using MeshLab, but there are two problems: 1) the article says that it could fail in some cases (can you image in which cases?) and 2) I would like to d开发者_开发知识库o it programatically (do you know of any existing implementation?). I don't even know the name of this kind of simplification filters.
I would really appreciate any hint.
The most obvious (but almost certainly not the most efficient one) algorithm to do that is as follows:
- Consider one triangle in the mesh. Draw three lines between the three vertices of the triangle and camera point. (If the camera is infinitely far away just consider the direction of viewpoint).
- If all the drawn lines intersect with triangulated surface, do not display the triangle under consideration. If only some of them do, partially show the triangle.
- Repeat for all the triangles in the mesh.
What you want to do is deleting faces wich are inside a geometric figure once and for all.
Romans solution may be acceptable if you only want to look at the object from 1 direction. Since non visible surfaces may become visible, if you rotate the camera, it is not an acceptable solution.
Using floodfill works with multi dimensional arrays, but does it also work with 3D Koordinates? since surfaces are not always (int) and have other inclination than (1,0,0), (0,1,0) (0,0,1), this approach, in my oppinion, does not work either.
the cases in wich the algorithm may fail: The occlusion value computed tells you wheter or not the vertices of your surface are inside your object. However: although all vertices are inside the object, part of the surface may show anyway. Consider this: You have three elevated Objects, each containing a Vertex inside. While the vertices are not shown, the surface spanned between them is partially visible.
I myselve cannot help you, since I am also looking for an algorithm wich can do this.
greets
精彩评论