0000479: Pad: negative value is not allowed

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5249 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer
2011-12-10 12:12:37 +00:00
parent b9a07509d4
commit 847a9aad5e
2 changed files with 8 additions and 1 deletions

View File

@@ -38,6 +38,7 @@
# include <TopoDS_Wire.hxx>
# include <TopExp_Explorer.hxx>
# include <BRepAlgoAPI_Fuse.hxx>
# include <Precision.hxx>
#endif
#include <Base/Placement.h>
@@ -74,6 +75,9 @@ short Pad::mustExecute() const
App::DocumentObjectExecReturn *Pad::execute(void)
{
double L = Length.getValue();
if (L < Precision::Confusion())
return new App::DocumentObjectExecReturn("Length of pad too small");
App::DocumentObject* link = Sketch.getValue();
if (!link)
return new App::DocumentObjectExecReturn("No sketch linked");
@@ -120,7 +124,7 @@ App::DocumentObjectExecReturn *Pad::execute(void)
return new App::DocumentObjectExecReturn("Creating a face from sketch failed");
// lengthen the vector
SketchOrientationVector *= Length.getValue();
SketchOrientationVector *= L;
try {
// extrude the face to a solid