MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / aabb_from_points

Function aabb_from_points

src/svgfill/src/arrange_polygons.cpp:1026–1033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024}
1025
1026DBox aabb_from_points(const std::array<DPoint, 4>& corners) {
1027 DBox bbox{corners[0], corners[0]};
1028 for (auto& p : corners) {
1029 bbox[0] = {std::min(bbox[0].x(), p.x()), std::min(bbox[0].y(), p.y())};
1030 bbox[1] = {std::max(bbox[1].x(), p.x()), std::max(bbox[1].y(), p.y())};
1031 }
1032 return bbox;
1033}
1034
1035bool aabb_overlap(const DBox& a, const DBox& b, double eps = 1.e-9) {
1036 return a[0].x() <= b[1].x() + eps &&

Callers 2

build_run_box_recordsFunction · 0.85
merge_cluster_to_boxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected