3dpolygonmeshlabquad

What 3D API does MeshLab use?


I am looking to display quad meshes on the surface when loading OBJ files composed of quadrilateral polygons.

MeshLab seems to be the only tool I've found that supports quad meshes. Upon researching, I've learned that OpenGL, WebGL, and Three.js only supported quad meshes in older versions.

I am curious about how MeshLab implements the visibility of quad meshes and whether there is a way to achieve this using current versions of OpenGL, WebGL, or Three.js. Does anyone have information on the technology stack that MeshLab uses?

Thank you.


Solution

  • Meshlab uses a library named VCG (http://www.vcglib.net/) which is maintained by same developers than Meshlab. The render is done with OpenGL.

    VCG can store polygons of any number of sides, and uses an hidden array of "Faux Edges" to store a list of edges that split those polygons into the triangles that are sent to the gpu to be rendered using OpenGL.

    Faux (from French, fake) Edges are artificial hidden edges that decompose a polygonal face into triangles. They are automatically inserted by VCGLib when reading a non-triangular mesh to be stored as an internal triangle mesh and to be able to apply many algorithms that are only defined for triangle meshes.

    For example, when the well-know Blender Suzanne Monkey model (formed by quad and triangle faces)

    Original Suzanne Monkey

    is loaded into meshlab as a quad mesh, but one faux edge per quad is added under the hood to store it as a triangle mesh. In the image below "Real" or "Nonfaux" edges are rendered in black, while Faux edges are rendered in red.

    Faux Edges in Suzanne

    Unless explicitly indicated, any algorithm that operates on edges (for example, Select crease edges) will only operate on "real edges" and not on faux edges, but many other algorithms (for example, Laplacian Smooth) will operate use faux edges to compute the smooth filters as if the mesh is formed only with triangles.

    Internally, the edges have one VCG flag to determine if they are faux or not, but normally this is not exposed to MeshLab users.

    Upon saving a mesh with faux edges, those will not be saved into the file. So internal triangles of the model that share a faux edge will be joined into a polygonal face.