From a2eed9fa96fa0cdada2729d6c21c9ece93820f3b Mon Sep 17 00:00:00 2001 From: wes Date: Sat, 26 Oct 2024 14:42:12 -0400 Subject: [PATCH] add missing stuff to enclosure bottom --- enclosure.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/enclosure.py b/enclosure.py index d53d324..0e67b5c 100755 --- a/enclosure.py +++ b/enclosure.py @@ -1,5 +1,8 @@ import cadquery as cq +usb_h = 10.5 +usb_v = 5.2 + socket_distance_x = 10.8 socket_distance_y = 36.55 socket_width = 28 @@ -121,6 +124,21 @@ bottom = ( .cutBlind("next") ) +holes = ( + cq.Workplane("XY") + .rect((p_outerWidth - 20.0 * p_thickness), (p_outerLength - 20.0 * p_thickness)) + .vertices() + .cylinder(10, 3.1 / 2) +) + +bottom = bottom.cut(holes) + +bottom = ( + bottom.faces(">Y[0]") + .workplane(offset=0) + .move(0, -(p_outerHeight / 2) - usb_v - 3.3) + .box(usb_h, usb_v, 10, combine="cut") +) # lid = (lid.center(socket_width-8, socket_distance_y+(socket_width)-3) # .rect(reset_height, reset_width) @@ -162,4 +180,9 @@ if p_flipLid: # return the combined result result = topOfLid.union(bottom) -cq.exporters.export(result, "/home/wes/model_files/enclosure.step") +cq.exporters.export(bottom, "/home/deck/model_files/enclosure_bottom.step") + +try: + show_object(bottom) +except NameError: + pass