Ejemplo n.º 1
0
void PeriodicExploration::save_mesh(const std::string& filename) const {
    auto flattened_vertices = MatrixUtils::flatten<VectorF>(m_vertices);
    auto flattened_faces = MatrixUtils::flatten<VectorI>(m_faces);
    auto flattened_voxels = MatrixUtils::flatten<VectorI>(m_voxels);

    MeshWriter::Ptr writer = MeshWriter::create(filename);
    writer->write(flattened_vertices, flattened_faces, flattened_voxels,
            m_vertices.cols(), m_faces.cols(), m_voxels.cols());
}
Ejemplo n.º 2
0
    void save_mesh(const std::string& filename,
            const MatrixFr& vertices, const MatrixIr& faces) {
        auto flattened_vertices = MatrixUtils::flatten<VectorF>(vertices);
        auto flattened_faces = MatrixUtils::flatten<VectorI>(faces);
        VectorI voxels = VectorI::Zero(0);

        MeshWriter::Ptr writer = MeshWriter::create(filename);
        writer->write(flattened_vertices, flattened_faces, voxels,
                vertices.cols(), faces.cols(), 0);
    }