From 5fe22270cc9386ecf987207e0bb0293d23681c7a Mon Sep 17 00:00:00 2001 From: Eric Trombly Date: Tue, 14 Jul 2020 08:10:04 -0500 Subject: [PATCH 1/2] handle makeOffset2D exception --- src/Mod/Path/PathScripts/PathPocketShape.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathPocketShape.py b/src/Mod/Path/PathScripts/PathPocketShape.py index 6cc24e5ba4..e0141396be 100644 --- a/src/Mod/Path/PathScripts/PathPocketShape.py +++ b/src/Mod/Path/PathScripts/PathPocketShape.py @@ -102,7 +102,10 @@ def extendWire(feature, wire, length): '''extendWire(wire, length) ... return a closed Wire which extends wire by length''' PathLog.track(length) if length and length != 0: - off2D = wire.makeOffset2D(length) + try: + off2D = wire.makeOffset2D(length) + except FreeCAD.Base.FreeCADError: + return None endPts = endPoints(wire) if endPts: edges = [e for e in off2D.Edges if Part.Circle != type(e.Curve) or not includesPoint(e.Curve.Center, endPts)] From e630e3786f6df591167b71c566034c751eb15254 Mon Sep 17 00:00:00 2001 From: Eric Trombly Date: Wed, 15 Jul 2020 21:31:32 -0500 Subject: [PATCH 2/2] handle offset error in PathPocketShapeGui --- src/Mod/Path/PathScripts/PathPocketShapeGui.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathPocketShapeGui.py b/src/Mod/Path/PathScripts/PathPocketShapeGui.py index 739808cad5..642eb6fb52 100644 --- a/src/Mod/Path/PathScripts/PathPocketShapeGui.py +++ b/src/Mod/Path/PathScripts/PathPocketShapeGui.py @@ -76,7 +76,10 @@ class _Extension(object): hnt = coin.SoShapeHints() if not ext is None: - wire = ext.getWire() + try: + wire = ext.getWire() + except FreeCAD.Base.FreeCADError: + wire = None if wire: if isinstance(wire, (list, tuple)): p0 = [p for p in wire[0].discretize(Deflection=0.02)]