Improved management of fauxbit for quad and polygonal meshes in OBJ (did not set the high level polygonal bit) and OFF (wrong faux bits for polygonal faces with more than 4 sides)

This commit is contained in:
Paolo Cignoni 2013-04-12 09:49:51 +00:00
parent 371ff46282
commit e77e13a8fe
2 changed files with 70 additions and 60 deletions

View File

@ -416,6 +416,8 @@ namespace vcg {
GoodObjIndex(indexTVect[pi],oi.numTexCoords);
polygonVect[0][pi].Import(m.vert[indexVVect[pi]].cP());
}
if(vertexesPerFace>3)
oi.mask |= Mask::IOM_BITPOLYGONAL;
if(vertexesPerFace<5)
InternalFanTessellator(polygonVect, indexTriangulatedVect);

View File

@ -463,6 +463,14 @@ namespace vcg
mesh.face[f+j/3].V(0) = &(mesh.vert[ vertIndices[ indexTriangulatedVect[j+0] ] ]);
mesh.face[f+j/3].V(1) = &(mesh.vert[ vertIndices[ indexTriangulatedVect[j+1] ] ]);
mesh.face[f+j/3].V(2) = &(mesh.vert[ vertIndices[ indexTriangulatedVect[j+2] ] ]);
// To correctly set Faux edges we have to clear the faux bit for all the edges that do not correspond to consecutive vertices
// Consecutivity is in the space of the index of the polygon.
for(int qq=0;qq<3;++qq)
{
if( (indexTriangulatedVect[j+qq]+1)%indexTriangulatedVect.size() == indexTriangulatedVect[j+(qq+1)%3])
mesh.face[f+j/3].ClearF(qq);
else mesh.face[f+j/3].SetF(qq);
}
}
}
f+=trigs;