Merge pull request #3700 from etrombly/deletedFaces

[Path] handle makeOffset2D exception in path pocket operation
This commit is contained in:
sliptonic
2020-07-28 11:50:27 -05:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -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)]

View File

@@ -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)]