Skip to content

Commit

Permalink
[PD] Misc. small LGTM fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chennes authored and wwmayer committed Mar 28, 2021
1 parent 6bd2dc7 commit 07b9cbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/Mod/PartDesign/fcsprocket/fcsprocket.py
Expand Up @@ -15,10 +15,10 @@
# License along with FCGear; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307

from math import cos, sin, pi, acos, asin, atan, sqrt
from math import acos

import FreeCAD, Part
from FreeCAD import Base, Console
from FreeCAD import Base
from . import sprocket
rotate = sprocket.rotate

Expand Down
9 changes: 4 additions & 5 deletions src/Mod/PartDesign/fcsprocket/fcsprocketdialog.py
Expand Up @@ -16,7 +16,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307

from PySide import QtGui as qt
import fcsprocket
import FreeCAD, FreeCADGui

class SprocketCreationFrame(qt.QFrame):
Expand Down Expand Up @@ -51,10 +50,10 @@ def accept(self):
if FreeCAD.ActiveDocument is None:
FreeCAD.newDocument("Sprocket")

gear = fcgear.makeSprocket(self.gc.m.value(),
self.gc.Z.value(),
self.gc.angle.value(),
not self.gc.split.currentIndex())
gear_unused = fcgear.makeSprocket(self.gc.m.value(),
self.gc.Z.value(),
self.gc.angle.value(),
not self.gc.split.currentIndex())
FreeCADGui.SendMsgToActiveView("ViewFit")
return super(SprocketDialog, self).accept()

Expand Down
9 changes: 3 additions & 6 deletions src/Mod/PartDesign/fcsprocket/sprocket.py
Expand Up @@ -15,7 +15,7 @@
# License along with FCGear; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307

from math import cos, sin, tan, sqrt, radians, acos, atan, asin, degrees
from math import cos, sin, tan, sqrt, radians, atan, asin, degrees


def CreateSprocket(w, P, N, Dr):
Expand All @@ -31,8 +31,6 @@ def CreateSprocket(w, P, N, Dr):
"""
Ds = 1.005 * Dr + (0.003 * 25.4)
R = Ds / 2
alpha = 35 + 60/N
beta = 18 - 56 / N
M = 0.8 * Dr * cos(radians(35) + radians(60/N))
T = 0.8 * Dr * sin(radians(35) + radians(60/N))
E = 1.3025 * Dr + (0.0015 * 25.4)
Expand All @@ -41,8 +39,8 @@ def CreateSprocket(w, P, N, Dr):
F = Dr * (0.8 * cos(radians(18) - radians(56)/N) + 1.4 *
cos(radians(17) - radians(64) / N) - 1.3025) - (0.0015 * 25.4)
PD = P / (sin(radians(180)/N))
H = sqrt(F**2 - (1.4 * Dr - P/2)**2)
OD = P * (0.6 + 1/tan(radians(180/N)))
# H = sqrt(F**2 - (1.4 * Dr - P/2)**2)
# OD = P * (0.6 + 1/tan(radians(180/N)))

# The sprocket tooth gullet consists of four segments
x0 = 0
Expand All @@ -52,7 +50,6 @@ def CreateSprocket(w, P, N, Dr):
alpha = 35 + 60/N
x1 = -R * cos(radians(alpha))
y1 = PD/2 - R * sin(radians(alpha))
arc_end = [x1, y1]

# ---- Segment 2 -----
alpha = 35 + 60/N
Expand Down

0 comments on commit 07b9cbb

Please sign in to comment.