| 32 | |
| 33 | public: |
| 34 | AABBTree(const MatrixFr& vertices, const MatrixIr& faces) { |
| 35 | assert(faces.cols() == 3); |
| 36 | m_dim = vertices.cols(); |
| 37 | |
| 38 | const size_t num_faces = faces.rows(); |
| 39 | for (size_t i=0; i<num_faces; i++) { |
| 40 | const Vector3I& f = faces.row(i); |
| 41 | m_triangles.emplace_back( |
| 42 | to_cgal_point(vertices.row(f[0])), |
| 43 | to_cgal_point(vertices.row(f[1])), |
| 44 | to_cgal_point(vertices.row(f[2]))); |
| 45 | } |
| 46 | |
| 47 | m_tree = std::make_shared<Tree>(m_triangles.begin(), m_triangles.end()); |
| 48 | m_tree->accelerate_distance_queries(); |
| 49 | } |
| 50 | |
| 51 | public: |
| 52 | /** |
no test coverage detected