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

Function trace

tools/MeshUtils/EdgeUtils.cpp:53–66  ·  view source on GitHub ↗

* Trace vertices according to the "next" map. Remove entries in the map * once a link has been traced. */

Source from the content-addressed store, hash-verified

51 * once a link has been traced.
52 */
53 VectorI trace(std::unordered_map<size_t, size_t>& next, size_t start) {
54 std::vector<size_t> chain;
55 chain.push_back(start);
56 while (true) {
57 auto itr = next.find(chain.back());
58 if (itr == next.end()) break;
59 size_t vid = itr->second;
60 next.erase(itr);
61
62 if (vid == start) break;
63 chain.push_back(vid);
64 }
65 return MatrixUtils::std2eigen(chain).cast<int>();
66 }
67
68 void trace_vertex_chains(const IndexHash& valance, IndexHash& next,
69 std::vector<VectorI>& chains) {

Callers 1

trace_vertex_chainsFunction · 0.85

Calls 2

findMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected