| 1322 | } |
| 1323 | |
| 1324 | std::pair<double, double> merge_score(const MergedBoxRecord& a, const MergedBoxRecord& b) { |
| 1325 | auto ang = angle_between_dirs_deg(a.direction, b.direction); |
| 1326 | auto center_a = ((a.start - CGAL::ORIGIN) + (a.end - CGAL::ORIGIN)) / 2.; |
| 1327 | auto center_b = ((b.start - CGAL::ORIGIN) + (b.end - CGAL::ORIGIN)) / 2.; |
| 1328 | return {ang, std::sqrt((center_b - center_a).squared_length())}; |
| 1329 | } |
| 1330 | |
| 1331 | bool clusters_can_merge(const BoxCluster& a, const BoxCluster& b, double angle_tol_deg = 5., double axis_overlap_ratio_limit = 0.5) { |
| 1332 | if (!aabb_overlap(a.box.bbox, b.box.bbox)) { |
no test coverage detected