DividerTray: Fix height if "outside" and "bottom" is selected

Thanks to https://github.com/nialabert for reporting!

Resolves: #413
This commit is contained in:
Florian Festi 2022-07-12 22:10:59 +02:00
parent bf84ee1e73
commit 574f72e6e4
1 changed files with 5 additions and 2 deletions

View File

@ -112,8 +112,11 @@ class DividerTray(Boxes):
if side_walls_number == 0: if side_walls_number == 0:
raise ValueError("You need at least one side wall to generate this tray") raise ValueError("You need at least one side wall to generate this tray")
# If measures are inside, we need to adjust height before slot generation # We need to adjust height before slot generation
if not self.outside: if self.outside:
if self.bottom:
self.h -= self.thickness
else:
# If the parameter 'h' is the inner height of the content itself, # If the parameter 'h' is the inner height of the content itself,
# then the actual tray height needs to be adjusted with the angle # then the actual tray height needs to be adjusted with the angle
self.h = self.h * math.cos(math.radians(self.Slot_angle)) self.h = self.h * math.cos(math.radians(self.Slot_angle))