MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / save_mesh

Method save_mesh

tools/Wires/Inflator/InflatorEngine.cpp:200–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void 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
221void InflatorEngine::save_mesh(const std::string& filename,
222 const MatrixFr& vertices, const MatrixIr& faces) {

Callers

nothing calls this directly

Calls 8

MeshFactoryClass · 0.50
createMethod · 0.45
load_dataMethod · 0.45
add_attributeMethod · 0.45
set_attributeMethod · 0.45
with_attributeMethod · 0.45
write_meshMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected