From bd1670fd7634e715b1a4622b538bc744d034280b Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 17 Jun 2019 16:14:13 +0200 Subject: [PATCH] make UpToLast option for pad working again --- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 5b7900e085..dafe909863 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -23,6 +23,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ +# include # include # include # include @@ -537,10 +538,14 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism, // resulting shape creates problems with Pocket BRepPrimAPI_MakePrism PrismMaker(from, Ltotal*gp_Vec(dir), 0,1); // finite prism if (!PrismMaker.IsDone()) - throw Base::RuntimeError("SketchBased: Length: Could not extrude the sketch!"); + throw Base::RuntimeError("ProfileBased: Length: Could not extrude the sketch!"); prism = PrismMaker.Shape(); - } else { - throw Base::RuntimeError("SketchBased: Internal error: Unknown method for generatePrism()"); + } + else { + std::stringstream str; + str << "ProfileBased: Internal error: Unknown method '" + << method << "' for generatePrism()"; + throw Base::RuntimeError(str.str()); } } @@ -549,16 +554,15 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism, const std::string& method, const TopoDS_Shape& baseshape, const TopoDS_Shape& profileshape, - const TopoDS_Face& sketchface, + const TopoDS_Face& supportface, const TopoDS_Face& uptoface, const gp_Dir& direction, Standard_Integer Mode, Standard_Boolean Modify) { - if (method == "UpToFirst" || method == "UpToFace") { + if (method == "UpToFirst" || method == "UpToFace" || method == "UpToLast") { BRepFeat_MakePrism PrismMaker; TopoDS_Shape base = baseshape; - TopoDS_Face supportface = sketchface; for (TopExp_Explorer xp(profileshape, TopAbs_FACE); xp.More(); xp.Next()) { PrismMaker.Init(base, xp.Current(), supportface, direction, Mode, Modify); PrismMaker.Perform(uptoface); @@ -572,6 +576,12 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism, prism = base; } + else { + std::stringstream str; + str << "ProfileBased: Internal error: Unknown method '" + << method << "' for generatePrism()"; + throw Base::RuntimeError(str.str()); + } } bool ProfileBased::checkWireInsideFace(const TopoDS_Wire& wire, const TopoDS_Face& face,