Fixes for closed/non-periodic nurbs curve edges #586

This commit is contained in:
Thomas Krijnen
2019-11-05 15:13:34 +01:00
parent ee79401a34
commit a1253b004d
2 changed files with 15 additions and 7 deletions
+3 -1
View File
@@ -157,7 +157,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcBSplineCurveWithKnots* l, Hand
TColStd_Array1OfReal Knots(0, (int)knots.size() - 1);
TColStd_Array1OfInteger Mults(0, (int)mults.size() - 1);
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;
+12 -6
View File
@@ -764,13 +764,19 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcEdgeCurve* l, TopoDS_Wire& res
continue;
}
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));
if (ecrv->IsClosed() && a.Distance(b) < getValue(GV_PRECISION)) {
// When vertices are close enough and the curve is closed,
// use the entire curve.
mw.Add(BRepBuilderAPI_MakeEdge(ecrv));
} 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;
}