Moved the rest of the operations into Path.Op (.Gui) module

This commit is contained in:
Markus Lampert
2022-08-14 11:14:51 -07:00
parent 3f068108a8
commit d6293308b4
22 changed files with 94 additions and 94 deletions

View File

@@ -33,6 +33,7 @@ SET(PathPython_SRCS
SET(PathPythonBase_SRCS
Path/Base/__init__.py
Path/Base//Drillable.py
Path/Base/MachineState.py
Path/Base/FeedRate.py
Path/Base/Property.py
@@ -144,6 +145,7 @@ SET(PathPythonOp_SRCS
Path/Op/Deburr.py
Path/Op/Engrave.py
Path/Op/EngraveBase.py
Path/Op/FeatureExtensions.py
Path/Op/Drilling.py
Path/Op/Helix.py
Path/Op/MillFace.py
@@ -164,20 +166,28 @@ SET(PathPythonOp_SRCS
SET(PathPythonOpGui_SRCS
Path/Op/Gui/__init__.py
Path/Op/Gui/Adaptive.py
Path/Op/Gui/Array.py
Path/Op/Gui/Base.py
Path/Op/Gui/CircularHoleBase.py
Path/Op/Gui/Comment.py
Path/Op/Gui/Copy.py
Path/Op/Gui/Custom.py
Path/Op/Gui/Deburr.py
Path/Op/Gui/Drilling.py
Path/Op/Gui/Engrave.py
Path/Op/Gui/FeatureExtensions.py
Path/Op/Gui/Helix.py
Path/Op/Gui/Hop.py
Path/Op/Gui/MillFace.py
Path/Op/Gui/PocketBase.py
Path/Op/Gui/Pocket.py
Path/Op/Gui/PocketBase.py
Path/Op/Gui/PocketShape.py
Path/Op/Gui/Probe.py
Path/Op/Gui/Profile.py
Path/Op/Gui/Selection.py
Path/Op/Gui/SimpleCopy.py
Path/Op/Gui/Slot.py
Path/Op/Gui/Stop.py
Path/Op/Gui/Surface.py
Path/Op/Gui/ThreadMilling.py
Path/Op/Gui/Vcarve.py
@@ -185,15 +195,8 @@ SET(PathPythonOpGui_SRCS
)
SET(PathScripts_SRCS
PathScripts/drillableLib.py
PathScripts/PathArray.py
PathScripts/PathCamoticsGui.py
PathScripts/PathComment.py
PathScripts/PathCopy.py
PathScripts/PathFeatureExtensions.py
PathScripts/PathFeatureExtensionsGui.py
PathScripts/PathFixture.py
PathScripts/PathHop.py
PathScripts/PathInspect.py
PathScripts/PathJob.py
PathScripts/PathJobCmd.py
@@ -201,11 +204,8 @@ SET(PathScripts_SRCS
PathScripts/PathJobGui.py
PathScripts/PathPreferencesPathJob.py
PathScripts/PathSanity.py
PathScripts/PathSelection.py
PathScripts/PathSimpleCopy.py
PathScripts/PathSimulatorGui.py
PathScripts/PathStock.py
PathScripts/PathStop.py
PathScripts/PathUtils.py
PathScripts/PathUtilsGui.py
PathScripts/__init__.py

View File

@@ -1272,12 +1272,12 @@ class TaskPanel(object):
class SelObserver(object):
def __init__(self):
import PathScripts.PathSelection as PST
import Path.Op.Gui.Selection as PST
PST.eselect()
def __del__(self):
import PathScripts.PathSelection as PST
import Path.Op.Gui.Selection as PST
PST.clear()

View File

@@ -49,31 +49,32 @@ def Startup():
from Path.Dressup.Gui import Tags
from Path.Dressup.Gui import ZCorrect
from Path.Op.Gui import Adaptive
from Path.Op.Gui import Array
from Path.Op.Gui import Comment
from Path.Op.Gui import Custom
from Path.Op.Gui import Deburr
from Path.Op.Gui import Drilling
from Path.Op.Gui import Engrave
from Path.Op.Gui import Helix
from Path.Op.Gui import Hop
from Path.Op.Gui import MillFace
from Path.Op.Gui import Pocket
from Path.Op.Gui import PocketShape
from Path.Op.Gui import Probe
from Path.Op.Gui import Profile
from Path.Op.Gui import SimpleCopy
from Path.Op.Gui import Slot
from Path.Op.Gui import Stop
from Path.Op.Gui import ThreadMilling
from Path.Op.Gui import Vcarve
from Path.Post import Command
from Path.Tool import Controller
from Path.Tool.Gui import Controller
from PathScripts import PathArray
from PathScripts import PathComment
from PathScripts import PathFixture
from PathScripts import PathHop
from PathScripts import PathInspect
from PathScripts import PathSanity
from PathScripts import PathSimpleCopy
from PathScripts import PathSimulatorGui
from PathScripts import PathStop
from PathScripts import PathUtilsGui
from packaging.version import Version, parse

View File

@@ -44,7 +44,7 @@ from lazy_loader.lazy_loader import LazyLoader
Part = LazyLoader("Part", globals(), "Part")
# TechDraw = LazyLoader('TechDraw', globals(), 'TechDraw')
FeatureExtensions = LazyLoader(
"PathScripts.PathFeatureExtensions", globals(), "PathScripts.PathFeatureExtensions"
"Path.Op.FeatureExtension", globals(), "Path.Op.FeatureExtension"
)
DraftGeomUtils = LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils")

View File

@@ -24,7 +24,7 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import Path
import Path.Op.Base as PathOp
import PathScripts.drillableLib as drillableLib
import Path.Base.Drillable as Drillable
# lazily loaded modules
from lazy_loader.lazy_loader import LazyLoader
@@ -213,7 +213,7 @@ class ObjectOp(PathOp.ObjectOp):
features = []
for base in self.model:
features.extend(
drillableLib.getDrillableTargets(
Drillable.getDrillableTargets(
base, ToolDiameter=tooldiameter, vector=matchvector
)
)

View File

@@ -21,11 +21,11 @@
# * *
# ***************************************************************************
import FreeCADGui
import Path.Op.Adaptive as PathAdaptive
import Path.Op.Gui.Base as PathOpGui
import Path.Op.Gui.FeatureExtension as PathFeatureExtensionsGui
from PySide import QtCore
import PathScripts.PathFeatureExtensionsGui as PathFeatureExtensionsGui
import FreeCADGui
class TaskPanelOpPage(PathOpGui.TaskPanelPage):

View File

@@ -539,14 +539,14 @@ class CommandPathArray:
# if everything is ok, execute and register the transaction in the
# undo/redo stack
FreeCAD.ActiveDocument.openTransaction("Create Array")
FreeCADGui.addModule("PathScripts.PathArray")
FreeCADGui.addModule("Path.Op.Gui.Array")
FreeCADGui.addModule("PathScripts.PathUtils")
FreeCADGui.doCommand(
'obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","Array")'
)
FreeCADGui.doCommand("PathScripts.PathArray.ObjectArray(obj)")
FreeCADGui.doCommand("Path.Op.Gui.Array.ObjectArray(obj)")
baseString = "[%s]" % ",".join(
["FreeCAD.ActiveDocument.%s" % sel.Name for sel in selection]

View File

@@ -28,9 +28,9 @@ import Path.Base.Gui.Util as PathGuiUtil
import Path.Base.SetupSheet as PathSetupSheet
import Path.Base.Util as PathUtil
import Path.Op.Base as PathOp
import Path.Op.Gui.Selection as PathSelection
import PathGui
import PathScripts.PathJob as PathJob
import PathScripts.PathSelection as PathSelection
import PathScripts.PathUtils as PathUtils
import importlib
from PySide.QtCore import QT_TRANSLATE_NOOP

View File

@@ -115,14 +115,14 @@ class CommandPathComment:
def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Create a Comment in your CNC program")
FreeCADGui.addModule("PathScripts.PathComment")
FreeCADGui.addModule("Path.Op.Gui.Comment")
snippet = """
import Path
import PathScripts
from PathScripts import PathUtils
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","Comment")
PathScripts.PathComment.Comment(obj)
PathScripts.PathComment._ViewProviderComment(obj.ViewObject)
Path.Op.Gui.Comment.Comment(obj)
Path.Op.Gui.Comment._ViewProviderComment(obj.ViewObject)
PathUtils.addToJob(obj)
"""

View File

@@ -104,12 +104,11 @@ class CommandPathCopy:
def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Create Copy")
FreeCADGui.addModule("PathScripts.PathCopy")
FreeCADGui.addModule("Path.Op.Gui.Copy")
consolecode = """
import Path
import PathScripts
from PathScripts import PathCopy
import Path.Op.Gui.Copy
selGood = True
# check that the selection contains exactly what we want
selection = FreeCADGui.Selection.getSelection()
@@ -125,8 +124,8 @@ if not selection[0].isDerivedFrom("Path::Feature"):
if selGood:
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", str(selection[0].Name)+'_Copy')
PathScripts.PathCopy.ObjectPathCopy(obj)
PathScripts.PathCopy.ViewProviderPathCopy(obj.ViewObject)
Path.Op.Gui.Copy.ObjectPathCopy(obj)
Path.Op.Gui.Copy.ViewProviderPathCopy(obj.ViewObject)
obj.Base = FreeCAD.ActiveDocument.getObject(selection[0].Name)
if hasattr(obj.Base, 'ToolController'):
obj.ToolController = obj.Base.ToolController

View File

@@ -26,8 +26,8 @@ import FreeCAD
import FreeCADGui
import Path
import Path.Base.Gui.Util as PathGuiUtil
import Path.Op.FeatureExtension as FeatureExtensions
import Path.Op.Gui.Base as PathOpGui
import PathScripts.PathFeatureExtensions as FeatureExtensions
# lazily loaded modules
from lazy_loader.lazy_loader import LazyLoader

View File

@@ -125,13 +125,13 @@ class CommandPathHop:
return
FreeCAD.ActiveDocument.openTransaction("Create Hop")
FreeCADGui.addModule("PathScripts.PathHop")
FreeCADGui.addModule("Path.Op.Gui.Hop")
FreeCADGui.addModule("PathScripts.PathUtils")
FreeCADGui.doCommand(
'obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","Hop")'
)
FreeCADGui.doCommand("PathScripts.PathHop.ObjectHop(obj)")
FreeCADGui.doCommand("PathScripts.PathHop.ViewProviderPathHop(obj.ViewObject)")
FreeCADGui.doCommand("Path.Op.Gui.Hop.ObjectHop(obj)")
FreeCADGui.doCommand("Path.Op.Gui.Hop.ViewProviderPathHop(obj.ViewObject)")
FreeCADGui.doCommand(
"obj.NextObject = FreeCAD.ActiveDocument." + selection[0].Name
)

View File

@@ -23,9 +23,9 @@
import FreeCAD
import Path
import Path.Op.Gui.Base as PathOpGui
import Path.Op.Gui.FeatureExtension as PathFeatureExtensionsGui
import Path.Op.Gui.PocketBase as PathPocketBaseGui
import Path.Op.PocketShape as PathPocketShape
import PathScripts.PathFeatureExtensionsGui as PathFeatureExtensionsGui
from PySide.QtCore import QT_TRANSLATE_NOOP
# lazily loaded modules

View File

@@ -26,7 +26,7 @@
import FreeCAD
import FreeCADGui
import Path
import PathScripts.drillableLib as drillableLib
import Path.Base.Drillable as Drillable
import math
Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule())
@@ -129,7 +129,7 @@ class DRILLGate(PathBaseGate):
subobj = shape.getElement(sub)
if subobj.ShapeType not in ["Edge", "Face"]:
return False
return drillableLib.isDrillable(shape, subobj, vector=None)
return Drillable.isDrillable(shape, subobj, vector=None)
class FACEGate(PathBaseGate):
@@ -236,7 +236,7 @@ class TURNGate(PathBaseGate):
if hasattr(obj, "Shape") and sub:
shape = obj.Shape
subobj = shape.getElement(sub)
return drillableLib.isDrillable(shape, subobj, vector=None)
return Drillable.isDrillable(shape, subobj, vector=None)
else:
return False

View File

@@ -35,7 +35,7 @@ TechDraw = LazyLoader("TechDraw", globals(), "TechDraw")
math = LazyLoader("math", globals(), "math")
PathUtils = LazyLoader("PathScripts.PathUtils", globals(), "PathScripts.PathUtils")
FeatureExtensions = LazyLoader(
"PathScripts.PathFeatureExtensions", globals(), "PathScripts.PathFeatureExtensions"
"Path.Op.FeatureExtension", globals(), "Path.Op.FeatureExtension"
)

View File

@@ -24,10 +24,10 @@
import FreeCAD
import Path
import Path.Base.Drillable as Drillable
import Path.Op.Area as PathAreaOp
import Path.Op.Base as PathOp
import PathScripts.PathUtils as PathUtils
import PathScripts.drillableLib as drillableLib
import math
import numpy
from PySide.QtCore import QT_TRANSLATE_NOOP
@@ -450,7 +450,7 @@ class ObjectProfile(PathAreaOp.ObjectOp):
for baseShape, wire in holes:
cont = False
f = Part.makeFace(wire, "Part::FaceMakerSimple")
drillable = drillableLib.isDrillable(baseShape, f, vector=None)
drillable = Drillable.isDrillable(baseShape, f, vector=None)
Path.Log.debug(drillable)
if obj.processCircles:

View File

@@ -164,7 +164,7 @@ class _ToggleOperation:
selProxy = Path.Dressup.Utils.baseOp(sel.Object).Proxy
if not isinstance(
selProxy, Path.Op.Base.ObjectOp
) and not isinstance(selProxy, PathScripts.PathArray.ObjectArray):
) and not isinstance(selProxy, Path.Op.Gui.Array.ObjectArray):
return False
return True
except (IndexError, AttributeError):

View File

@@ -22,8 +22,8 @@
import FreeCAD as App
import Path
import Path.Base.Drillable as Drillable
import PathTests.PathTestUtils as PathTestUtils
import PathScripts.drillableLib as drillableLib
if False:
@@ -47,17 +47,17 @@ class TestPathDrillable(PathTestUtils.PathTestBase):
# Vec and origin
v1 = App.Vector(0, 0, 10)
v2 = App.Vector(0, 0, 0)
self.assertTrue(drillableLib.compareVecs(v1, v2))
self.assertTrue(Drillable.compareVecs(v1, v2))
# two valid vectors
v1 = App.Vector(0, 10, 0)
v2 = App.Vector(0, 20, 0)
self.assertTrue(drillableLib.compareVecs(v1, v2))
self.assertTrue(Drillable.compareVecs(v1, v2))
# two valid vectors not aligned
v1 = App.Vector(0, 10, 0)
v2 = App.Vector(10, 0, 0)
self.assertFalse(drillableLib.compareVecs(v1, v2))
self.assertFalse(Drillable.compareVecs(v1, v2))
def test10(self):
"""Test isDrillable"""
@@ -65,7 +65,7 @@ class TestPathDrillable(PathTestUtils.PathTestBase):
# Invalid types
candidate = self.obj.getSubObject("Vertex1")
self.assertRaises(
TypeError, lambda: drillableLib.isDrillable(self.obj.Shape, candidate)
TypeError, lambda: Drillable.isDrillable(self.obj.Shape, candidate)
)
# Test cylinder faces
@@ -74,46 +74,46 @@ class TestPathDrillable(PathTestUtils.PathTestBase):
candidate = self.obj.getSubObject("Face30")
# Typical drilling
self.assertTrue(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertTrue(Drillable.isDrillable(self.obj.Shape, candidate))
# Drilling with smaller bit
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, tooldiameter=20)
Drillable.isDrillable(self.obj.Shape, candidate, tooldiameter=20)
)
# Drilling with bit too large
self.assertFalse(
drillableLib.isDrillable(self.obj.Shape, candidate, tooldiameter=30)
Drillable.isDrillable(self.obj.Shape, candidate, tooldiameter=30)
)
# off-axis hole
candidate = self.obj.getSubObject("Face44")
# Typical drilling
self.assertFalse(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertFalse(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# Passing explicit vector
self.assertTrue(
drillableLib.isDrillable(
Drillable.isDrillable(
self.obj.Shape, candidate, vector=App.Vector(0, -1, 0)
)
)
# Drilling with smaller bit
self.assertTrue(
drillableLib.isDrillable(
Drillable.isDrillable(
self.obj.Shape, candidate, tooldiameter=10, vector=App.Vector(0, -1, 0)
)
)
# Drilling with bit too large
self.assertFalse(
drillableLib.isDrillable(
Drillable.isDrillable(
self.obj.Shape, candidate, tooldiameter=30, vector=App.Vector(0, -1, 0)
)
)
@@ -122,76 +122,76 @@ class TestPathDrillable(PathTestUtils.PathTestBase):
candidate = self.obj.getSubObject("Face29")
# Typical drilling
self.assertFalse(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertFalse(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertFalse(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# raised cylinder
candidate = self.obj.getSubObject("Face32")
# Typical drilling
self.assertFalse(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertFalse(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertFalse(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# cylinder on slope
candidate = self.obj.getSubObject("Face24")
# Typical drilling
self.assertTrue(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertTrue(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# Circular Faces
candidate = self.obj.getSubObject("Face54")
# Typical drilling
self.assertTrue(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertTrue(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# Passing explicit vector
self.assertTrue(
drillableLib.isDrillable(
Drillable.isDrillable(
self.obj.Shape, candidate, vector=App.Vector(0, 0, 1)
)
)
# Drilling with smaller bit
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, tooldiameter=10)
Drillable.isDrillable(self.obj.Shape, candidate, tooldiameter=10)
)
# Drilling with bit too large
self.assertFalse(
drillableLib.isDrillable(self.obj.Shape, candidate, tooldiameter=30)
Drillable.isDrillable(self.obj.Shape, candidate, tooldiameter=30)
)
# off-axis circular face hole
candidate = self.obj.getSubObject("Face58")
# Typical drilling
self.assertFalse(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertFalse(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# Passing explicit vector
self.assertTrue(
drillableLib.isDrillable(
Drillable.isDrillable(
self.obj.Shape, candidate, vector=App.Vector(0, -1, 0)
)
)
@@ -199,31 +199,31 @@ class TestPathDrillable(PathTestUtils.PathTestBase):
# raised face
candidate = self.obj.getSubObject("Face49")
# Typical drilling
self.assertTrue(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertTrue(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# interrupted Face
candidate = self.obj.getSubObject("Face50")
# Typical drilling
self.assertFalse(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertFalse(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertFalse(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# donut face
candidate = self.obj.getSubObject("Face48")
# Typical drilling
self.assertTrue(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertTrue(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# Test edges
@@ -231,28 +231,28 @@ class TestPathDrillable(PathTestUtils.PathTestBase):
candidate = self.obj.getSubObject("Edge55")
# Typical drilling
self.assertTrue(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertTrue(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# Passing explicit vector
self.assertTrue(
drillableLib.isDrillable(
Drillable.isDrillable(
self.obj.Shape, candidate, vector=App.Vector(0, 0, 1)
)
)
# Drilling with smaller bit
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, tooldiameter=10)
Drillable.isDrillable(self.obj.Shape, candidate, tooldiameter=10)
)
# Drilling with bit too large
self.assertFalse(
drillableLib.isDrillable(
Drillable.isDrillable(
self.obj.Shape, candidate, tooldiameter=30, vector=None
)
)
@@ -261,16 +261,16 @@ class TestPathDrillable(PathTestUtils.PathTestBase):
candidate = self.obj.getSubObject("Edge74")
# Typical drilling
self.assertFalse(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertFalse(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertTrue(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# Passing explicit vector
self.assertTrue(
drillableLib.isDrillable(
Drillable.isDrillable(
self.obj.Shape, candidate, vector=App.Vector(0, 1, 0)
)
)
@@ -278,32 +278,32 @@ class TestPathDrillable(PathTestUtils.PathTestBase):
# incomplete circular edge
candidate = self.obj.getSubObject("Edge39")
# Typical drilling
self.assertFalse(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertFalse(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertFalse(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
# elliptical edge
candidate = self.obj.getSubObject("Edge56")
# Typical drilling
self.assertFalse(drillableLib.isDrillable(self.obj.Shape, candidate))
self.assertFalse(Drillable.isDrillable(self.obj.Shape, candidate))
# Passing None as vector
self.assertFalse(
drillableLib.isDrillable(self.obj.Shape, candidate, vector=None)
Drillable.isDrillable(self.obj.Shape, candidate, vector=None)
)
def test20(self):
"""Test getDrillableTargets"""
results = drillableLib.getDrillableTargets(self.obj)
results = Drillable.getDrillableTargets(self.obj)
self.assertEqual(len(results), 15)
results = drillableLib.getDrillableTargets(self.obj, vector=None)
results = Drillable.getDrillableTargets(self.obj, vector=None)
self.assertEqual(len(results), 20)
results = drillableLib.getDrillableTargets(
results = Drillable.getDrillableTargets(
self.obj, ToolDiameter=20, vector=None
)
self.assertEqual(len(results), 5)