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

Method build

tools/BVH/CGAL/AABBTree.cpp:8–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace PyMesh;
7
8void PyMesh::_CGAL::AABBTree::build() {
9 m_triangles.clear();
10 assert(m_faces.cols() == 3);
11
12 const size_t num_faces = m_faces.rows();
13 for (size_t i=0; i<num_faces; i++) {
14 const auto& f = m_faces.row(i);
15 const auto& v0 = m_vertices.row(f[0]);
16 const auto& v1 = m_vertices.row(f[1]);
17 const auto& v2 = m_vertices.row(f[2]);
18 m_triangles.emplace_back(
19 Point(v0[0], v0[1], v0[2]),
20 Point(v1[0], v1[1], v1[2]),
21 Point(v2[0], v2[1], v2[2]));
22 }
23
24 m_tree = std::make_shared<Tree>(m_triangles.begin(), m_triangles.end());
25 m_tree->accelerate_distance_queries();
26}
27
28void PyMesh::_CGAL::AABBTree::lookup(const MatrixFr& points,
29 VectorF& squared_distances,

Callers 8

initialize_AABB_treeMethod · 0.45
load_dataMethod · 0.45
load_meshMethod · 0.45
TEST_FFunction · 0.45
init_bvhMethod · 0.45
simple_triangle_testMethod · 0.45
hinge_testMethod · 0.45

Calls 3

clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 5

TEST_FFunction · 0.36
init_bvhMethod · 0.36
simple_triangle_testMethod · 0.36
hinge_testMethod · 0.36