added one flag in Triangulate to modify only selected faces

This commit is contained in:
nico 2019-04-26 16:54:43 +10:00
parent 02e04e901a
commit 67cb231cc3
1 changed files with 7 additions and 1 deletions

View File

@ -1380,18 +1380,24 @@ public:
}while (!NeedMerge.empty());
}
static void Triangulate(PolyMeshType &poly_m, bool alsoTriangles = true)
static void Triangulate(PolyMeshType &poly_m,
bool alsoTriangles = true,
bool OnlyS=false)
{
size_t size0 = poly_m.face.size();
if (alsoTriangles)
{
for (size_t i=0; i<size0; i++)
{
if ((OnlyS)&&(!poly_m.face[i].IsS()))continue;
Triangulate(poly_m, i);
}
}
else
{
for (size_t i=0; i<size0; i++)
{
if ((OnlyS)&&(!poly_m.face[i].IsS()))continue;
if (poly_m.face[i].VN() > 3)
{
Triangulate(poly_m, i);