Part: Add error handling to TopoShape::isLinearEdge

This commit is contained in:
Chris Hennes
2025-07-25 20:55:24 -05:00
committed by Kacper Donat
parent db7c039881
commit a4d0a691b5

View File

@@ -5241,15 +5241,15 @@ bool TopoShape::isLinearEdge(Base::Vector3d* dir, Base::Vector3d* base) const
return false;
}
if (!GeomCurve::isLinear(BRepAdaptor_Curve(TopoDS::Edge(getShape())).Curve().Curve(),
dir,
base)) {
auto tdsEdge = TopoDS::Edge(getShape());
if (tdsEdge.IsNull()) {
return false;
}
// BRep_Tool::Curve() will transform the returned geometry, so no need to
// check the shape's placement.
return true;
auto curve = BRepAdaptor_Curve(tdsEdge).Curve().Curve();
return curve && GeomCurve::isLinear(curve);
}
bool TopoShape::isPlanarFace(double tol) const