|
|
@ -78,16 +78,21 @@ screw_holes = cq.Sketch().push(mounting_pillar_positions).circle(3, mode="a") |
|
|
|
|
|
|
|
# Hole for the USB hub's exposed port |
|
|
|
usb_in = cq.Sketch().trapezoid(13, 5.5, 90, mode="a") |
|
|
|
# Thing to "grab" the hub so it stays in place |
|
|
|
usb_holder = ( |
|
|
|
cq.Sketch().trapezoid(10, 22, 90, mode="a").trapezoid(10, 17, 90, mode="s").clean() |
|
|
|
) |
|
|
|
|
|
|
|
# Hole for the USB hub's exposed port |
|
|
|
audio_in = cq.Sketch().trapezoid(17, 6, 90, mode="a") |
|
|
|
|
|
|
|
# CPU holder position from back-right corner of the case |
|
|
|
cpu_offset_x = 40 |
|
|
|
cpu_offset_y = 65 |
|
|
|
|
|
|
|
# Battery holder position from front-left corner of the case |
|
|
|
battery_offset_x = 21 |
|
|
|
battery_offset_y = 56 |
|
|
|
# Holes for the battery power cable and button |
|
|
|
power_in = cq.Sketch().trapezoid(10, 5.5, 90, mode="a") |
|
|
|
power_button_cut = cq.Sketch().trapezoid(7, 7, 90, mode="a") |
|
|
|
|
|
|
|
|
|
|
|
def model(): |
|
|
@ -108,10 +113,13 @@ def model(): |
|
|
|
# The 15 is distance from stand hole center to center of USB plug |
|
|
|
# The -1 is distance from top of the pillar to center of USB plug |
|
|
|
.center( |
|
|
|
width / 2 - battery_offset_x - 15, |
|
|
|
-thickness / 2 + battery_holder.pillar_height + shell_t - 1, |
|
|
|
width / 2 - battery_offset_x - battery_holder.power_in_offset_x, |
|
|
|
-thickness / 2 |
|
|
|
+ battery_holder.pillar_height |
|
|
|
+ shell_t |
|
|
|
+ battery_holder.power_in_offset_y, |
|
|
|
) |
|
|
|
.placeSketch(power_in) |
|
|
|
.placeSketch(battery_holder.power_in) |
|
|
|
.cutBlind(-shell_t) |
|
|
|
# Power button |
|
|
|
# The position is arbitrary, based on the components available, |
|
|
@ -120,10 +128,13 @@ def model(): |
|
|
|
# The 67 is distance from stand hole center to center of power button |
|
|
|
# The 5 is distance from top of the pillar to center of power button |
|
|
|
.center( |
|
|
|
width / 2 - battery_offset_x - 67, |
|
|
|
-thickness / 2 + battery_holder.pillar_height + shell_t + 5, |
|
|
|
width / 2 - battery_offset_x - battery_holder.button_offset_x, |
|
|
|
-thickness / 2 |
|
|
|
+ battery_holder.pillar_height |
|
|
|
+ shell_t |
|
|
|
+ battery_holder.button_offset_y, |
|
|
|
) |
|
|
|
.placeSketch(power_button_cut) |
|
|
|
.placeSketch(battery_holder.power_button_cut) |
|
|
|
.cutBlind(-shell_t) |
|
|
|
# USB inlet |
|
|
|
# The position is arbitrary, based on the components |
|
|
@ -178,17 +189,15 @@ def model(): |
|
|
|
# 13 is 20-7 (screw thread length - threaded insert depth) |
|
|
|
.cutBlind(thickness - 13) |
|
|
|
# CPU Stands (lower) |
|
|
|
# The -65, -40 is the position of the CPU, |
|
|
|
# and should be a parameter (TODO) |
|
|
|
.workplaneFromTagged("mid_height") |
|
|
|
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox") |
|
|
|
.center(width / 2 - 40, height / 2 - 65) |
|
|
|
.center(width / 2 - cpu_offset_x, height / 2 - cpu_offset_y) |
|
|
|
.placeSketch(cpu_holder.lower_stands) |
|
|
|
.extrude(7) |
|
|
|
# CPU Stands (higher) |
|
|
|
.workplaneFromTagged("mid_height") |
|
|
|
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox") |
|
|
|
.center(width / 2 - 40, height / 2 - 65) |
|
|
|
.center(width / 2 - cpu_offset_x, height / 2 - cpu_offset_y) |
|
|
|
.placeSketch(cpu_holder.higher_stands) |
|
|
|
.extrude(10.5) |
|
|
|
# Battery Stands (lower) |
|
|
@ -213,6 +222,12 @@ def model(): |
|
|
|
) |
|
|
|
.placeSketch(battery_holder.pin_holder) |
|
|
|
.extrude(shell_t + 3) |
|
|
|
# Channel for the usb hub |
|
|
|
.workplaneFromTagged("mid_height") |
|
|
|
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox") |
|
|
|
.center(width / 2 - 5, -height / 2 + shell_t + 45 + 13 / 2) |
|
|
|
.placeSketch(usb_holder) |
|
|
|
.extrude(shell_t + 8) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|