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

Method get_genus

tools/MeshUtils/MeshChecker.cpp:137–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137int MeshChecker::get_genus() const {
138 // Need num boundary loops
139 int double_genus = 2 - int(get_euler_characteristic()) -
140 int(get_num_boundary_loops());
141 if (double_genus % 2 != 0) {
142 std::cerr << "Genus computation is incorrect due to nonmanifold surface"
143 <<std::endl;
144 }
145 return double_genus / 2;
146}
147
148int MeshChecker::get_euler_characteristic() const {
149 int num_vertices = m_vertices.rows();

Callers 2

genusMethod · 0.80
TEST_FFunction · 0.80

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.64