| 198 | } |
| 199 | |
| 200 | void InflatorEngine::save_mesh(const std::string& filename, |
| 201 | const MatrixFr& vertices, const MatrixIr& faces, VectorF debug) { |
| 202 | VectorF flattened_vertices(vertices.rows() * vertices.cols()); |
| 203 | std::copy(vertices.data(), vertices.data() + vertices.rows() * |
| 204 | vertices.cols(), flattened_vertices.data()); |
| 205 | VectorI flattened_faces(faces.rows() * faces.cols()); |
| 206 | std::copy(faces.data(), faces.data() + faces.rows() * faces.cols(), |
| 207 | flattened_faces.data()); |
| 208 | VectorI voxels = VectorI::Zero(0); |
| 209 | |
| 210 | Mesh::Ptr mesh = MeshFactory().load_data( |
| 211 | flattened_vertices, flattened_faces, voxels, |
| 212 | vertices.cols(), faces.cols(), 0).create(); |
| 213 | mesh->add_attribute("debug"); |
| 214 | mesh->set_attribute("debug", debug); |
| 215 | |
| 216 | MeshWriter::Ptr writer = MeshWriter::create(filename); |
| 217 | writer->with_attribute("debug"); |
| 218 | writer->write_mesh(*mesh); |
| 219 | } |
| 220 | |
| 221 | void InflatorEngine::save_mesh(const std::string& filename, |
| 222 | const MatrixFr& vertices, const MatrixIr& faces) { |
nothing calls this directly
no test coverage detected