From af83b6883eb0afae7d82aaaefc6a3991429c0a70 Mon Sep 17 00:00:00 2001 From: theo-vt Date: Thu, 14 Aug 2025 13:27:08 -0400 Subject: [PATCH] PartDesign: Hole: fallback to getProfileNormal when a non-cylindrical surface is used --- src/Mod/PartDesign/App/FeatureHole.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureHole.cpp b/src/Mod/PartDesign/App/FeatureHole.cpp index 41365ee29e..7c2e3d5fc3 100644 --- a/src/Mod/PartDesign/App/FeatureHole.cpp +++ b/src/Mod/PartDesign/App/FeatureHole.cpp @@ -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(sf.Cylinder().Axis().Direction()); } - - return Base::convertTo(sf.Cylinder().Axis().Direction()); } return getProfileNormal();