mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 16:43:00 +00:00
Fix #163 Disallow narrow IfcPolygonalBoundedHalfSpace
This commit is contained in:
@@ -433,8 +433,15 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcPolygonalBoundedHalfSpace* l,
|
||||
|
||||
TColgp_SequenceOfPnt points;
|
||||
if (wire_to_sequence_of_point(wire, points)) {
|
||||
remove_duplicate_points_from_loop(points, wire.Closed() != 0); // Note: wire always closed, as per if statement above
|
||||
remove_collinear_points_from_loop(points, wire.Closed() != 0);
|
||||
// Boolean subtractions not very robust for narrow operands,
|
||||
// increase minimal point spacing to eliminate such shapes.
|
||||
const double t = getValue(GV_PRECISION) * 10.;
|
||||
remove_duplicate_points_from_loop(points, wire.Closed() != 0, t); // Note: wire always closed, as per if statement above
|
||||
remove_collinear_points_from_loop(points, wire.Closed() != 0, t);
|
||||
if (points.Size() < 3) {
|
||||
Logger::Message(Logger::LOG_ERROR, "Not enough points retained from:", l->PolygonalBoundary()->entity);
|
||||
return false;
|
||||
}
|
||||
sequence_of_point_to_wire(points, wire, wire.Closed() != 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user