mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Fixes for closed/non-periodic nurbs curve edges #586
This commit is contained in:
@@ -157,7 +157,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcBSplineCurveWithKnots* l, Hand
|
|||||||
TColStd_Array1OfReal Knots(0, (int)knots.size() - 1);
|
TColStd_Array1OfReal Knots(0, (int)knots.size() - 1);
|
||||||
TColStd_Array1OfInteger Mults(0, (int)mults.size() - 1);
|
TColStd_Array1OfInteger Mults(0, (int)mults.size() - 1);
|
||||||
Standard_Integer Degree = l->Degree();
|
Standard_Integer Degree = l->Degree();
|
||||||
Standard_Boolean Periodic = l->ClosedCurve();
|
Standard_Boolean Periodic = false;
|
||||||
|
// @tfk: it appears to be wrong to expect a period curve when the curve is closed, see #586
|
||||||
|
// Standard_Boolean Periodic = l->ClosedCurve();
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@@ -764,13 +764,19 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcEdgeCurve* l, TopoDS_Wire& res
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
BRep_Builder builder;
|
if (ecrv->IsClosed() && a.Distance(b) < getValue(GV_PRECISION)) {
|
||||||
TopoDS_Vertex v1, v2;
|
// When vertices are close enough and the curve is closed,
|
||||||
/// @todo project first and emit warnings accordingly
|
// use the entire curve.
|
||||||
builder.MakeVertex(v1, a, getValue(GV_PRECISION));
|
mw.Add(BRepBuilderAPI_MakeEdge(ecrv));
|
||||||
builder.MakeVertex(v2, b, getValue(GV_PRECISION));
|
} else {
|
||||||
|
BRep_Builder builder;
|
||||||
|
TopoDS_Vertex v1, v2;
|
||||||
|
/// @todo project first and emit warnings accordingly
|
||||||
|
builder.MakeVertex(v1, a, getValue(GV_PRECISION));
|
||||||
|
builder.MakeVertex(v2, b, getValue(GV_PRECISION));
|
||||||
|
|
||||||
mw.Add(BRepBuilderAPI_MakeEdge(ecrv, v1, v2));
|
mw.Add(BRepBuilderAPI_MakeEdge(ecrv, v1, v2));
|
||||||
|
}
|
||||||
|
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user