Skip to content

Commit

Permalink
Add turning selection gate
Browse files Browse the repository at this point in the history
  • Loading branch information
dubstar-04 committed Oct 11, 2020
1 parent 12155f4 commit 66afbc3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Mod/Path/PathScripts/PathSelection.py
Expand Up @@ -260,6 +260,15 @@ class PROBEGate:
def allow(self, doc, obj, sub):
pass

class TURNGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
PathLog.debug('obj: {} sub: {}'.format(obj, sub))
if hasattr(obj, "Shape") and sub:
shape = obj.Shape
subobj = shape.getElement(sub)
return PathUtils.isDrillable(shape, subobj, includePartials=True)
else:
return False

class ALLGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
Expand Down Expand Up @@ -340,6 +349,10 @@ def probeselect():
def customselect():
FreeCAD.Console.PrintWarning("Custom Select Mode\n")

def turnselect():
FreeCADGui.Selection.addSelectionGate(TURNGate())
FreeCAD.Console.PrintWarning("Turning Select Mode\n")



def select(op):
Expand All @@ -363,6 +376,8 @@ def select(op):
opsel['Vcarve'] = vcarveselect
opsel['Probe'] = probeselect
opsel['Custom'] = customselect
opsel['TurnFace'] = turnselect
opsel['TurnProfile'] = turnselect
return opsel[op]


Expand Down

0 comments on commit 66afbc3

Please sign in to comment.