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

Function get_triangle_bboxes

tools/CGAL/SelfIntersection.cpp:61–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 }
60
61 std::vector<Box> get_triangle_bboxes(
62 const SelfIntersection::Points& pts, const MatrixIr& faces) {
63 const size_t num_faces = faces.rows();
64 std::vector<Box> boxes;
65 boxes.reserve(num_faces);
66 for (size_t i=0; i<num_faces; i++) {
67 const Vector3I f = faces.row(i);
68 const std::vector<SelfIntersection::Point_3> corners{
69 pts[f[0]], pts[f[1]], pts[f[2]]
70 };
71 if (CGAL::collinear(pts[f[0]], pts[f[1]], pts[f[2]])) {
72 // Triangle is degenerated.
73 continue;
74 }
75 boxes.emplace_back(CGAL::bbox_3(corners.begin(), corners.end()));
76 boxes.back().set_id(i);
77 }
78 return boxes;
79 }
80}
81using namespace SelfIntersectionHelper;
82

Callers 1

Calls 3

set_idMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected