From b796b3af78b61788c7831083ef5670469cd7b077 Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Mon, 5 Nov 2012 19:03:35 +0430 Subject: [PATCH] Fixed bug in Pad where option TwoLengths was broken if Symmetric had been selected before --- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 490447184..a3e354d8c 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -140,7 +140,7 @@ std::vector SketchBased::getSketchWires() const { return result; } - + // TODO: This code is taken from and duplicates code in Part2DObject::positionBySupport() // Note: We cannot return a reference, because it will become Null. // Not clear where, because we check for IsNull() here, but as soon as it is passed out of @@ -172,14 +172,14 @@ const TopoDS_Face SketchBased::getSupportFace() const { return face; } - + Part::Feature* SketchBased::getSupport() const { // get the support of the Sketch if any App::DocumentObject* SupportLink = static_cast(Sketch.getValue())->Support.getValue(); Part::Feature* SupportObject = NULL; if (SupportLink && SupportLink->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) SupportObject = static_cast(SupportLink); - + return SupportObject; } @@ -197,7 +197,7 @@ const TopoDS_Shape& SketchBased::getSupportShape() const { return result; } - + int SketchBased::getSketchAxisCount(void) const { Part::Part2DObject *sketch = static_cast(Sketch.getValue()); @@ -484,12 +484,13 @@ void SketchBased::generatePrism(TopoDS_Shape& prism, // Note: 1E6 created problems once... Ltotal = 1E4; - if (midplane) - Loffset = -Ltotal/2; - else if (method == "TwoLengths") { + + if (method == "TwoLengths") { + // midplane makes no sense here Loffset = -L2; Ltotal += L2; - } + } else if (midplane) + Loffset = -Ltotal/2; TopoDS_Shape from = sketchshape; if (method == "TwoLengths" || midplane) {