ON_Mesh Quad and Triangles


#1

If I have an ON_Mesh that is a combination of QUADs and triangles
Does the m_F order the facets to be the first n are quads, the next m are triangles
or are there interspersed together.

I see I can get the counts via m_quad_count and m_triangle_count


(Menno Deij - van Rijswijk) #2

They can be interspersed, depending on the ordering that was used when the mesh was created. Triangles have the same C and D vertex index.


(Dale Fugier) #3

If you need just quad (or triangles), you can do something like this:

ON_Mesh mesh = .....;
for (int fi = 0; fi < mesh.m_F.Count(); fi++)
{
  const ON_MeshFace& face = mesh.m_F[fi];
  if (face.IsQuad())
  {
    // TODO...
  }
  else //if (face.IsTriangle())
  {
    // TODO...
  }
}