From dec04353f0e59e65b5b548c58572474753714ba4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 13 Oct 2011 15:22:51 +0000 Subject: [PATCH] + enhance check for solid in pad feature git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5009 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Mod/PartDesign/App/FeaturePad.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Mod/PartDesign/App/FeaturePad.cpp b/src/Mod/PartDesign/App/FeaturePad.cpp index c639f9113..52f8965aa 100644 --- a/src/Mod/PartDesign/App/FeaturePad.cpp +++ b/src/Mod/PartDesign/App/FeaturePad.cpp @@ -136,7 +136,16 @@ App::DocumentObjectExecReturn *Pad::execute(void) // if the sketch has a support fuse them to get one result object (PAD!) if (SupportObject) { const TopoDS_Shape& support = SupportObject->Shape.getValue(); - if (!support.IsNull() && support.ShapeType() == TopAbs_SOLID) { + bool isSolid = false; + if (!support.IsNull()) { + TopExp_Explorer xp; + xp.Init(support,TopAbs_SOLID); + for (;xp.More(); xp.Next()) { + isSolid = true; + break; + } + } + if (isSolid) { // Let's call algorithm computing a fuse operation: BRepAlgoAPI_Fuse mkFuse(support, result); // Let's check if the fusion has been successful @@ -158,10 +167,11 @@ App::DocumentObjectExecReturn *Pad::execute(void) return new App::DocumentObjectExecReturn("Resulting shape is not a solid"); this->Shape.setValue(solRes); //this->Shape.setValue(result); - }else + } + else return new App::DocumentObjectExecReturn("Support is not a solid"); - }else - + } + else this->Shape.setValue(result); } else