diff --git a/src/Mod/PartDesign/InitGui.py b/src/Mod/PartDesign/InitGui.py index f47991b6dcfd..372ef9d49264 100644 --- a/src/Mod/PartDesign/InitGui.py +++ b/src/Mod/PartDesign/InitGui.py @@ -35,30 +35,30 @@ def __init__(self): self.__class__.Icon = FreeCAD.getResourceDir() + "Mod/PartDesign/Resources/icons/PartDesignWorkbench.svg" self.__class__.MenuText = "Part Design" self.__class__.ToolTip = "Part Design workbench" - + def Initialize(self): - # load the module + # load the module + try: + from WizardShaft import WizardShaft + except ImportError: + print("Wizard shaft module cannot be loaded") try: - from WizardShaft import WizardShaft - except ImportError: - print("Wizard shaft module cannot be loaded") - try: - from FeatureHole import HoleGui - except: - pass + from FeatureHole import HoleGui + except: + pass - import PartDesignGui - import PartDesign - try: - import InvoluteGearFeature - except ImportError: - print("Involute gear module cannot be loaded") - #try: - # from FeatureHole import HoleGui - #except: - # pass + import PartDesignGui + import PartDesign + try: + import InvoluteGearFeature + except ImportError: + print("Involute gear module cannot be loaded") + #try: + # from FeatureHole import HoleGui + #except: + # pass def GetClassName(self): - return "PartDesignGui::Workbench" + return "PartDesignGui::Workbench" Gui.addWorkbench(PartDesignWorkbench()) diff --git a/src/Mod/PartDesign/fcgear/fcgear.py b/src/Mod/PartDesign/fcgear/fcgear.py index 9739bf88f0b3..3ae79c75f099 100644 --- a/src/Mod/PartDesign/fcgear/fcgear.py +++ b/src/Mod/PartDesign/fcgear/fcgear.py @@ -19,8 +19,7 @@ import FreeCAD, Part from FreeCAD import Base, Console -import involute -reload(involute) +from . import involute rotate = involute.rotate diff --git a/src/Mod/PartDesign/fcgear/involute.py b/src/Mod/PartDesign/fcgear/involute.py index 620afb052dfc..3add9181242f 100644 --- a/src/Mod/PartDesign/fcgear/involute.py +++ b/src/Mod/PartDesign/fcgear/involute.py @@ -24,6 +24,11 @@ from math import cos, sin, pi, acos, asin, atan, sqrt +import sys +if sys.version_info.major >= 3: + xrange = range + + def CreateExternalGear(w, m, Z, phi, split=True): """ Create an external gear