Skip to content

Commit

Permalink
connector: teeth->num_teeth
Browse files Browse the repository at this point in the history
  • Loading branch information
looooo committed Oct 21, 2024
1 parent 7955118 commit b907e1f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions freecad/gears/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def onChanged(self, fp, prop):
dist, alpha_w = compute_shifted_gears(
fp.master_gear.module,
np.deg2rad(fp.master_gear.pressure_angle.Value),
fp.master_gear.teeth,
fp.slave_gear.teeth,
fp.master_gear.num_teeth,
fp.slave_gear.num_teeth,
fp.master_gear.shift,
fp.slave_gear.shift,
)
Expand All @@ -135,7 +135,7 @@ def onChanged(self, fp, prop):
angle2 = dw_master / dw_slave * fp.angle1.Value
angle4 = dw_master / dw_slave * np.rad2deg(angle_master)
rot2 = app.Rotation(app.Vector(0, 0, 1), angle2).toMatrix()
angle3 = abs(fp.slave_gear.teeth % 2 - 1) * 180.0 / fp.slave_gear.teeth
angle3 = abs(fp.slave_gear.num_teeth % 2 - 1) * 180.0 / fp.slave_gear.num_teeth
rot3 = app.Rotation(app.Vector(0, 0, 1), angle3).toMatrix()
rot4 = app.Rotation(app.Vector(0, 0, 1), -angle4).toMatrix()
mat1 = rot * mat0 * rot2 * rot3 * rot4
Expand All @@ -155,8 +155,8 @@ def onChanged(self, fp, prop):
dist, alpha_w = compute_shifted_gears(
fp.master_gear.module,
np.deg2rad(fp.master_gear.pressure_angle.Value),
fp.master_gear.teeth,
fp.slave_gear.teeth,
fp.master_gear.num_teeth,
fp.slave_gear.num_teeth,
fp.master_gear.shift,
fp.slave_gear.shift,
)
Expand All @@ -168,7 +168,7 @@ def onChanged(self, fp, prop):
angle2 = -dw_master / dw_slave * fp.angle1.Value
angle4 = -dw_master / dw_slave * np.rad2deg(angle_master)
rot2 = app.Rotation(app.Vector(0, 0, 1), angle2).toMatrix()
angle3 = abs(fp.slave_gear.teeth % 2 - 1) * 180.0 / fp.slave_gear.teeth
angle3 = abs(fp.slave_gear.num_teeth % 2 - 1) * 180.0 / fp.slave_gear.num_teeth
rot3 = app.Rotation(app.Vector(0, 0, 1), angle3).toMatrix()
rot4 = app.Rotation(app.Vector(0, 0, 1), -angle4).toMatrix()
mat1 = rot * mat0 * rot2 * rot3 * rot4
Expand Down Expand Up @@ -215,7 +215,7 @@ def onChanged(self, fp, prop):
angle2 = dw_master / dw_slave * fp.angle1.Value
angle4 = dw_master / dw_slave * np.rad2deg(angle_master)
rot2 = app.Rotation(app.Vector(0, 0, 1), angle2).toMatrix()
angle3 = abs(fp.slave_gear.teeth % 2 - 1) * 180.0 / fp.slave_gear.teeth
angle3 = abs(fp.slave_gear.num_teeth % 2 - 1) * 180.0 / fp.slave_gear.num_teeth
rot3 = app.Rotation(app.Vector(0, 0, 1), angle3).toMatrix()
rot4 = app.Rotation(app.Vector(0, 0, 1), -angle4).toMatrix()
mat1 = rot * mat0 * rot2 * rot3 * rot4
Expand Down

0 comments on commit b907e1f

Please sign in to comment.