USB hub holder + parametrization

This commit is contained in:
Roberto Alsina 2023-02-22 18:17:02 -03:00
parent a894e8319c
commit 84f5978454
6 changed files with 37 additions and 13 deletions

View File

@ -5,6 +5,15 @@ lower_stands = cq.Sketch().push(stand_positions).circle(3, mode="a")
higher_stands = cq.Sketch().push(stand_positions).circle(2.65 / 2, mode="a") higher_stands = cq.Sketch().push(stand_positions).circle(2.65 / 2, mode="a")
pillar_height = 7 pillar_height = 7
# Holes for the battery power cable and button
power_in = cq.Sketch().trapezoid(10, 5.5, 90, mode="a")
power_in_offset_x = 15
power_in_offset_y = -1
button_offset_x = 67
button_offset_y = 5
power_button_cut = cq.Sketch().trapezoid(7, 7, 90, mode="a")
# This is a holder for DuPont cables so they connect to this # This is a holder for DuPont cables so they connect to this
# things' pogo pins which are used to power the CPU # things' pogo pins which are used to power the CPU
pin_positions = [(4, 0), (4 * 2.54 + 4, 0)] pin_positions = [(4, 0), (4 * 2.54 + 4, 0)]

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -78,16 +78,21 @@ screw_holes = cq.Sketch().push(mounting_pillar_positions).circle(3, mode="a")
# Hole for the USB hub's exposed port # Hole for the USB hub's exposed port
usb_in = cq.Sketch().trapezoid(13, 5.5, 90, mode="a") 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 # Hole for the USB hub's exposed port
audio_in = cq.Sketch().trapezoid(17, 6, 90, mode="a") 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 holder position from front-left corner of the case
battery_offset_x = 21 battery_offset_x = 21
battery_offset_y = 56 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(): def model():
@ -108,10 +113,13 @@ def model():
# The 15 is distance from stand hole center to center of USB plug # 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 # The -1 is distance from top of the pillar to center of USB plug
.center( .center(
width / 2 - battery_offset_x - 15, width / 2 - battery_offset_x - battery_holder.power_in_offset_x,
-thickness / 2 + battery_holder.pillar_height + shell_t - 1, -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) .cutBlind(-shell_t)
# Power button # Power button
# The position is arbitrary, based on the components available, # 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 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 # The 5 is distance from top of the pillar to center of power button
.center( .center(
width / 2 - battery_offset_x - 67, width / 2 - battery_offset_x - battery_holder.button_offset_x,
-thickness / 2 + battery_holder.pillar_height + shell_t + 5, -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) .cutBlind(-shell_t)
# USB inlet # USB inlet
# The position is arbitrary, based on the components # The position is arbitrary, based on the components
@ -178,17 +189,15 @@ def model():
# 13 is 20-7 (screw thread length - threaded insert depth) # 13 is 20-7 (screw thread length - threaded insert depth)
.cutBlind(thickness - 13) .cutBlind(thickness - 13)
# CPU Stands (lower) # CPU Stands (lower)
# The -65, -40 is the position of the CPU,
# and should be a parameter (TODO)
.workplaneFromTagged("mid_height") .workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox") .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) .placeSketch(cpu_holder.lower_stands)
.extrude(7) .extrude(7)
# CPU Stands (higher) # CPU Stands (higher)
.workplaneFromTagged("mid_height") .workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox") .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) .placeSketch(cpu_holder.higher_stands)
.extrude(10.5) .extrude(10.5)
# Battery Stands (lower) # Battery Stands (lower)
@ -213,6 +222,12 @@ def model():
) )
.placeSketch(battery_holder.pin_holder) .placeSketch(battery_holder.pin_holder)
.extrude(shell_t + 3) .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)
) )

Binary file not shown.