Skip to content

Commit

Permalink
Extend axle and offset holes past the limits of the gear. Fixes #196
Browse files Browse the repository at this point in the history
  • Loading branch information
aib authored and looooo committed Dec 25, 2024
1 parent f473737 commit 284e288
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions freecad/gears/involutegear.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,13 @@ def generate_gear_shape(self, obj):
gear_shape = part.makeCylinder(rw, obj.height.Value)
if hasattr(obj, "axle_hole"):
if obj.axle_hole and obj.axle_holesize.Value > 0:
axle_hole = part.makeCylinder(obj.axle_holesize.Value/2, obj.height.Value)
axle_hole = part.makeCylinder(obj.axle_holesize.Value/2, obj.height.Value*2)
axle_hole.Placement.Base = app.Vector(0, 0, -obj.height.Value/2)
gear_shape = gear_shape.cut(axle_hole)

if obj.offset_hole and obj.offset_holesize.Value > 0:
hole = part.makeCylinder(obj.offset_holesize.Value/2, obj.height.Value)
hole.Placement.Base = app.Vector(-obj.offset_holeoffset.Value, 0,0) #-obj.offset_holeoffset.Value/2, 0)
hole = part.makeCylinder(obj.offset_holesize.Value/2, obj.height.Value*2)
hole.Placement.Base = app.Vector(-obj.offset_holeoffset.Value, 0, -obj.height.Value/2)
gear_shape = gear_shape.cut(hole)

return gear_shape
Expand Down

0 comments on commit 284e288

Please sign in to comment.