1

Note that this question is not about particular software. Rather, question is about mesh visualization in general.

I have problem in visualizing a mesh file https://gist.github.com/HiroIshida/1ef3bc47e27b36e88890516e78b0a587

Although it seems that there is no holes inside mesh, mesh cannot be visualized properly by trimesh python library. In this case, the surface is supposed to be viewed from the outside because the camera is outside of the mesh, but the surface from the inside is visualized. (see the gif file below) From this visualization, we can observe that there is no holes.

enter image description here

This behavior is not trimesh specific. meshlab software also cannot visualize the mesh properly as below. In this case, from outside the surface is black-out, and can be seen properly only from inside.

enter image description here

My question: What's wrong with my mesh file?

orematasaburo
  • 1,207
  • 10
  • 20

2 Answers2

2

The problem can be fixed by flipping the facet, i.e., by changing the order of vertex indices of each facet.

orematasaburo
  • 1,207
  • 10
  • 20
0

The problem is that the graphic cards, and computers in general, use the order in which the vertex are stored to determine the orientation of the normal of each triangle, then the render pipeline use the normal to determine if a triangle is visible (as in trimesh) or illuminated (as in meshlab). The orientation choosed as "visible" depends of the rendering program, but every graphic card respect the default orientation used by OpenGL for more than 30 years now.

So the problem is that the source your mesh (the program that writes the file) is ordering and storing the triangles in the opposite order expected for your graphic card. As you stated in your self-answer, you can repair one file by manually changing the order of vertex. But I would recommend to revise your source program to always store the triangles in the expected order.

Rockcat
  • 3,002
  • 2
  • 14
  • 28