Compare commits

...

2 Commits

4 changed files with 31 additions and 21 deletions

View File

@ -7,9 +7,8 @@ from utils import extrude_shape, punch_hole
# The hole is for a random USB sound card.
# Consumers should set proper offsets for the hole
# FIXME: use actual sizes
item_w = 40
item_h = 20
item_w = 49
item_h = 20.5
hole_w = 17
hole_h = 5

View File

@ -5,7 +5,7 @@ from modelo import mounting_pillar_positions, shell_t, width
from utils import hex_vents, punch_hole
# Dimensions for countersunk M4 screws
m4_top = 8
m4_top = 9
m4_bottom = 4
@ -45,7 +45,7 @@ def model():
model.faces(">Z")
.workplane(centerOption="CenterOfBoundBox")
.center(-width / 2 + position[0], height / 2 - position[1] - shell_t)
.placeSketch(cq.Sketch().circle(6))
.placeSketch(cq.Sketch().circle(m4_top / 2 + 1.5))
.extrude(-thickness)
.faces(">Z")
.workplane(centerOption="CenterOfBoundBox")

View File

@ -45,22 +45,19 @@ mounting_pillar_positions = [
]
screen_pillars.init(mounting_pillar_positions, thickness - shell_t)
# Thing to "grab" the hub so it stays in place
# Distance from left edge to center of USB plug
usb_offset = width - 48
# Offset for the USB port from back-left corner
# of the case to left side of the hub
usb_offset_x = width - audio_plug.item_w - usb_hub.item_w
# CPU holder position from back-left corner of the case
cpu_offset_x = 180
cpu_offset_y = 3
cpu_offset_x = 177
cpu_offset_y = 2
# Battery holder position from back-left corner of the case
battery_offset_x = 15
battery_offset_y = 3
# Offset for the USB port from back-right corner of the case
usb_offset = 48
def model():
# Create the basic shape of the case bottom.
@ -86,7 +83,7 @@ def model():
thickness=thickness,
bottom_face="<Z",
back_face=">Y",
offset_x=width - usb_offset,
offset_x=usb_offset_x,
offset_y=0,
shell_t=shell_t,
)

View File

@ -8,10 +8,13 @@ from utils import punch_hole, extrude_shape
# (from the bottom face to middle of the hole)
# Consumers should set proper offsets for the hole
item_w = 17
item_h = 93
holes = [
# USB-A port
{
"x": 0,
"x": -item_w / 2,
"y": 4,
"shape": cq.Sketch().trapezoid(13, 5, 90, mode="a").vertices().fillet(1),
},
@ -20,22 +23,33 @@ holes = [
elements = [
# Thing to grab the hub
{
"x": 0,
"x": item_w / 2,
"y": 5,
"shape": (
cq.Sketch().trapezoid(22, 10, 90, mode="a").trapezoid(17, 10, 90, mode="s")
),
"height": 8,
},
{
"x": item_w / 2 + 5,
"y": item_h - 3,
"shape": (cq.Sketch().circle(2.5, mode="a")),
"height": 8,
},
{
"x": item_w / 2 - 5,
"y": item_h - 3,
"shape": (cq.Sketch().circle(2.5, mode="a")),
"height": 8,
},
# Outline
{
"x": 0,
"y": 35,
"x": item_w / 2,
"y": item_h / 2,
"shape": (
cq.Sketch()
# FIXME: use actual size
.trapezoid(17, 70, 90, mode="a")
.trapezoid(15, 68, 90, mode="s")
.trapezoid(item_w, item_h, 90, mode="a")
.trapezoid(item_w - 2, item_h - 2, 90, mode="s")
.vertices()
.fillet(3)
),