Adjust dimensions of objects, add backstop for USB hub

This commit is contained in:
Roberto Alsina 2023-04-03 14:16:51 -03:00
parent 8cce323574
commit 3ef050bdbb
3 changed files with 29 additions and 19 deletions

View File

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

View File

@ -45,22 +45,19 @@ mounting_pillar_positions = [
] ]
screen_pillars.init(mounting_pillar_positions, thickness - shell_t) screen_pillars.init(mounting_pillar_positions, thickness - shell_t)
# Thing to "grab" the hub so it stays in place # Offset for the USB port from back-left corner
# Distance from left edge to center of USB plug # of the case to left side of the hub
usb_offset = width - 48 usb_offset_x = width - audio_plug.item_w - usb_hub.item_w
# CPU holder position from back-left corner of the case # CPU holder position from back-left corner of the case
cpu_offset_x = 180 cpu_offset_x = 177
cpu_offset_y = 3 cpu_offset_y = 2
# Battery holder position from back-left corner of the case # Battery holder position from back-left corner of the case
battery_offset_x = 15 battery_offset_x = 15
battery_offset_y = 3 battery_offset_y = 3
# Offset for the USB port from back-right corner of the case
usb_offset = 48
def model(): def model():
# Create the basic shape of the case bottom. # Create the basic shape of the case bottom.
@ -86,7 +83,7 @@ def model():
thickness=thickness, thickness=thickness,
bottom_face="<Z", bottom_face="<Z",
back_face=">Y", back_face=">Y",
offset_x=width - usb_offset, offset_x=usb_offset_x,
offset_y=0, offset_y=0,
shell_t=shell_t, 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) # (from the bottom face to middle of the hole)
# Consumers should set proper offsets for the hole # Consumers should set proper offsets for the hole
item_w = 17
item_h = 93
holes = [ holes = [
# USB-A port # USB-A port
{ {
"x": 0, "x": -item_w / 2,
"y": 4, "y": 4,
"shape": cq.Sketch().trapezoid(13, 5, 90, mode="a").vertices().fillet(1), "shape": cq.Sketch().trapezoid(13, 5, 90, mode="a").vertices().fillet(1),
}, },
@ -20,22 +23,33 @@ holes = [
elements = [ elements = [
# Thing to grab the hub # Thing to grab the hub
{ {
"x": 0, "x": item_w / 2,
"y": 5, "y": 5,
"shape": ( "shape": (
cq.Sketch().trapezoid(22, 10, 90, mode="a").trapezoid(17, 10, 90, mode="s") cq.Sketch().trapezoid(22, 10, 90, mode="a").trapezoid(17, 10, 90, mode="s")
), ),
"height": 8, "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 # Outline
{ {
"x": 0, "x": item_w / 2,
"y": 35, "y": item_h / 2,
"shape": ( "shape": (
cq.Sketch() cq.Sketch()
# FIXME: use actual size .trapezoid(item_w, item_h, 90, mode="a")
.trapezoid(17, 70, 90, mode="a") .trapezoid(item_w - 2, item_h - 2, 90, mode="s")
.trapezoid(15, 68, 90, mode="s")
.vertices() .vertices()
.fillet(3) .fillet(3)
), ),