diff --git a/src/Mod/PartDesign/fcsprocket/fcsprocket.py b/src/Mod/PartDesign/fcsprocket/fcsprocket.py index 651659169d..344ea1e94c 100644 --- a/src/Mod/PartDesign/fcsprocket/fcsprocket.py +++ b/src/Mod/PartDesign/fcsprocket/fcsprocket.py @@ -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 diff --git a/src/Mod/PartDesign/fcsprocket/fcsprocketdialog.py b/src/Mod/PartDesign/fcsprocket/fcsprocketdialog.py index 7360a7235d..d5365eff51 100644 --- a/src/Mod/PartDesign/fcsprocket/fcsprocketdialog.py +++ b/src/Mod/PartDesign/fcsprocket/fcsprocketdialog.py @@ -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): @@ -51,10 +50,10 @@ class SprocketDialog(qt.QDialog): 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() diff --git a/src/Mod/PartDesign/fcsprocket/sprocket.py b/src/Mod/PartDesign/fcsprocket/sprocket.py index 9c1bc1c6b2..bc29970b10 100644 --- a/src/Mod/PartDesign/fcsprocket/sprocket.py +++ b/src/Mod/PartDesign/fcsprocket/sprocket.py @@ -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): @@ -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) @@ -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 @@ -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