bool SaveOBJ()

in GraphSampling/meshLoader.h [332:358]


    bool SaveOBJ(const std::string          & fileName,
                 const vector< Vec3<float> > & points,
                 const vector< Vec3<int> > & triangles)
    {
        std::cout << "Saving " <<  fileName << std::endl;
        std::ofstream fout(fileName.c_str());
        if (fout.is_open())
        {
            const size_t nV = points.size();
            const size_t nT = triangles.size();
            for(size_t v = 0; v < nV; v++)
            {
                fout << "v " << points[v][0] << " "
                     << points[v][1] << " "
                     << points[v][2] << std::endl;
            }
            for(size_t f = 0; f < nT; f++)
            {
                fout <<"f " << triangles[f][0]+1 << " "
                     << triangles[f][1]+1 << " "
                     << triangles[f][2]+1 << std::endl;
            }
            fout.close();
            return true;
        }
        return false;
    }