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

Function merge_score

src/svgfill/src/arrange_polygons.cpp:1324–1329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1322}
1323
1324std::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
1331bool 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)) {

Calls 1

angle_between_dirs_degFunction · 0.85

Tested by

no test coverage detected