diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 4904471845..a3e354d8c9 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) {