Skip to content

Commit

Permalink
small progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeicor committed Mar 10, 2024
1 parent 3672226 commit 2fe6cca
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/module_allen_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@

# %% ================== MODELLING ==================

box_width = max(grid_dim[0], 40 * MM)
box_length = max(grid_dim[1], 35 * MM)
box_height = 20 * MM
# https://www.amazon.es/dp/B07ZMXQ68T
box_min_width = 35.5 * MM
box_max_width = 43 * MM
box_min_length = 42 * MM
box_max_length = 70 * MM
box_height = 23 * MM
screw_max_diameter = 9 * MM

box_width = max(grid_dim[0], box_max_width)
box_length = max(grid_dim[1], box_max_length)

with BuildPart() as conn_core:
with BuildPart(mode=Mode.PRIVATE) as grid_conn:
Expand All @@ -25,25 +32,24 @@
RigidJoint(label="conn_core", joint_location=faces().group_by(Axis.Z)[0].face().center_location)

with BuildPart() as box:
Box(box_width, box_length, box_height)
Box(box_width - 2 * wall, box_length - 2 * wall, box_height, mode=Mode.SUBTRACT)
Box(box_width - 2 * wall, box_length, box_height - 2 * wall, mode=Mode.SUBTRACT)
Box(box_width, box_length - 2 * wall, box_height - 2 * wall, mode=Mode.SUBTRACT)
Box(box_max_width + 2 * wall, box_length + 2 * wall, box_height + 2 * wall)
Box(box_max_width + 2 * wall, box_length, box_height, mode=Mode.SUBTRACT)
Box(box_min_width, box_length + 2 * wall, box_height, mode=Mode.SUBTRACT)
Box(box_min_width, box_length, box_height + 2 * wall, mode=Mode.SUBTRACT)

loc = faces().group_by(Axis.Z)[-1].face().center_location
loc.orientation = Vector(loc.orientation.X + 180, loc.orientation.Y, loc.orientation.Z)
RigidJoint(label="top_conn_core", joint_location=loc)
del loc

conn_core.joints["conn_core"].connect_to(box.joints["top_conn_core"])
part = conn_core.part + box.part
module_allen_box = conn_core.part + box.part
show(box.part)
del conn_core, box
show(part, names='conn_core')

# %% ================== EXPORT ==================

if __name__ == "__main__":
module_allen_box = part
import logging

logging.basicConfig(level=logging.DEBUG)
Expand Down

0 comments on commit 2fe6cca

Please sign in to comment.