Skip to content

Commit

Permalink
Fix issues #7 and #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen committed Jun 5, 2024
1 parent 89a5768 commit 27a7862
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion generators/classicbin/classicbin_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def unit_base(self, basePlane):

# The elements are constructed "centered" because that makes life easier.
baseBottom = basePlane.box(self.grid.BASE_BOTTOM_SIZE_X, self.grid.BASE_BOTTOM_SIZE_Y, self.grid.BASE_BOTTOM_THICKNESS, combine=False)
baseBottom = baseBottom.edges("|Z").fillet(1.6)
baseBottom = baseBottom.edges("|Z").fillet(self.grid.BASE_BOTTOM_FILLET_RADIUS)
baseBottom = baseBottom.faces("<Z").chamfer(self.grid.BASE_BOTTOM_CHAMFER_SIZE)

baseTop = baseBottom.faces(">Z").workplane()
Expand Down
10 changes: 8 additions & 2 deletions generators/solidbin/solidbin_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def unit_base(self, basePlane):

baseTop = baseBottom.faces(">Z").workplane()
baseTop = baseTop.box(self.grid.BRICK_UNIT_SIZE_X, self.grid.BRICK_UNIT_SIZE_Y, self.grid.BASE_TOP_THICKNESS, centered=(True, True, False), combine=False)
baseTop = baseTop.edges("|Z").fillet(self.grid.BASE_TOP_FILLET_RADIUS)
baseTop = baseTop.edges("|Z").fillet(self.grid.CORNER_FILLET_RADIUS)
baseTop = baseTop.faces("<Z").chamfer(self.grid.BASE_TOP_CHAMFER_SIZE)

result = baseTop | baseBottom
Expand All @@ -42,7 +42,13 @@ def unit_base(self, basePlane):
(self.grid.HOLE_OFFSET_X, -self.grid.HOLE_OFFSET_Y),
(-self.grid.HOLE_OFFSET_X, -self.grid.HOLE_OFFSET_Y)])
result = result.hole(self.grid.DEFAULT_MAGNET_HOLE_DIAMETER, self.grid.DEFAULT_MAGNET_HOLE_DEPTH)

if self.settings.addRemovalHoles:
result = result.pushPoints([(self.grid.HOLE_OFFSET_X-self.grid.REMOVABLE_MAGNET_HOLE_OFFSET, self.grid.HOLE_OFFSET_Y-self.grid.REMOVABLE_MAGNET_HOLE_OFFSET),
(-self.grid.HOLE_OFFSET_X+self.grid.REMOVABLE_MAGNET_HOLE_OFFSET, self.grid.HOLE_OFFSET_Y-self.grid.REMOVABLE_MAGNET_HOLE_OFFSET),
(self.grid.HOLE_OFFSET_X-self.grid.REMOVABLE_MAGNET_HOLE_OFFSET, -self.grid.HOLE_OFFSET_Y+self.grid.REMOVABLE_MAGNET_HOLE_OFFSET),
(-self.grid.HOLE_OFFSET_X+self.grid.REMOVABLE_MAGNET_HOLE_OFFSET, -self.grid.HOLE_OFFSET_Y+self.grid.REMOVABLE_MAGNET_HOLE_OFFSET)])
result = result.hole(self.grid.REMOVABLE_MAGNET_HOLE_DIAMETER, self.grid.DEFAULT_MAGNET_HOLE_DEPTH)

if self.settings.addScrewHoles:
result = result.faces("<Z").workplane()
result = result.pushPoints([(self.grid.HOLE_OFFSET_X, self.grid.HOLE_OFFSET_Y),
Expand Down
2 changes: 1 addition & 1 deletion grid_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Grid:
BRICK_SIZE_TOLERANCE_MM: float = 0.5
BASE_BOTTOM_THICKNESS: float = 2.6
BASE_BOTTOM_CHAMFER_SIZE: float = 0.8
BASE_BOTTOM_FILLET_RADIUS: float = 3.75
BASE_BOTTOM_FILLET_RADIUS: float = 1.6
BASE_TOP_THICKNESS: float = 2.15
BASE_TOP_FILLET_RADIUS: float = 3.75
FLOOR_THICKNESS: float = 2.25 # This thickness makes the base exactly 1 height unit high
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.0"
__version__ = "0.2.2"

0 comments on commit 27a7862

Please sign in to comment.