Adjust battery holder parameters

This commit is contained in:
Roberto Alsina 2023-02-22 15:02:10 -03:00
parent af3e1824f4
commit a894e8319c
5 changed files with 26 additions and 23 deletions

View File

@ -1,14 +1,12 @@
import cadquery as cq
stand_positions = [(0, 0), (58, 0), (58, 49), (0, 49)]
lower_stands = cq.Sketch().push(stand_positions).circle(3, mode="a")
higher_stands = cq.Sketch().push(stand_positions).circle(2.65 / 2, mode="a")
pillar_height = 7
# This is a holder for DuPont cables so they connect to this
# things' pogo pins which are used to power the CPU
pin_positions = [(4, 0), (4 * 2.54 + 4, 0)]
pin_holder_width = 25
pin_holder_height = 15

Binary file not shown.

Binary file not shown.

View File

@ -82,20 +82,13 @@ usb_in = cq.Sketch().trapezoid(13, 5.5, 90, mode="a")
# Hole for the USB hub's exposed port
audio_in = cq.Sketch().trapezoid(17, 6, 90, mode="a")
# 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")
# CPU stand pins
lower_stands = (
cq.Sketch().push([(0, 0), (58, 0), (58, 23), (0, 23)]).circle(3, mode="a")
)
higher_stands = (
cq.Sketch().push([(0, 0), (58, 0), (58, 23), (0, 23)]).circle(2.65 / 2, mode="a")
)
def model():
return (
@ -112,14 +105,24 @@ def model():
# The position is arbitrary, based on the components available
.faces(">Y")
.workplane(centerOption="CenterOfBoundBox")
.center(width / 2 - 15 - 21, -8.5)
# 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,
)
.placeSketch(power_in)
.cutBlind(-shell_t)
# Power button
# The position is arbitrary, based on the components available,
.faces(">Y")
.workplane(centerOption="CenterOfBoundBox")
.center(width / 2 - 67 - 21, -1)
# 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,
)
.placeSketch(power_button_cut)
.cutBlind(-shell_t)
# USB inlet
@ -187,27 +190,29 @@ def model():
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")
.center(width / 2 - 40, height / 2 - 65)
.placeSketch(cpu_holder.higher_stands)
.extrude(13)
.extrude(10.5)
# Battery Stands (lower)
# The +18, -55 is the position of the battery system,
# and should be a parameter (TODO)
.workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")
.center(-width / 2 + 21, height / 2 - 56)
.center(-width / 2 + battery_offset_x, height / 2 - battery_offset_y)
.placeSketch(battery_holder.lower_stands)
.extrude(shell_t + 5)
.extrude(shell_t + battery_holder.pillar_height)
# Battery Stands (higher)
.workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")
.center(-width / 2 + 21, height / 2 - 56)
.center(-width / 2 + battery_offset_x, height / 2 - battery_offset_y)
.placeSketch(battery_holder.higher_stands)
.extrude(shell_t + 11)
.extrude(shell_t + battery_holder.pillar_height + 3.5)
# Pogo pin connector holders
.workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")
.center(-width / 2 + 21, height / 2 - 56 - battery_holder.pin_holder_height / 2)
.center(
-width / 2 + battery_offset_x,
height / 2 - battery_offset_y - battery_holder.pin_holder_height / 2,
)
.placeSketch(battery_holder.pin_holder)
.extrude(shell_t + 4)
.extrude(shell_t + 3)
)

Binary file not shown.