0

我怎么能数不向外的面孔?以下代码不起作用。它在 vcg lib 中实现,它基于 clean.h 的 IsCoherentlyOrientedMesh():

http://opensource-robotics.tokyo.jp/ros.org/docs.ros.org/api/shape_reconstruction/html/clean_8h_source.html

   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();
    }
4

0 回答 0