From 3bd2a9a6632af938ad993c63404942c1b3d5bad0 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 2 Sep 2017 15:53:33 -0700 Subject: [PATCH] use min values to ceate valid stocks for panels. --- src/Mod/Path/PathScripts/PathStock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathStock.py b/src/Mod/Path/PathScripts/PathStock.py index 3ea5f827c7..e5e5ff96cf 100644 --- a/src/Mod/Path/PathScripts/PathStock.py +++ b/src/Mod/Path/PathScripts/PathStock.py @@ -96,9 +96,9 @@ def CreateBox(job, extent=None, at=None): obj.Height = extent.z elif job.Base: bb = job.Base.Shape.BoundBox - obj.Length = bb.XLength - obj.Width = bb.YLength - obj.Height = bb.ZLength + obj.Length = max(bb.XLength, 1) + obj.Width = max(bb.YLength, 1) + obj.Height = max(bb.ZLength, 1) if at: obj.Placement = FreeCAD.Placement(at, FreeCAD.Vector(), 0) else: @@ -117,7 +117,7 @@ def CreateCylinder(job, radius=None, height=None, at=None): elif job.Base: bb = job.Base.Shape.BoundBox obj.Radius = max(bb.XLength, bb.YLength) * 0.7072 # 1/sqrt(2) - obj.Height = bb.ZLength + obj.Height = max(bb.ZLength, 1) if at: obj.Placement = FreeCAD.Placement(at, FreeCAD.Vector(), 0) else: