From b92d3967534aa85e5f39afca8ad842ca882951c1 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 12 Aug 2017 20:33:35 -0700 Subject: [PATCH] Enabled drilling of arcs. --- src/Mod/Path/PathScripts/PathSelection.py | 2 +- src/Mod/Path/PathScripts/PathUtils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSelection.py b/src/Mod/Path/PathScripts/PathSelection.py index 9670437dd5..269900f549 100644 --- a/src/Mod/Path/PathScripts/PathSelection.py +++ b/src/Mod/Path/PathScripts/PathSelection.py @@ -63,7 +63,7 @@ class DRILLGate: if hasattr(obj, "Shape") and sub: shape = obj.Shape subobj = shape.getElement(sub) - return PathUtils.isDrillable(shape, subobj) + return PathUtils.isDrillable(shape, subobj, includePartials = True) else: return False diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 3bef0a801c..bb2d2db2ce 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -116,7 +116,7 @@ def curvetowire(obj, steps): return edgelist -def isDrillable(obj, candidate, tooldiameter=None): +def isDrillable(obj, candidate, tooldiameter=None, includePartials=False): """ Checks candidates to see if they can be drilled. Candidates can be either faces - circular or cylindrical or circular edges. @@ -162,7 +162,7 @@ def isDrillable(obj, candidate, tooldiameter=None): drillable = True else: for edge in candidate.Edges: - if isinstance(edge.Curve, Part.Circle) and edge.isClosed(): + if isinstance(edge.Curve, Part.Circle) and (includePartials or edge.isClosed()): PathLog.debug("candidate is a circle or ellipse") if not hasattr(edge.Curve, "Radius"): PathLog.debug("No radius. Ellipse.")