12 changed files with 234 additions and 104 deletions
@ -0,0 +1,16 @@ |
|||
# 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) |
|||
# Consumers should set proper offsets for the hole |
|||
|
|||
holes = [ |
|||
# 2-jack plug |
|||
{ |
|||
"x": 0, |
|||
"y": 4, |
|||
"height": 6, |
|||
"width": 17, |
|||
"fillet": 2, |
|||
}, |
|||
] |
@ -1,8 +0,0 @@ |
|||
import cadquery as cq |
|||
|
|||
cpu_stand_positions = [(0, 0), (0, 23), (58, 23), (58, 0)] |
|||
|
|||
stands = ( |
|||
cq.Sketch().push(cpu_stand_positions).circle(3, mode="a").circle(2.65 / 2, mode="s") |
|||
) |
|||
pillar_height = 7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,33 @@ |
|||
import cadquery as cq |
|||
|
|||
# Measurements for my USB hub, YMMV |
|||
|
|||
# The hole is for a USB-A plug, y is measured in the hub |
|||
# (from the bottom face to middle of the hole) |
|||
# Consumers should set proper offsets for the hole |
|||
|
|||
holes = [ |
|||
# USB-A port |
|||
{ |
|||
"x": 0, |
|||
"y": 4, |
|||
"height": 5.5, |
|||
"width": 13, |
|||
"fillet": 2, |
|||
}, |
|||
] |
|||
|
|||
elements = [ |
|||
# Thing to grab the hub |
|||
{ |
|||
"x": 0, |
|||
"y": 5, |
|||
"shape": ( |
|||
cq.Sketch() |
|||
.trapezoid(22, 10, 90, mode="a") |
|||
.trapezoid(17, 10, 90, mode="s") |
|||
.clean() |
|||
), |
|||
"height": 8, |
|||
} |
|||
] |
@ -0,0 +1,26 @@ |
|||
import cadquery as cq |
|||
|
|||
# TODO make API of extrude_shape and punch_hole more consistent |
|||
def extrude_shape(*, model, face, w, h, x_offset, y_offset, shape, height): |
|||
return ( |
|||
model.faces(face) |
|||
.workplane(centerOption="CenterOfBoundBox") |
|||
.center(-w / 2 + x_offset, -h / 2 + y_offset) |
|||
.placeSketch(shape) |
|||
.extrude(height) |
|||
) |
|||
|
|||
|
|||
def punch_hole(*, 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( |
|||
cq.Sketch() |
|||
.trapezoid(hole["width"], hole["height"], 90, mode="a") |
|||
.vertices() |
|||
.fillet(hole["fillet"]) |
|||
) |
|||
.cutBlind(-depth) |
|||
) |
@ -0,0 +1,18 @@ |
|||
import cadquery as cq |
|||
|
|||
positions = [(0, 0), (0, 23), (58, 23), (58, 0)] |
|||
|
|||
stands = ( |
|||
cq.Sketch().push(positions).circle(3, mode="a").circle(2.65 / 2, mode="s") |
|||
) |
|||
pillar_height = 7 |
|||
|
|||
elements = [ |
|||
# CPU holder stands |
|||
{ |
|||
"x": 0, |
|||
"y": 0, |
|||
"shape": stands, |
|||
"height": pillar_height, |
|||
} |
|||
] |
Loading…
Reference in new issue