From 6a385f5ee377a50bada29da06d5ca8682ed3dae0 Mon Sep 17 00:00:00 2001 From: AjinkyaDahale Date: Mon, 6 Mar 2017 15:49:34 +0530 Subject: [PATCH] Possible solution to a problem in pad/pocket up-to-face Somehow we weren't able to pad/pocket up-to-face when the profile sketch is made on a datum plane --- src/Gui/DocumentPy.xml | 2 +- src/Mod/PartDesign/App/FeaturePocket.cpp | 1 - src/Mod/PartDesign/App/FeatureSketchBased.cpp | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Gui/DocumentPy.xml b/src/Gui/DocumentPy.xml index 5e5608f915..4f28cbe2f8 100644 --- a/src/Gui/DocumentPy.xml +++ b/src/Gui/DocumentPy.xml @@ -31,7 +31,7 @@ - setEdit([String:Name|ViewProvider|DocumentObjet]|,mod) + setEdit([String:Name|ViewProvider|DocumentObject]|,mod) Set the given object in edit mode. diff --git a/src/Mod/PartDesign/App/FeaturePocket.cpp b/src/Mod/PartDesign/App/FeaturePocket.cpp index 365cf47463..cada4bdf1e 100644 --- a/src/Mod/PartDesign/App/FeaturePocket.cpp +++ b/src/Mod/PartDesign/App/FeaturePocket.cpp @@ -217,4 +217,3 @@ App::DocumentObjectExecReturn *Pocket::execute(void) return new App::DocumentObjectExecReturn(e.what()); } } - diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index ac757ea4f4..98f22f2350 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -272,6 +272,12 @@ const TopoDS_Face ProfileBased::getSupportFace() const { if (part && part->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { const std::vector &sub = Support.getSubValues(); assert(sub.size()==1); + + if (sub.at(0) == "") { + // This seems to happen when sketch is on a datum plane + return TopoDS::Face(Feature::makeShapeFromPlane(sketch)); + } + // get the selected sub shape (a Face) const Part::TopoShape &shape = part->Shape.getShape(); if (shape.getShape().IsNull())