mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 11:23:43 +00:00
arrange polies: try connect to closest point when extension and projection both do not work
This commit is contained in:
@@ -2187,6 +2187,23 @@ extend_end_vertices_based_on_input_simple(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (closest_point) {
|
||||||
|
constructed_segments.push_front({M, *closest_point});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
for (auto& poly : outer_perimiter) {
|
||||||
|
for (auto it = poly.begin(); it != poly.end(); ++it) {
|
||||||
|
auto Pp = *it;
|
||||||
|
auto d = CGAL::squared_distance(Pp, M);
|
||||||
|
if (d < (max_projection_distance * max_projection_distance)) {
|
||||||
|
if (d < closest_distance) {
|
||||||
|
closest_distance = d;
|
||||||
|
closest_point = Pp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (closest_point) {
|
if (closest_point) {
|
||||||
constructed_segments.push_front({M, *closest_point});
|
constructed_segments.push_front({M, *closest_point});
|
||||||
} else {
|
} else {
|
||||||
@@ -2197,6 +2214,7 @@ extend_end_vertices_based_on_input_simple(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return constructed_segments;
|
return constructed_segments;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user