What is the input and output of MMG2D_Get_triangle

Dear sir:
I want to get the three vertices of a triangle, but I am confused by the input and output of the function.
MMG2D_Get_triangle(mmgMesh,v0,v1,v2,re,isRequired)
In this function, what is the meaning of “re” and “isRequired”.
Will it return the vertices of all triangle in the mesh?
Regards

Hello,

This function allows to recover only one triangle of the mesh. If you have nt triangles in your mesh, you must call it nt times and it will return the mesh triangles in their numbering order. If you want to get all the triangles of the mesh in one function calling, you must use the MMG2D_Get_triangles function.

For the MMG2D_Get_triangle prototype:

  • The 3 vertices you are looking for are stored in v0, v1 and v2.
  • the ref field contains the reference of the triangle (its “color”): you need different references to impose different boundary conditions (for references associated to edges) or if you have a multidomain mesh (triangle references);
  • the isRequired field allow to recover required entities (which means freezed entities that the remesher is not allowed to remesh);
  • the ref and isRequired field are optional, you can give a null pointer to the function if you dont want to get this informations.

I hope that it will help,

Regards

Algiane

1 Like

Thank you. I get it.