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

Function copy_vertices

tools/Compression/Draco/DracoCompressionEngine.cpp:24–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23template <typename DracoMesh>
24void copy_vertices(Mesh::Ptr mesh, std::unique_ptr<DracoMesh>& draco_mesh) {
25 const auto dim = mesh->get_dim();
26 const auto num_vertices = mesh->get_num_vertices();
27 draco_mesh->set_num_points(num_vertices);
28 draco::GeometryAttribute positions;
29 positions.Init(draco::GeometryAttribute::POSITION, // Attribute type
30 nullptr, // data buffer
31 dim, // number of components
32 draco::DT_FLOAT64, // data type
33 false, // normalized
34 sizeof(Float) * dim, // byte stride
35 0); // byte offset
36 auto pos_att_id = draco_mesh->AddAttribute(
37 positions, // attribute object
38 true, // identity mapping
39 num_vertices); // num attribute values
40
41 for (int i = 0; i < num_vertices; ++i) {
42 draco_mesh->attribute(pos_att_id)->SetAttributeValue(
43 draco::AttributeValueIndex(i), mesh->get_vertex(i).data());
44 }
45}
46
47template <typename DracoMesh>
48void copy_faces(Mesh::Ptr mesh, std::unique_ptr<DracoMesh>& draco_mesh) {

Callers 2

to_draco_meshFunction · 0.85
to_draco_point_cloudFunction · 0.85

Calls 4

get_dimMethod · 0.45
get_num_verticesMethod · 0.45
InitMethod · 0.45
get_vertexMethod · 0.45

Tested by

no test coverage detected