3d 不计算向外的面
我怎么能数不向外的脸呢? 以下代码不起作用。它在vcg库中实现,并基于clean.h的IsCoherentlyOrientedMesh()实现:3d 不计算向外的面,3d,computational-geometry,normals,meshlab,vcg,3d,Computational Geometry,Normals,Meshlab,Vcg,我怎么能数不向外的脸呢? 以下代码不起作用。它在vcg库中实现,并基于clean.h的IsCoherentlyOrientedMesh()实现: int countnotoutwardorientedface(PMesh&pm) { tri::UpdateSelection::FaceClear(pm); 对于(PMesh::FaceIterator f=pm.face.begin();f!=pm.face.end();++f) { 面向布尔=真; 对于(int i=0;iset(); } }
int countnotoutwardorientedface(PMesh&pm)
{
tri::UpdateSelection::FaceClear(pm);
对于(PMesh::FaceIterator f=pm.face.begin();f!=pm.face.end();++f)
{
面向布尔=真;
对于(int i=0;i<3;++i)
{
如果(!面::检查方向(*f,i))
{
定向=假;
打破
}
}
如果(!定向)
{
f->set();
}
}
PMesh::face迭代器f;
f=pm.face.begin();
std::载体sf;
对于(;f!=pm.face.end();++f)
{
如果(f->IsS())
{
sf.推回(&(*f));
}
}
返回sf.size();
}
您的网格防水吗?是的,它是封闭网格。我想数一数向内或向外的面孔。
int countNotOutwardOrientedFaces(PMesh &pm)
{
tri::UpdateSelection<PMesh>::FaceClear(pm);
for (PMesh::FaceIterator f = pm.face.begin(); f != pm.face.end(); ++f)
{
bool oriented = true;
for (int i = 0; i < 3; ++i)
{
if (!face::CheckOrientation(*f, i))
{
oriented = false;
break;
}
}
if (!oriented)
{
f->SetS();
}
}
PMesh::FaceIterator f;
f = pm.face.begin();
std::vector<PFace*> sf;
for (; f != pm.face.end(); ++f)
{
if (f->IsS())
{
sf.push_back(&(*f));
}
}
return sf.size();
}