Skip to content

Commit

Permalink
PD: 0004759: Bad error message when creating pad with 0 length
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Dec 7, 2021
1 parent 1e4c7a2 commit 6167e9f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Mod/PartDesign/App/FeatureSketchBased.cpp
Expand Up @@ -593,17 +593,28 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism,
Loffset = -0.5 * (L2 + L);
else
Loffset = -L2;
} else if (midplane)
}
else if (midplane) {
Loffset = -Ltotal/2;
}

TopoDS_Shape from = sketchshape;
if (method == "TwoLengths" || midplane) {
gp_Trsf mov;
mov.SetTranslation(Loffset * gp_Vec(dir));
TopLoc_Location loc(mov);
from = sketchshape.Moved(loc);
} else if (reversed)
}
else if (reversed) {
Ltotal *= -1.0;
}

if (fabs(Ltotal) < Precision::Confusion()) {
if (addSubType == Type::Additive)
throw Base::ValueError("Cannot create a pad with a height of zero.");
else
throw Base::ValueError("Cannot create a pocket with a depth of zero.");
}

// Its better not to use BRepFeat_MakePrism here even if we have a support because the
// resulting shape creates problems with Pocket
Expand Down

0 comments on commit 6167e9f

Please sign in to comment.