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

Method has_cubic_symmetry

tools/Wires/Misc/SymmetryChecker.cpp:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15bool SymmetryChecker::has_cubic_symmetry() const {
16 const size_t dim = m_wire_network->get_dim();
17 const size_t num_vertices = m_wire_network->get_num_vertices();
18 const VectorF bbox_center = m_wire_network->center();
19 auto cubic_symm_ops = dim == 2 ?
20 SymmetryOperators::generate_cubic_symmetry_operators<2>(bbox_center) :
21 SymmetryOperators::generate_cubic_symmetry_operators<3>(bbox_center);
22
23 const auto& vertices = m_wire_network->get_vertices();
24 for (size_t i=0; i<num_vertices; i++) {
25 const auto& v = vertices.row(i);
26 for (const auto& f : cubic_symm_ops) {
27 const auto& mapped_v = f(v);
28 auto images = m_grid->get_items_near_point(mapped_v);
29 if (images.size() == 0) return false;
30 }
31 }
32 return true;
33}
34
35void SymmetryChecker::update() {
36 const size_t num_vertices = m_wire_network->get_num_vertices();

Callers 2

inflate_periodicMethod · 0.95
TEST_FFunction · 0.80

Calls 6

centerMethod · 0.80
get_items_near_pointMethod · 0.80
get_dimMethod · 0.45
get_num_verticesMethod · 0.45
get_verticesMethod · 0.45
sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64