Small change for managing correctly the ocf type when adding new faces in ply importer (you should never just copy a face over another one...)
This commit is contained in:
parent
52e7aa16f9
commit
18160d8ea8
|
@ -854,12 +854,6 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi )
|
||||||
}
|
}
|
||||||
}else if( !strcmp( pf.ElemName(i),"tristrips") )//////////////////// LETTURA TRISTRIP DI STANFORD
|
}else if( !strcmp( pf.ElemName(i),"tristrips") )//////////////////// LETTURA TRISTRIP DI STANFORD
|
||||||
{
|
{
|
||||||
// Warning the parsing of tristrips could not work if OCF types are used
|
|
||||||
FaceType tf;
|
|
||||||
if( HasPerFaceQuality(m) ) tf.Q()=(typename OpenMeshType::FaceType::QualityType)1.0;
|
|
||||||
if( FaceType::HasWedgeColor() ) tf.WC(0)=tf.WC(1)=tf.WC(2)=Color4b(Color4b::White);
|
|
||||||
if( HasPerFaceColor(m) ) tf.C()=Color4b(Color4b::White);
|
|
||||||
|
|
||||||
int j;
|
int j;
|
||||||
pf.SetCurElement(i);
|
pf.SetCurElement(i);
|
||||||
int numvert_tmp = (int)m.vert.size();
|
int numvert_tmp = (int)m.vert.size();
|
||||||
|
@ -873,7 +867,6 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi )
|
||||||
return pi.status;
|
return pi.status;
|
||||||
}
|
}
|
||||||
int remainder=0;
|
int remainder=0;
|
||||||
//int startface=m.face.size();
|
|
||||||
for(k=0;k<tsa.size-2;++k)
|
for(k=0;k<tsa.size-2;++k)
|
||||||
{
|
{
|
||||||
if(pi.cb && (k%1000)==0) pi.cb(50+k*50/tsa.size,"Tristrip Face Loading");
|
if(pi.cb && (k%1000)==0) pi.cb(50+k*50/tsa.size,"Tristrip Face Loading");
|
||||||
|
@ -888,11 +881,12 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi )
|
||||||
else remainder=1;
|
else remainder=1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Allocator<OpenMeshType>::AddFaces(m,1);
|
||||||
|
FaceType &tf =m.face.back();
|
||||||
tf.V(0) = index[ tsa.v[k+0] ];
|
tf.V(0) = index[ tsa.v[k+0] ];
|
||||||
tf.V(1) = index[ tsa.v[k+1] ];
|
tf.V(1) = index[ tsa.v[k+1] ];
|
||||||
tf.V(2) = index[ tsa.v[k+2] ];
|
tf.V(2) = index[ tsa.v[k+2] ];
|
||||||
if((k+remainder)%2) math::Swap (tf.V(0), tf.V(1) );
|
if((k+remainder)%2) std::swap (tf.V(0), tf.V(1) );
|
||||||
m.face.push_back( tf );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue