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

Method propagate_supports

tools/Wires/Attributes/WireVertexSupportAttribute.cpp:64–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void WireVertexSupportAttribute::propagate_supports(
65 const WireNetwork& network, MatrixFr& markers) {
66 std::queue<size_t> Q;
67 const size_t num_vertices = network.get_num_vertices();
68 for (size_t i=0; i<num_vertices; i++) {
69 if (markers(i, 0) == SUPPORTED) {
70 Q.push(i);
71 }
72 }
73
74 const MatrixFr& vertices = network.get_vertices();
75 while (!Q.empty()) {
76 size_t curr_idx = Q.front();
77 const VectorF& curr_v = vertices.row(curr_idx);
78 Q.pop();
79
80 VectorI neighbors = network.get_vertex_neighbors(curr_idx);
81 const size_t num_neighbors = neighbors.size();
82 for (size_t i=0; i<num_neighbors; i++) {
83 size_t next_idx = neighbors[i];
84 if (markers(next_idx, 0) == SUPPORTED) continue;
85
86 const VectorF& next_v = vertices.row(next_idx);
87 VectorF dir = next_v - curr_v;
88 Float proj = dir.dot(m_print_dir);
89 if (proj >= -EPS) {
90 markers(next_idx, 0) = SUPPORTED;
91 Q.push(next_idx);
92 }
93 }
94 }
95}

Callers

nothing calls this directly

Calls 7

pushMethod · 0.80
popMethod · 0.80
get_num_verticesMethod · 0.45
get_verticesMethod · 0.45
emptyMethod · 0.45
get_vertex_neighborsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected