From ed8ab9a3644298b84f9ae7dfaef7bf2b63129c56 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sun, 17 Jul 2016 15:40:56 +0200 Subject: [PATCH] Fix width of gearbox to make space for two big gears --- boxes/generators/gearbox.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/boxes/generators/gearbox.py b/boxes/generators/gearbox.py index 44a997a..d8ec189 100644 --- a/boxes/generators/gearbox.py +++ b/boxes/generators/gearbox.py @@ -50,16 +50,21 @@ class GearBox(Boxes): t = self.thickness x = 1.1*t*self.stages - y = size1 + size2 + if self.stages == 1: + y = size1 + size2 + y1 = y/2-(pitch1+pitch2)+pitch1 + y2 = y/2+(pitch1+pitch2)-pitch2 + else: + y = 2 * size2 + y1 = y/2 - (pitch1+pitch2)/2 + y2 = y/2 + (pitch1+pitch2)/2 + h = max(size1, size2) + t b = "F" t = "e" # prepare for close box mh = self.shaft - # render your parts here - y1 = y/2-(pitch1+pitch2)+pitch1 - y2 = y/2+(pitch1+pitch2)-pitch2 def sideCB(): self.hole(y1, h/2, mh/2)