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

Function compute_valance

tools/MeshUtils/EdgeUtils.cpp:25–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 }
24
25 IndexHash compute_valance(const MatrixIr& edges) {
26 IndexHash valance;
27 const size_t num_edges = edges.rows();
28 for (size_t i=0; i<num_edges; i++) {
29 const auto& e = edges.row(i);
30
31 auto e0_itr = valance.find(e[0]);
32 if (e0_itr == valance.end()) {
33 valance[e[0]] = 1;
34 } else {
35 e0_itr->second++;
36 }
37
38 auto e1_itr = valance.find(e[1]);
39 if (e1_itr == valance.end()) {
40 valance[e[1]] = 1;
41 } else {
42 e1_itr->second++;
43 }
44 }
45
46 return valance;
47 }
48
49 /**
50 * Trace vertices according to the "next" map. Remove entries in the map

Callers 1

chain_edgesMethod · 0.85

Calls 2

findMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected