From 284e2881b6b3ce31614720631ed5468b1c0c76cd Mon Sep 17 00:00:00 2001 From: "Orhan \"aib\" Kavrakoglu" Date: Wed, 25 Dec 2024 21:28:39 +0100 Subject: [PATCH] Extend axle and offset holes past the limits of the gear. Fixes #196 --- freecad/gears/involutegear.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/freecad/gears/involutegear.py b/freecad/gears/involutegear.py index 35e1179..e05e101 100644 --- a/freecad/gears/involutegear.py +++ b/freecad/gears/involutegear.py @@ -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