PartDesign: Hole: fallback to getProfileNormal when a non-cylindrical surface is used

This commit is contained in:
theo-vt
2025-08-14 13:27:08 -04:00
committed by Chris Hennes
parent a0705f1d85
commit af83b6883e

View File

@@ -2266,12 +2266,10 @@ Base::Vector3d Hole::guessNormalDirection(const TopoShape& profileshape) const
// the middle of the face
if (profileshape.hasSubShape(TopAbs_FACE)) {
BRepAdaptor_Surface sf(TopoDS::Face(profileshape.getSubShape(TopAbs_FACE, 1)));
if (sf.GetType() != GeomAbs_Cylinder) {
throw Base::Exception("Cannot create hole from non cylindrical face");
if (sf.GetType() == GeomAbs_Cylinder) {
return Base::convertTo<Base::Vector3d>(sf.Cylinder().Axis().Direction());
}
return Base::convertTo<Base::Vector3d>(sf.Cylinder().Axis().Direction());
}
return getProfileNormal();