Skip to content

Commit

Permalink
edge width and better help
Browse files Browse the repository at this point in the history
  • Loading branch information
fidoriel committed Mar 4, 2024
1 parent 7477033 commit d2e738c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions boxes/generators/brick_sorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit d2e738c

Please sign in to comment.