CPU and battery stands with holes for screws

This commit is contained in:
Roberto Alsina 2023-02-23 10:08:57 -03:00
parent 84f5978454
commit 7fbf323e45
6 changed files with 12 additions and 27 deletions

View File

@ -1,8 +1,7 @@
import cadquery as cq import cadquery as cq
stand_positions = [(0, 0), (58, 0), (58, 49), (0, 49)] stand_positions = [(0, 0), (58, 0), (58, 49), (0, 49)]
lower_stands = cq.Sketch().push(stand_positions).circle(3, mode="a") stands = cq.Sketch().push(stand_positions).circle(3, mode="a").circle(2.65 / 2, mode="s")
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 # Holes for the battery power cable and button
@ -10,24 +9,24 @@ power_in = cq.Sketch().trapezoid(10, 5.5, 90, mode="a")
power_in_offset_x = 15 power_in_offset_x = 15
power_in_offset_y = -1 power_in_offset_y = -1
button_offset_x = 67 button_offset_x = 67
button_offset_y = 5 button_offset_y = 5.5
power_button_cut = cq.Sketch().trapezoid(7, 7, 90, mode="a") 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 = [(3.5, 0), (4 * 2.54 + 3.5, 0)]
pin_holder_width = 25 pin_holder_width = 25
pin_holder_height = 15 pin_holder_height = 15
pin_holder = ( pin_holder = (
cq.Sketch() cq.Sketch()
.polygon( .polygon(
[ [
(0, 0), (0.5, 0),
(pin_holder_width, 0), (pin_holder_width, 0),
(pin_holder_width, pin_holder_height), (pin_holder_width, pin_holder_height),
(0, pin_holder_height), (0, pin_holder_height),
(0, 0), (0.5, 0),
], ],
mode="a", mode="a",
) )

View File

@ -2,6 +2,5 @@ import cadquery as cq
cpu_stand_positions = [(0, 0), (23, 0), (23, 58), (0, 58)] cpu_stand_positions = [(0, 0), (23, 0), (23, 58), (0, 58)]
lower_stands = cq.Sketch().push(cpu_stand_positions).circle(3, mode="a") stands = cq.Sketch().push(cpu_stand_positions).circle(3, mode="a").circle(2.65 / 2, mode="s")
pillar_height = 7
higher_stands = cq.Sketch().push(cpu_stand_positions).circle(2.65 / 2, mode="a")

Binary file not shown.

Binary file not shown.

View File

@ -188,31 +188,18 @@ def model():
.placeSketch(screw_holes) .placeSketch(screw_holes)
# 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
.workplaneFromTagged("mid_height") .workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox") .workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")
.center(width / 2 - cpu_offset_x, height / 2 - cpu_offset_y) .center(width / 2 - cpu_offset_x, height / 2 - cpu_offset_y)
.placeSketch(cpu_holder.lower_stands) .placeSketch(cpu_holder.stands)
.extrude(7) .extrude(cpu_holder.pillar_height)
# CPU Stands (higher) # Battery Stands
.workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")
.center(width / 2 - cpu_offset_x, height / 2 - cpu_offset_y)
.placeSketch(cpu_holder.higher_stands)
.extrude(10.5)
# Battery Stands (lower)
# 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 + battery_offset_x, height / 2 - battery_offset_y) .center(-width / 2 + battery_offset_x, height / 2 - battery_offset_y)
.placeSketch(battery_holder.lower_stands) .placeSketch(battery_holder.stands)
.extrude(shell_t + battery_holder.pillar_height) .extrude(shell_t + battery_holder.pillar_height)
# Battery Stands (higher)
.workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")
.center(-width / 2 + battery_offset_x, height / 2 - battery_offset_y)
.placeSketch(battery_holder.higher_stands)
.extrude(shell_t + battery_holder.pillar_height + 3.5)
# Pogo pin connector holders # Pogo pin connector holders
.workplaneFromTagged("mid_height") .workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox") .workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")

Binary file not shown.