| 57 | } |
| 58 | |
| 59 | void save_mesh(const std::string& file_name, |
| 60 | MatrixFr& vertices, MatrixIr& faces, |
| 61 | VectorF debug=VectorF::Zero(0)) { |
| 62 | VectorF flat_vertices = flatten(vertices); |
| 63 | VectorI flat_faces = flatten(faces); |
| 64 | VectorI flat_voxels = VectorI::Zero(0); |
| 65 | |
| 66 | MeshFactory factory; |
| 67 | Mesh::Ptr mesh = factory.load_data(flat_vertices, flat_faces, flat_voxels, |
| 68 | vertices.cols(), faces.cols(), 4).create(); |
| 69 | |
| 70 | MeshWriter::Ptr writer = MeshWriter::create(file_name); |
| 71 | |
| 72 | if (debug.size() > 0) { |
| 73 | mesh->add_attribute("debug"); |
| 74 | mesh->set_attribute("debug", debug); |
| 75 | writer->with_attribute("debug"); |
| 76 | } |
| 77 | |
| 78 | writer->write_mesh(*mesh); |
| 79 | } |
| 80 | |
| 81 | void save_mesh(const std::string& filename, |
| 82 | Mesh::Ptr mesh, |
nothing calls this directly
no test coverage detected