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

Method save_mesh

tests/tools/Wires/WireTest.h:59–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 8

save_meshFunction · 0.50
createMethod · 0.45
load_dataMethod · 0.45
sizeMethod · 0.45
add_attributeMethod · 0.45
set_attributeMethod · 0.45
with_attributeMethod · 0.45
write_meshMethod · 0.45

Tested by

no test coverage detected