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

Function save_mesh

tools/Wires/Inflator/PeriodicBoundaryRemesher.cpp:66–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 }
65
66 void save_mesh(const std::string& filename,
67 const MatrixFr& vertices, const MatrixIr& faces, VectorF debug) {
68 VectorF flattened_vertices(vertices.rows() * vertices.cols());
69 std::copy(vertices.data(), vertices.data() + vertices.rows() *
70 vertices.cols(), flattened_vertices.data());
71 VectorI flattened_faces(faces.rows() * faces.cols());
72 std::copy(faces.data(), faces.data() + faces.rows() * faces.cols(),
73 flattened_faces.data());
74 VectorI voxels = VectorI::Zero(0);
75
76 Mesh::Ptr mesh = MeshFactory().load_data(
77 flattened_vertices, flattened_faces, voxels,
78 vertices.cols(), faces.cols(), 0).create();
79 mesh->add_attribute("debug");
80 mesh->set_attribute("debug", debug);
81
82 MeshWriter::Ptr writer = MeshWriter::create(filename);
83 writer->with_attribute("debug");
84 writer->write_mesh(*mesh);
85 }
86
87 void update_indices(MatrixIr& indices, const VectorI& vertex_map) {
88 const size_t num_rows = indices.rows();

Callers 1

run_tetgenMethod · 0.50

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