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

Method save_mesh

tools/Wires/Inflator/PhantomMeshGenerator.cpp:315–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315void PhantomMeshGenerator::save_mesh(const std::string& filename,
316 const MatrixFr& vertices, const MatrixIr& faces, VectorF debug) {
317 VectorF flattened_vertices(vertices.rows() * vertices.cols());
318 std::copy(vertices.data(), vertices.data() + vertices.rows() *
319 vertices.cols(), flattened_vertices.data());
320 VectorI flattened_faces(faces.rows() * faces.cols());
321 std::copy(faces.data(), faces.data() + faces.rows() * faces.cols(),
322 flattened_faces.data());
323 VectorI voxels = VectorI::Zero(0);
324
325 Mesh::Ptr mesh = MeshFactory().load_data(
326 flattened_vertices, flattened_faces, voxels,
327 vertices.cols(), faces.cols(), 0).create();
328 mesh->add_attribute("debug");
329 mesh->set_attribute("debug", debug);
330
331 MeshWriter::Ptr writer = MeshWriter::create(filename);
332 writer->with_attribute("debug");
333 writer->write_mesh(*mesh);
334}
335

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected