Generalized FaceFromVertex to works on polyhedral faces
This commit is contained in:
parent
f9169b8ec2
commit
5a12a2899a
|
@ -164,7 +164,10 @@ static void FaceFromVertex( MeshType &m)
|
||||||
tri::RequirePerVertexQuality(m);
|
tri::RequirePerVertexQuality(m);
|
||||||
for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD())
|
for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD())
|
||||||
{
|
{
|
||||||
(*fi).Q() = ((*fi).V(0)->Q()+(*fi).V(1)->Q()+(*fi).V(2)->Q())/3.0f;
|
(*fi).Q() =0;
|
||||||
|
for (size_t i=0;i<(*fi).VN();i++)
|
||||||
|
(*fi).Q() += (*fi).V(i)->Q();
|
||||||
|
(*fi).Q()/=(ScalarType)(*fi).VN();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue