From d2e738c9fb139922d151ec91c2bf7dcac351dd7c Mon Sep 17 00:00:00 2001 From: fidoriel <49869342+fidoriel@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:36:30 +0100 Subject: [PATCH] edge width and better help --- boxes/generators/brick_sorter.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/boxes/generators/brick_sorter.py b/boxes/generators/brick_sorter.py index e83ddd40a..1855586d1 100644 --- a/boxes/generators/brick_sorter.py +++ b/boxes/generators/brick_sorter.py @@ -47,10 +47,11 @@ class BrickSorter(Boxes): level: str radius: int wiggle: float + edge_width: int = 3 def __init__(self) -> None: Boxes.__init__(self) - self.addSettingsArgs(edges.FingerJointSettings) + self.addSettingsArgs(edges.FingerJointSettings, edge_width=self.edge_width) self.buildArgParser(x=256, y=256, h=120) self.level_desc = list(self.sieve_sizes.keys()) + ["bottom"] self.argparser.add_argument( @@ -77,6 +78,9 @@ def __init__(self) -> None: default=4, help="Wiggle room, that the layers can slide in each other." ) + for action in self.argparser._actions: + if action.dest in ["x", "y"]: + action.help = "outer width of the most outer layer" @property def _sieve_grid_thickness(self) -> int: @@ -89,7 +93,8 @@ def _sieve_level_index(self) -> int: @property def _outer_height_after_nesting(self) -> float: - return self.h - ((2 * self.thickness + 2) * self._sieve_level_index) + top_margin_for_inaccuracies = 2 + return self.h - ((self.edge_width * self.thickness + top_margin_for_inaccuracies) * self._sieve_level_index) def _xy_after_nesting(self, a: float) -> float: return a - ((2 * self.thickness + self.wiggle) * self._sieve_level_index)