Refactored selection face from vertices algorithms and added requiremnts for triangular mesh for the algorithm selecting vertices starting from face border flag
This commit is contained in:
parent
85c5274965
commit
18c0ac1681
|
@ -303,16 +303,15 @@ static size_t VertexFromFaceStrict(MeshType &m)
|
|||
static size_t FaceFromVertexStrict(MeshType &m)
|
||||
{
|
||||
size_t selCnt=0;
|
||||
int i=0;
|
||||
FaceClear(m);
|
||||
FaceIterator fi;
|
||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( !(*fi).IsD())
|
||||
{
|
||||
for(i = 0; i < (*fi).VN(); ++i)
|
||||
bool selFlag=true;
|
||||
for(int i = 0; i < (*fi).VN(); ++i)
|
||||
if(!(*fi).V(i)->IsS())
|
||||
break;
|
||||
if(i == (*fi).VN())
|
||||
selFlag =false;
|
||||
if(selFlag)
|
||||
{
|
||||
(*fi).SetS();
|
||||
++selCnt;
|
||||
|
@ -325,17 +324,15 @@ static size_t FaceFromVertexStrict(MeshType &m)
|
|||
static size_t FaceFromVertexLoose(MeshType &m)
|
||||
{
|
||||
size_t selCnt=0;
|
||||
int i=0;
|
||||
FaceClear(m);
|
||||
FaceIterator fi;
|
||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( !(*fi).IsD() && !(*fi).IsS())
|
||||
for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( !(*fi).IsD())
|
||||
{
|
||||
bool selVert=false;
|
||||
for(int i = 0; i < (*fi).VN(); ++i)
|
||||
if((*fi).V(i)->IsS())
|
||||
break;
|
||||
if(i < (*fi).VN())
|
||||
{
|
||||
if((*fi).V(i)->IsS()) selVert=true;
|
||||
|
||||
if(selVert) {
|
||||
(*fi).SetS();
|
||||
++selCnt;
|
||||
}
|
||||
|
@ -363,17 +360,16 @@ static size_t VertexFromBorderFlag(MeshType &m)
|
|||
|
||||
static size_t FaceFromBorderFlag(MeshType &m)
|
||||
{
|
||||
tri::RequireTriangularMesh(m);
|
||||
size_t selCnt=0;
|
||||
int i=0;
|
||||
FaceClear(m);
|
||||
FaceIterator fi;
|
||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( !(*fi).IsD() )
|
||||
{
|
||||
for(int i = 0; i < (*fi).VN(); ++i)
|
||||
if((*fi).IsB(i))
|
||||
break;
|
||||
if(i < (*fi).VN())
|
||||
bool bordFlag=false;
|
||||
for(int i = 0; i < 3; ++i)
|
||||
if((*fi).IsB(i)) bordFlag=true;
|
||||
if(bordFlag)
|
||||
{
|
||||
(*fi).SetS();
|
||||
++selCnt;
|
||||
|
|
Loading…
Reference in New Issue