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

Method separate

tools/MeshUtils/MeshSeparator.cpp:18–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 : m_elements(elements), m_connectivity_type(VERTEX) { }
17
18size_t MeshSeparator::separate() {
19 compute_connectivity();
20
21 m_components.clear();
22 m_sources.clear();
23 const size_t num_elements = m_elements.rows();
24 m_visited = std::vector<bool>(num_elements, false);
25
26 for (size_t i=0; i<num_elements; i++) {
27 if (m_visited[i]) continue;
28 VectorI sources;
29 m_components.push_back(flood(i, sources));
30 m_sources.push_back(sources);
31 }
32
33 return m_components.size();
34}
35
36void MeshSeparator::compute_connectivity() {
37 switch(m_connectivity_type) {

Callers 6

separate_meshFunction · 0.95
separate_graphFunction · 0.95
TEST_FFunction · 0.80

Calls 2

clearMethod · 0.45
sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64