added symbol
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
from __future__ import division
|
||||
import os
|
||||
import FreeCAD as App
|
||||
from _involute_tooth import involute_tooth, involute_rack
|
||||
from _cycloide_tooth import cycloide_tooth
|
||||
@@ -34,12 +35,38 @@ from numpy import pi, cos, sin, tan
|
||||
import numpy
|
||||
|
||||
|
||||
|
||||
__all__=["involute_gear",
|
||||
"cycloide_gear",
|
||||
"bevel_gear",
|
||||
"involute_gear_rack",
|
||||
"ViewProviderGear"]
|
||||
|
||||
|
||||
|
||||
def fcvec(x):
|
||||
if len(x) == 2:
|
||||
return(App.Vector(x[0], x[1], 0))
|
||||
else:
|
||||
return(App.Vector(x[0], x[1], x[2]))
|
||||
|
||||
class ViewProviderGear:
|
||||
def __init__(self, obj):
|
||||
''' Set this object to the proxy object of the actual view provider '''
|
||||
obj.Proxy = self
|
||||
|
||||
def attach(self, vobj):
|
||||
self.vobj = vobj
|
||||
|
||||
def getIcon(self):
|
||||
_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
return(_dir + "/../Resources/icons/involutegear.svg")
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self, state):
|
||||
return None
|
||||
|
||||
class involute_gear():
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui as Gui
|
||||
from _Classes import involute_gear, cycloide_gear, bevel_gear, involute_gear_rack
|
||||
from _Classes import *
|
||||
|
||||
|
||||
class CreateInvoluteGear():
|
||||
@@ -41,7 +41,7 @@ class CreateInvoluteGear():
|
||||
def Activated(self):
|
||||
a = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "involute_gear")
|
||||
involute_gear(a)
|
||||
a.ViewObject.Proxy = 0.
|
||||
ViewProviderGear(a.ViewObject)
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
Gui.SendMsgToActiveView("ViewFit")
|
||||
|
||||
@@ -62,7 +62,7 @@ class CreateInvoluteRack():
|
||||
def Activated(self):
|
||||
a = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "involute_rack")
|
||||
involute_gear_rack(a)
|
||||
a.ViewObject.Proxy = 0.
|
||||
ViewProviderGear(a.ViewObject)
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
Gui.SendMsgToActiveView("ViewFit")
|
||||
|
||||
@@ -83,7 +83,7 @@ class CreateCycloideGear():
|
||||
def Activated(self):
|
||||
a = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "cycloide_gear")
|
||||
cycloide_gear(a)
|
||||
a.ViewObject.Proxy = 0.
|
||||
ViewProviderGear(a.ViewObject)
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
Gui.SendMsgToActiveView("ViewFit")
|
||||
|
||||
@@ -103,6 +103,6 @@ class CreateBevelGear():
|
||||
def Activated(self):
|
||||
a = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "bevel_gear")
|
||||
bevel_gear(a)
|
||||
a.ViewObject.Proxy = 0.
|
||||
ViewProviderGear(a.ViewObject)
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
Gui.SendMsgToActiveView("ViewFit")
|
||||
Reference in New Issue
Block a user