From 9bdabfdd98401906ce3c66890057634edf664b4d Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Mon, 20 Mar 2023 13:19:14 -0300 Subject: [PATCH] Refactor audio plug module --- notebook_nueva/audio_plug.py | 44 ++++++++++++++++++++++++++++++---- notebook_nueva/model.stl | Bin 1687684 -> 1662084 bytes notebook_nueva/modelo.py | 22 ++++++++--------- notebook_nueva/right_side.stl | Bin 693984 -> 668384 bytes notebook_nueva/utils.py | 13 +++++++++- 5 files changed, 62 insertions(+), 17 deletions(-) diff --git a/notebook_nueva/audio_plug.py b/notebook_nueva/audio_plug.py index d064475..1f09e5b 100644 --- a/notebook_nueva/audio_plug.py +++ b/notebook_nueva/audio_plug.py @@ -1,7 +1,10 @@ # Hole to expose a USB audio card (YMMV) -# The hole is for a USB-A plug, y is measured in the hub -# (from the bottom face to middle of the hole) +import cadquery as cq + +from utils import punch_hole2, extrude_shape2 + +# The hole is for a random USB sound card. # Consumers should set proper offsets for the hole holes = [ @@ -9,8 +12,39 @@ holes = [ { "x": 0, "y": 4, - "height": 6, - "width": 17, - "fillet": 2, + "shape": cq.Sketch().trapezoid(17, 2, 90, mode="a").fillet(2), }, ] + + +def add( + *, + model, + width, + height, + thickness, + offset_x, + offset_y, + bottom_face, + back_face, + shell_t +): + + # Holes + if back_face: + for hole in holes: + model = punch_hole2( + model=model, + face=back_face, + # FIXME: This is weird because it's the RIGHT side, + # So it's height instead of w + # need to work on making these coherent + w=height, + h=thickness, + x_offset=offset_x - 17 / 2, + y_offset=shell_t, + hole=hole, + depth=shell_t, + ) + + return model diff --git a/notebook_nueva/model.stl b/notebook_nueva/model.stl index 1e6c4475be85908a14a421e7f08d0ddeb0d4d8c4..c63f42e35f76a70d1e2664c4b74c388d37c51e71 100644 GIT binary patch delta 820 zcmZXS%}T>S5XZNjR&9-%*rrV>TD%E@A2$z58|}?QO~6A1MJXbF9BM)Au?59zq~HjO zPoRhg(IR5;1@slXdh*}{IGb$J6$8I8Wd1Wd^WPjdw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6h+Wg(ilc6IT zMKC(%H`&XcW?T<0Zj6M1wn3RlCq+kdGBBX#H{#1SXq+u)Pi16O%0J{*rRYqCB5~(* zj9r`}Z45`rv3pF0&VBMewYUpA#x58s3pkMzQBq!I=uD9e%=Pk%{$-~(ALe*d6ltS4 zDvFb#b6$#I(wcuTpzIpQSK{JzM)J+&6_|)rDLQ-4M-n!gWBQ$cgdhk~q>WKh#5y2p zzNF~Ng(7j&dW>CgD#KAY5KEB^T~AR%mNZF!2%+qZ$9ZtUNfc)|N<=&+Lsy0r!P+kW zoEcnC8xbp?oCY<$qnaU+w{1hq3z~_6H#6yfQXAzM7@m$1Kx&hpZAu?XwgWe zVacmqBsN^)Y*a8^il`IBv|!)lpRMqn{2c0?O$Hw3z&vVD942XbOp1D1WZ1g{I72aZ z@u>_!CI4xSDn+d}irAYA5Q(u1QlyRHC^-<1$-tCVhFa_S{Ni;&{(@zB4@S;!@?Q)g18*$AC~r_oS|Qzr2n=|8t-QqQ>qDG> z`c#1$2@eMNlPYp?#n|Z$%0!eLdzFDbYFO{!{Mw5#xSnDxEnSesDbhwMg5{T44qU!* n)y7-T+qg>p9V`D<%fB`9?``sLt^7Mq{vH3wc^lV#b<6()|Gfgz diff --git a/notebook_nueva/utils.py b/notebook_nueva/utils.py index baed6c9..29659ac 100644 --- a/notebook_nueva/utils.py +++ b/notebook_nueva/utils.py @@ -26,6 +26,16 @@ def punch_hole(*, model, face, w, h, x_offset, y_offset, hole, depth): ) +def extrude_shape2(*, model, face, w, h, x_offset, y_offset, hole, depth): + return ( + model.faces(face) + .workplane(centerOption="CenterOfBoundBox") + .center(-w / 2 + x_offset + hole["x"], -h / 2 + y_offset + hole["y"]) + .placeSketch(hole["shape"]) + .extrude(-depth) + ) + + def punch_hole2(*, model, face, w, h, x_offset, y_offset, hole, depth): return ( model.faces(face) @@ -35,6 +45,7 @@ def punch_hole2(*, model, face, w, h, x_offset, y_offset, hole, depth): .cutBlind(-depth) ) + def hex_vents(*, size, width, height): vent_positions = [] for x in range(1, width // size): @@ -53,4 +64,4 @@ def hex_vents(*, size, width, height): } ] - return vents \ No newline at end of file + return vents