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

Method write_mesh

src/IO/PLYWriter.cpp:47–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void PLYWriter::write_mesh(Mesh& mesh) {
48 p_ply ply = ply_create(m_filename.c_str(),
49 m_in_ascii ? PLY_ASCII : PLY_LITTLE_ENDIAN,
50 NULL, 0, NULL);
51 assert_success(ply != NULL, "ply_create_failed");
52
53 regroup_attribute_names(mesh);
54
55 add_vertex_elements_header(mesh, ply);
56 add_face_elements_header(mesh, ply);
57 add_voxel_elements_header(mesh, ply);
58
59 if (!is_anonymous()) {
60 assert_success(ply_add_comment(ply, "Generated by PyMesh"),
61 "Adding comment failed");
62 }
63 assert_success(ply_write_header(ply), "Writting header failed");
64
65 write_vertex_elements(mesh, ply);
66 write_face_elements(mesh, ply);
67 write_voxel_elements(mesh, ply);
68
69 ply_close(ply);
70}
71
72void PLYWriter::write(
73 const VectorF& vertices,

Callers 1

save_meshFunction · 0.45

Calls 5

ply_createFunction · 0.85
ply_add_commentFunction · 0.85
ply_write_headerFunction · 0.85
ply_closeFunction · 0.85
assert_successFunction · 0.70

Tested by

no test coverage detected