Enabled drilling of arcs.
This commit is contained in:
committed by
Yorik van Havre
parent
1a8d4b3879
commit
7bd176b8dd
@@ -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
|
||||
|
||||
|
||||
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user