mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
Fixes for degenerate polylines
This commit is contained in:
@@ -492,7 +492,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcPolyline* l, TopoDS_Wire& resu
|
|||||||
}
|
}
|
||||||
|
|
||||||
const double eps = getValue(GV_PRECISION) * 10;
|
const double eps = getValue(GV_PRECISION) * 10;
|
||||||
const bool closed_by_proximity = polygon.Length() >= 2 && polygon.First().Distance(polygon.Last()) < eps;
|
const bool closed_by_proximity = polygon.Length() >= 3 && polygon.First().Distance(polygon.Last()) < eps;
|
||||||
if (closed_by_proximity) {
|
if (closed_by_proximity) {
|
||||||
// tfk: note 1-based
|
// tfk: note 1-based
|
||||||
polygon.Remove(polygon.Length());
|
polygon.Remove(polygon.Length());
|
||||||
@@ -500,6 +500,10 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcPolyline* l, TopoDS_Wire& resu
|
|||||||
|
|
||||||
// Remove points that are too close to one another
|
// Remove points that are too close to one another
|
||||||
remove_duplicate_points_from_loop(polygon, closed_by_proximity, eps);
|
remove_duplicate_points_from_loop(polygon, closed_by_proximity, eps);
|
||||||
|
|
||||||
|
if (polygon.Length() < 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
BRepBuilderAPI_MakePolygon w;
|
BRepBuilderAPI_MakePolygon w;
|
||||||
for (int i = 1; i <= polygon.Length(); ++i) {
|
for (int i = 1; i <= polygon.Length(); ++i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user