diff --git a/src/Mod/Path/CMakeLists.txt b/src/Mod/Path/CMakeLists.txt index 8ff9c14efb..9537899f98 100644 --- a/src/Mod/Path/CMakeLists.txt +++ b/src/Mod/Path/CMakeLists.txt @@ -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 diff --git a/src/Mod/Path/PathScripts/drillableLib.py b/src/Mod/Path/Path/Base/Drillable.py similarity index 100% rename from src/Mod/Path/PathScripts/drillableLib.py rename to src/Mod/Path/Path/Base/Drillable.py diff --git a/src/Mod/Path/Path/Dressup/Gui/Dogbone.py b/src/Mod/Path/Path/Dressup/Gui/Dogbone.py index 8249ee6d16..1ffd6436fd 100644 --- a/src/Mod/Path/Path/Dressup/Gui/Dogbone.py +++ b/src/Mod/Path/Path/Dressup/Gui/Dogbone.py @@ -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() diff --git a/src/Mod/Path/Path/GuiInit.py b/src/Mod/Path/Path/GuiInit.py index ff84d9ddc8..265f6b9710 100644 --- a/src/Mod/Path/Path/GuiInit.py +++ b/src/Mod/Path/Path/GuiInit.py @@ -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 diff --git a/src/Mod/Path/Path/Op/Adaptive.py b/src/Mod/Path/Path/Op/Adaptive.py index b7a037440a..6c93c3e2c7 100644 --- a/src/Mod/Path/Path/Op/Adaptive.py +++ b/src/Mod/Path/Path/Op/Adaptive.py @@ -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") diff --git a/src/Mod/Path/Path/Op/CircularHoleBase.py b/src/Mod/Path/Path/Op/CircularHoleBase.py index b0e539d792..885b5ca031 100644 --- a/src/Mod/Path/Path/Op/CircularHoleBase.py +++ b/src/Mod/Path/Path/Op/CircularHoleBase.py @@ -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 ) ) diff --git a/src/Mod/Path/PathScripts/PathFeatureExtensions.py b/src/Mod/Path/Path/Op/FeatureExtension.py similarity index 100% rename from src/Mod/Path/PathScripts/PathFeatureExtensions.py rename to src/Mod/Path/Path/Op/FeatureExtension.py diff --git a/src/Mod/Path/Path/Op/Gui/Adaptive.py b/src/Mod/Path/Path/Op/Gui/Adaptive.py index 7879e633ca..4bc069470b 100644 --- a/src/Mod/Path/Path/Op/Gui/Adaptive.py +++ b/src/Mod/Path/Path/Op/Gui/Adaptive.py @@ -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): diff --git a/src/Mod/Path/PathScripts/PathArray.py b/src/Mod/Path/Path/Op/Gui/Array.py similarity index 99% rename from src/Mod/Path/PathScripts/PathArray.py rename to src/Mod/Path/Path/Op/Gui/Array.py index 7e4c8fdf3c..b7daea3400 100644 --- a/src/Mod/Path/PathScripts/PathArray.py +++ b/src/Mod/Path/Path/Op/Gui/Array.py @@ -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] diff --git a/src/Mod/Path/Path/Op/Gui/Base.py b/src/Mod/Path/Path/Op/Gui/Base.py index 0876702507..cc240ed37f 100644 --- a/src/Mod/Path/Path/Op/Gui/Base.py +++ b/src/Mod/Path/Path/Op/Gui/Base.py @@ -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 diff --git a/src/Mod/Path/PathScripts/PathComment.py b/src/Mod/Path/Path/Op/Gui/Comment.py similarity index 96% rename from src/Mod/Path/PathScripts/PathComment.py rename to src/Mod/Path/Path/Op/Gui/Comment.py index 1f5e7c06ce..a359347892 100644 --- a/src/Mod/Path/PathScripts/PathComment.py +++ b/src/Mod/Path/Path/Op/Gui/Comment.py @@ -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) """ diff --git a/src/Mod/Path/PathScripts/PathCopy.py b/src/Mod/Path/Path/Op/Gui/Copy.py similarity index 95% rename from src/Mod/Path/PathScripts/PathCopy.py rename to src/Mod/Path/Path/Op/Gui/Copy.py index 0a622a3331..939da3c488 100644 --- a/src/Mod/Path/PathScripts/PathCopy.py +++ b/src/Mod/Path/Path/Op/Gui/Copy.py @@ -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 diff --git a/src/Mod/Path/PathScripts/PathFeatureExtensionsGui.py b/src/Mod/Path/Path/Op/Gui/FeatureExtension.py similarity index 99% rename from src/Mod/Path/PathScripts/PathFeatureExtensionsGui.py rename to src/Mod/Path/Path/Op/Gui/FeatureExtension.py index 5df092ddb0..8ce59b0260 100644 --- a/src/Mod/Path/PathScripts/PathFeatureExtensionsGui.py +++ b/src/Mod/Path/Path/Op/Gui/FeatureExtension.py @@ -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 diff --git a/src/Mod/Path/PathScripts/PathHop.py b/src/Mod/Path/Path/Op/Gui/Hop.py similarity index 96% rename from src/Mod/Path/PathScripts/PathHop.py rename to src/Mod/Path/Path/Op/Gui/Hop.py index 1447f98fa3..d3b2a04f32 100644 --- a/src/Mod/Path/PathScripts/PathHop.py +++ b/src/Mod/Path/Path/Op/Gui/Hop.py @@ -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 ) diff --git a/src/Mod/Path/Path/Op/Gui/PocketShape.py b/src/Mod/Path/Path/Op/Gui/PocketShape.py index 70788fccce..00f699b61d 100644 --- a/src/Mod/Path/Path/Op/Gui/PocketShape.py +++ b/src/Mod/Path/Path/Op/Gui/PocketShape.py @@ -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 diff --git a/src/Mod/Path/PathScripts/PathSelection.py b/src/Mod/Path/Path/Op/Gui/Selection.py similarity index 98% rename from src/Mod/Path/PathScripts/PathSelection.py rename to src/Mod/Path/Path/Op/Gui/Selection.py index ecb7c0d0ee..9044e54a55 100644 --- a/src/Mod/Path/PathScripts/PathSelection.py +++ b/src/Mod/Path/Path/Op/Gui/Selection.py @@ -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 diff --git a/src/Mod/Path/PathScripts/PathSimpleCopy.py b/src/Mod/Path/Path/Op/Gui/SimpleCopy.py similarity index 100% rename from src/Mod/Path/PathScripts/PathSimpleCopy.py rename to src/Mod/Path/Path/Op/Gui/SimpleCopy.py diff --git a/src/Mod/Path/PathScripts/PathStop.py b/src/Mod/Path/Path/Op/Gui/Stop.py similarity index 100% rename from src/Mod/Path/PathScripts/PathStop.py rename to src/Mod/Path/Path/Op/Gui/Stop.py diff --git a/src/Mod/Path/Path/Op/PocketShape.py b/src/Mod/Path/Path/Op/PocketShape.py index 62b2c6bc92..1a1817f1e2 100644 --- a/src/Mod/Path/Path/Op/PocketShape.py +++ b/src/Mod/Path/Path/Op/PocketShape.py @@ -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" ) diff --git a/src/Mod/Path/Path/Op/Profile.py b/src/Mod/Path/Path/Op/Profile.py index 7b79675ebf..92e17606a3 100644 --- a/src/Mod/Path/Path/Op/Profile.py +++ b/src/Mod/Path/Path/Op/Profile.py @@ -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: diff --git a/src/Mod/Path/PathCommands.py b/src/Mod/Path/PathCommands.py index a61e5ab25d..e42c995038 100644 --- a/src/Mod/Path/PathCommands.py +++ b/src/Mod/Path/PathCommands.py @@ -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): diff --git a/src/Mod/Path/PathTests/TestPathDrillable.py b/src/Mod/Path/PathTests/TestPathDrillable.py index 67b5f86743..f333585e2e 100644 --- a/src/Mod/Path/PathTests/TestPathDrillable.py +++ b/src/Mod/Path/PathTests/TestPathDrillable.py @@ -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)