Compare commits

1 Commits

22 changed files with 53356 additions and 576 deletions

View File

@@ -1,16 +0,0 @@
# Hole to expose a USB audio card (YMMV)
# The hole is for a USB-A plug, y is measured in the hub
# (from the bottom face to middle of the hole)
# Consumers should set proper offsets for the hole
holes = [
# 2-jack plug
{
"x": 0,
"y": 4,
"height": 6,
"width": 17,
"fillet": 2,
},
]

View File

@@ -1,166 +0,0 @@
import cadquery as cq
from utils import extrude_shape, punch_hole, punch_hole2
stand_positions = [(3.5, 3.5), (61.5, 3.5), (61.5, 52.5), (3.5, 52.5)]
stands = (
cq.Sketch().push(stand_positions).circle(3, mode="a").circle(2.65 / 2, mode="s")
)
pillar_height = 7
width = 85
height = 56
# This is a holder for DuPont cables so they connect to this
# things' pogo pins which are used to power the CPU
pin_positions = [(3.5, 0), (4 * 2.54 + 3.5, 0)]
pin_holder_width = 25
pin_holder_height = 15
pin_holder = (
cq.Sketch()
.polygon(
[
(0.5, 0),
(pin_holder_width, 0),
(pin_holder_width, pin_holder_height),
(0, pin_holder_height),
(0.5, 0),
],
mode="a",
)
.push(pin_positions)
.polygon(
[(0, 0), (2.6, 0), (2.6, pin_holder_height), (0, pin_holder_height), (0, 0)],
mode="s",
)
)
elements = [
# Battery holder stands
{
"x": 0,
"y": 0,
"shape": stands,
"height": pillar_height,
},
{
"x": 0,
"y": 0,
"shape": cq.Sketch().push(stand_positions).circle(5),
"height": 0,
},
# Pogo pin connector channels
{
"x": 3.5,
"y": 43.5,
"shape": pin_holder,
"height": 3,
},
# Perimeter
{
"x": width / 2,
"y": height / 2,
"shape": (
cq.Sketch()
.trapezoid(width, height, 90, mode="a")
.trapezoid(width - 2, height - 2, 90, mode="s")
.vertices()
.fillet(3)
),
"height": 0.2,
},
]
hex_size = 6
vent_positions = []
for x in range(1, width // hex_size):
for y in range(1, int(height // hex_size / 0.8)):
vent_positions.append(
(
(x + (y % 2) / 2) * hex_size - hex_size * 0.2,
y * hex_size * 0.8 + hex_size * 0.2,
)
)
vents = [
{
"x": 0,
"y": 0,
"shape": cq.Sketch().push(vent_positions).regularPolygon((hex_size) / 2, 6),
}
]
# Hole distances are relative to the rightmost pillar
# seen from the back of the case, that's why they are negative
# Heights are relative to base of pillars
# All distances are measured to the CENTER of the hole
holes = [
# Power inlet
{
"x": -15,
"y": -1 + pillar_height,
"shape": cq.Sketch().trapezoid(12, 6.5, 90, mode="a").vertices().fillet(1),
},
# Power button
{
"x": -67,
"y": 5.5 + pillar_height,
"shape": cq.Sketch().trapezoid(7, 7, 90, mode="a").vertices().fillet(1),
},
]
def add(
*,
model,
width,
height,
thickness,
offset_x,
offset_y,
bottom_face,
back_face,
shell_t
):
# Vents
for vent in vents:
model = punch_hole2(
model=model,
face=bottom_face,
w=width,
h=height,
x_offset=offset_x + vent["x"],
y_offset=shell_t + offset_y + vent["y"],
hole=vent,
depth=shell_t,
)
# Battery holder stands and pogo pin holder
for element in elements:
model = extrude_shape(
model=model,
face=bottom_face,
w=width,
h=height,
x_offset=offset_x + element["x"],
y_offset=shell_t + offset_y + element["y"],
shape=element["shape"],
height=-(element["height"] + shell_t),
)
# Holes
for hole in holes:
model = punch_hole2(
model=model,
face=back_face,
w=width,
h=thickness,
x_offset=width - offset_x,
y_offset=shell_t,
hole=hole,
depth=shell_t,
)
return model

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,28 @@
import cadquery2 as cq
from cadquery2 import exporters
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")
)
model = (
cq.Workplane("XY")
.workplane()
.box(75, 40, 2)
.edges("+Z")
.fillet(3)
.faces(">Z")
.workplane(centerOption="CenterOfBoundBox")
.center(-29, -11.5)
.placeSketch(lower_stands)
.extrude(4)
.workplane()
.placeSketch(higher_stands)
.extrude(9)
)
exporters.export(model, "cpu_holder.stl")

31894
notebook_nueva/cpu_holder.stl Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,11 +1,5 @@
import cadquery as cq import cadquery2 as cq
from cadquery import exporters from cadquery2 import exporters
import audio_plug
import battery_holder
import usb_hub
import zero_holder as cpu_holder
from utils import extrude_shape, punch_hole, punch_hole2
# Base for the notebook. Basically a kbd base that extends back # Base for the notebook. Basically a kbd base that extends back
# as much as possible # as much as possible
@@ -14,48 +8,36 @@ from utils import extrude_shape, punch_hole, punch_hole2
shell_t = 3 shell_t = 3
# Size of the kbd board # Size of the kbd board
kbd_height = 95.5 kbd_height = 98
kbd_width = 305 kbd_width = 286
kbd_angle = 5 kbd_angle = 5
# Size of the whole object # Size of the whole object
width = kbd_width + 2 * shell_t width = kbd_width + 2 * shell_t
height = 159 height = 164 # Max bed size
thickness = 27 + shell_t # 27 inside thickness = 20 + shell_t # 20 inside
# Insert Positions # Insert Positions
ti_radius = 2.35 ti_radius = 2.35
ti_depth = 6.25 ti_depth = 6.25
# Positions are determined by measuring the keyboard # Positions are determined by measuring the keyboard
# mounting holes
kbd_pillar_positions = [
(18.25, -16),
(142.5, -25.5),
(kbd_width - 20, -16),
(23.5, -79.5),
(145.5, -82.5),
(kbd_width - 19, -79.5),
]
# 2-level mounting pillars for the kbd
# Width of these need to be tweaked for
# each specific keyboard
kbd_pillars = ( kbd_pillars = (
cq.Sketch() cq.Sketch()
.push(kbd_pillar_positions) .push(
.circle(2.2, mode="a") [
# Holes for self-tapping screws (19, -16.5),
.circle(1.1, mode="s") (133, -16.5),
) (247.5, -16.5),
(24, -86),
kbd_lower_pillars = ( (142.5, -91),
cq.Sketch() (261.5, -86),
.push(kbd_pillar_positions) ]
.circle(4, mode="a") )
# Holes for self-tapping screws .circle(6, mode="a")
.circle(1.1, mode="s") # Holes for M3 threaded inserts
.circle(ti_radius, mode="s")
) )
# These are placed where convenient, and are used to join the top and bottom # These are placed where convenient, and are used to join the top and bottom
@@ -63,11 +45,10 @@ kbd_lower_pillars = (
# Measured from top-left corner OUTSIDE # Measured from top-left corner OUTSIDE
mounting_pillar_positions = [ mounting_pillar_positions = [
(6, -6), (6, -6),
(6, -40), (width - 6, -6),
(width - 6, -40),
(120, -6), (120, -6),
(170, -6), (170, -6),
(width - 6, -6),
(width - 6, -30),
] ]
mounting_pillars = ( mounting_pillars = (
@@ -79,30 +60,36 @@ mounting_pillars = (
screw_holes = cq.Sketch().push(mounting_pillar_positions).circle(3, mode="a") screw_holes = cq.Sketch().push(mounting_pillar_positions).circle(3, mode="a")
# Thing to "grab" the hub so it stays in place battery_holder = (
# Distance from edge to center of USB plug cq.Sketch()
usb_offset = 48 .polygon(
[(-67, 5), (0, 5), (0, -12), (-67, -12), (-67, 5)],
mode="a",
)
.trapezoid(83, 83, 90, mode="a")
.trapezoid(80, 80, 90, mode="s")
.polygon(
[(-67, 3), (0, 3), (0, -10), (-67, -10), (-67, 3)],
mode="s",
)
# Cutout for the
.polygon(
[(-67, 30), (0, 30), (0, 12), (-67, 12), (-67, 30)],
mode="s",
)
)
# CPU holder position from back-left corner of the case power_in = cq.Sketch().circle(5, mode="a")
cpu_offset_x = 160 usb_in = cq.Sketch().trapezoid(13, 5.5, 90, mode="a")
cpu_offset_y = 25 switch_in = cq.Sketch().trapezoid(13.5, 8, 90, mode="a")
# Battery holder position from back-left corner of the case
battery_offset_x = 19
battery_offset_y = 5
# Offset for the USB port from back-right corner of the case # Motherboard mount
usb_offset = 48
def model(): def model():
# Create the basic shape of the case bottom. return (
# Currently also adds keyboard stuff and things to connect
# to the screen case, but that should be refactored
# out (FIXME)
model = (
cq.Workplane("XY") cq.Workplane("XY")
.workplane(offset=thickness / 2) .workplane(offset=thickness / 2)
.tag("mid_height") .tag("mid_height")
@@ -112,22 +99,38 @@ def model():
.fillet(2) .fillet(2)
.faces(">Z") .faces(">Z")
.shell(-shell_t) .shell(-shell_t)
# Battery holder
.workplaneFromTagged("mid_height")
.center(-width / 2 + shell_t + 65, height / 2 - shell_t - 45)
.placeSketch(battery_holder)
.extrude(-height / 2)
# Power cable inlet
.faces("<X")
.workplane(centerOption="CenterOfBoundBox")
.center(-height / 2 + shell_t + 48.5, -3)
.placeSketch(power_in)
.cutBlind(-shell_t)
# USB inlet
.faces(">X")
.workplane(centerOption="CenterOfBoundBox")
.center(-height / 2 + shell_t + 50, -5)
.placeSketch(usb_in)
.cutBlind(-shell_t)
# Hole for power switch
.faces(">Y")
.workplane(centerOption="CenterOfBoundBox")
.center(0, 0)
.placeSketch(switch_in)
.cutBlind(-shell_t)
# Slanted mounting pillars on the kbd top # Slanted mounting pillars on the kbd top
.faces(">Z") .faces(">Z")
.workplane(centerOption="CenterOfBoundBox") .workplane(centerOption="CenterOfBoundBox")
# Top-left kbd corner inside the box # Top-left kbd corner inside the box
.center(-width / 2 + shell_t, kbd_height - height / 2 + shell_t) .center(-width / 2 + shell_t, kbd_height - height / 2 + shell_t)
.transformed(rotate=cq.Vector(kbd_angle, 0, 0)) .transformed(rotate=cq.Vector(kbd_angle, 0, 0))
# These two offsets push the keyboard "down" into the case
# and need to be adjusted per-keyboard
.tag("sloped") .tag("sloped")
.workplane(offset=-2.5)
.placeSketch(kbd_pillars) .placeSketch(kbd_pillars)
.extrude(-1000) .extrude(-1000)
.workplaneFromTagged("sloped")
.workplane(offset=-5.5)
.placeSketch(kbd_lower_pillars)
.extrude(-1000)
# Remove the excess extrusion # Remove the excess extrusion
.workplaneFromTagged("mid_height") .workplaneFromTagged("mid_height")
.transformed(offset=cq.Vector(0, 0, -thickness / 2)) .transformed(offset=cq.Vector(0, 0, -thickness / 2))
@@ -150,80 +153,11 @@ def model():
.cutBlind(thickness - 13) .cutBlind(thickness - 13)
) )
# Now the basic box shape is in place, start adding things
# and cutting holes.
# Hole for USB hub in the back
for hole in usb_hub.holes:
model = punch_hole(
model=model,
face=">Y",
w=width,
h=thickness,
x_offset=usb_offset + shell_t + usb_hub.holes[0]["width"] / 2,
y_offset=shell_t,
hole=hole,
depth=shell_t,
)
# USB hub holder
for element in usb_hub.elements:
model = extrude_shape(
model=model,
face="<Z",
w=width,
h=height,
x_offset=width - usb_offset - shell_t - +usb_hub.holes[0]["width"] / 2,
y_offset=shell_t + element["y"],
shape=element["shape"],
height=-(element["height"] + shell_t),
)
# Hole for audio in right side
for hole in audio_plug.holes:
model = punch_hole(
model=model,
face=">X",
w=height,
h=thickness,
x_offset=height - shell_t - 34.5 - audio_plug.holes[0]["width"] / 2,
y_offset=shell_t,
hole=hole,
depth=shell_t,
)
model = cpu_holder.add(
model=model,
width=width,
height=height,
thickness=thickness,
offset_x=cpu_offset_x,
offset_y=cpu_offset_y,
bottom_face="<Z",
back_face=None,
shell_t=shell_t,
)
# This adds all the holes and extrusions for the battery system
model = battery_holder.add(
model=model,
width=width,
height=height,
thickness=thickness,
offset_x=battery_offset_x,
offset_y=battery_offset_y,
bottom_face="<Z",
back_face=">Y",
shell_t=shell_t,
)
return model
if __name__ == "__main__": if __name__ == "__main__":
left_cutout = cq.Sketch().polygon( left_cutout = cq.Sketch().polygon(
[(0, 0), (width / 2, 0), (width / 2, -height), (0, -height), (0, 0)], [(0, 0), (160, 0), (160, -100), (135, -100), (135, -200), (0, -200), (0, 0)],
mode="a", mode="a",
) )
@@ -241,11 +175,13 @@ if __name__ == "__main__":
right_cutout = cq.Sketch().polygon( right_cutout = cq.Sketch().polygon(
[ [
(width / 2, 0), (160, 0),
(width, 0), (width, 0),
(width, -height), (width, -height),
(width / 2, -height), (135, -height),
(width / 2, 0), (135, -100),
(160, -100),
(160, 0),
], ],
mode="a", mode="a",
) )

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
import cadquery as cq import cadquery2 as cq
from cadquery import exporters from cadquery2 import exporters
from modelo import ( from modelo import (
kbd_height, kbd_height,
@@ -10,16 +10,17 @@ from modelo import (
ti_radius, ti_radius,
) )
ti_radius = 2.5
# Size of the whole object # Size of the whole object
width = kbd_width + 2 * shell_t width = kbd_width + 2 * shell_t
height = 66 height = 59
height_bottom = 59 thickness = 62 # Will be shorter after construction
thickness = 48 # Will be shorter after construction
# Visible screen size # Visible screen size
vis_w = 219 vis_w = 220
vis_h = 55 vis_h = 58
viewport_cutout = cq.Sketch().trapezoid(vis_w, vis_h, 90, mode="a").vertices().fillet(2) viewport_cutout = cq.Sketch().trapezoid(vis_w, vis_h, 90, mode="a")
# Whole screen size # Whole screen size
scr_w = 231 scr_w = 231
@@ -27,9 +28,6 @@ scr_h = 65
scr_thickness = 5.5 scr_thickness = 5.5
screen_cutout = cq.Sketch().trapezoid(scr_w, scr_h, 90, mode="a") screen_cutout = cq.Sketch().trapezoid(scr_w, scr_h, 90, mode="a")
# Screen angle
scr_angle = 20
# Circuit board and cable hole. # Circuit board and cable hole.
# This is in the back of the screen, and is a bit shorter in height than the # This is in the back of the screen, and is a bit shorter in height than the
# screen. It's wider so it removes enough material to make the shape simpler. # screen. It's wider so it removes enough material to make the shape simpler.
@@ -40,14 +38,13 @@ board_cutout = cq.Sketch().trapezoid(
mode="a", mode="a",
) )
kbd_cable_hole = cq.Sketch().trapezoid(20, 9, 90, mode="a").vertices().fillet(1) kbd_cable_hole = cq.Sketch().trapezoid(15, 5, 90, mode="a").vertices().fillet(1)
mounting_pillars = ( mounting_pillars = (
cq.Sketch() cq.Sketch()
.polygon([(0, 0), (width, 0), (width, -12), (0, -12), (0, 0)], mode="a")
.push(mounting_pillar_positions) .push(mounting_pillar_positions)
.trapezoid(-12, 12, 90, mode="a")
.circle(ti_radius, mode="s") .circle(ti_radius, mode="s")
.clean()
) )
@@ -57,9 +54,9 @@ def model():
.workplane() .workplane()
.tag("mid_height") .tag("mid_height")
.box(width, height, thickness) .box(width, height, thickness)
# The screen goes rotated # The screen goes at a 45 degree angle
.faces(">Z") .faces(">Z")
.transformed(rotate=(scr_angle, 0, 0)) .transformed(rotate=(45, 0, 0))
# Move the screen "lower" so it doesn't interfere # Move the screen "lower" so it doesn't interfere
# so much with the back # so much with the back
.center(0, -2) .center(0, -2)
@@ -68,35 +65,6 @@ def model():
# of the inclined screen # of the inclined screen
.placeSketch(cq.Sketch().trapezoid(1000, 1000, 90, mode="a")) .placeSketch(cq.Sketch().trapezoid(1000, 1000, 90, mode="a"))
.cutBlind(1000) .cutBlind(1000)
# Trim the top
.workplaneFromTagged("mid_height")
.workplane(offset=21)
.placeSketch(cq.Sketch().trapezoid(1000, 1000, 90, mode="a"))
.cutBlind(100)
# Make bottom smaller to fit with base
.faces(">X")
.workplane(centerOption="CenterOfBoundBox")
.center(-height / 2, -thickness / 2)
.placeSketch(
cq.Sketch()
.polygon(
[
(height_bottom, 0),
(height_bottom, thickness / 3),
(height, thickness - 21),
(height, thickness),
(height + 5, thickness + 5),
(height + 5, 0),
(height_bottom, 0),
]
)
.vertices()
.fillet(3)
)
.cutBlind(-1000)
# Fillet top of the object
.edges("|X and >Z")
.fillet(3)
# Cut off viewport hole so we can see the screen # Cut off viewport hole so we can see the screen
.workplaneFromTagged("slanted") .workplaneFromTagged("slanted")
.placeSketch(viewport_cutout) .placeSketch(viewport_cutout)
@@ -108,6 +76,11 @@ def model():
.center(-3, 0) .center(-3, 0)
.placeSketch(screen_cutout) .placeSketch(screen_cutout)
.cutBlind(-scr_thickness) .cutBlind(-scr_thickness)
# Trim the top
.workplaneFromTagged("mid_height")
.workplane(offset=21)
.placeSketch(cq.Sketch().trapezoid(1000, 1000, 90, mode="a"))
.cutBlind(100)
# Make it hollow # Make it hollow
.faces("<Z") .faces("<Z")
# Can't be exactly shell_t because cq fails # Can't be exactly shell_t because cq fails
@@ -117,38 +90,44 @@ def model():
.workplane(offset=-scr_thickness, centerOption="CenterOfBoundBox") .workplane(offset=-scr_thickness, centerOption="CenterOfBoundBox")
.placeSketch(board_cutout) .placeSketch(board_cutout)
.cutBlind(-6) .cutBlind(-6)
# Fillet top of the object
.edges(">Z and |X")
.fillet(5)
# Make small hole for the keyboard cable
.faces(">Y")
.workplane(offset=-5, centerOption="CenterOfBoundBox")
.center(-width / 2 + 128, -23)
.placeSketch(kbd_cable_hole)
.cutBlind(-1000)
# Pillars to join with bottom half
.workplaneFromTagged("mid_height") .workplaneFromTagged("mid_height")
.workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox") .workplane(offset=-thickness / 2, centerOption="CenterOfBoundBox")
.center(-width / 2, height_bottom - height / 2) .center(-width / 2, height / 2)
.placeSketch(mounting_pillars) .placeSketch(mounting_pillars)
.extrude(10) .extrude(10)
# Fillet the front edge of the screen case so it looks softer
.edges(">(0, -10, 5)")
.fillet(2)
) )
if __name__ == "__main__": exporters.export(model(), "screen_mount.stl")
print("Exporting") split_offset = -133
exporters.export(model(), "screen_mount.stl")
offset_width = -width / 2 right_side = (
model()
.faces(">X")
.workplane(centerOption="CenterOfBoundBox", offset=split_offset)
.center(0, height / 2)
.split(keepTop=True)
)
right_side = ( exporters.export(right_side, "right_screen_mount.stl")
model()
.faces(">X")
.workplane(centerOption="CenterOfBoundBox", offset=offset_width)
.split(keepTop=True)
)
exporters.export(right_side, "right_screen_mount.stl") left_side = (
model()
.faces(">X")
.workplane(centerOption="CenterOfBoundBox", offset=split_offset)
.center(0, height / 2)
.split(keepBottom=True)
)
left_side = ( exporters.export(left_side, "left_screen_mount.stl")
model()
.faces(">X")
.workplane(centerOption="CenterOfBoundBox", offset=offset_width)
.split(keepBottom=True)
)
exporters.export(left_side, "left_screen_mount.stl")

Binary file not shown.

View File

@@ -1,33 +0,0 @@
import cadquery as cq
# Measurements for my USB hub, YMMV
# The hole is for a USB-A plug, y is measured in the hub
# (from the bottom face to middle of the hole)
# Consumers should set proper offsets for the hole
holes = [
# USB-A port
{
"x": 0,
"y": 4,
"height": 5.5,
"width": 13,
"fillet": 2,
},
]
elements = [
# Thing to grab the hub
{
"x": 0,
"y": 5,
"shape": (
cq.Sketch()
.trapezoid(22, 10, 90, mode="a")
.trapezoid(17, 10, 90, mode="s")
.clean()
),
"height": 8,
}
]

View File

@@ -1,36 +0,0 @@
import cadquery as cq
# TODO make API of extrude_shape and punch_hole more consistent
def extrude_shape(*, model, face, w, h, x_offset, y_offset, shape, height):
return (
model.faces(face)
.workplane(centerOption="CenterOfBoundBox")
.center(-w / 2 + x_offset, -h / 2 + y_offset)
.placeSketch(shape)
.extrude(height)
)
def punch_hole(*, model, face, w, h, x_offset, y_offset, hole, depth):
return (
model.faces(face)
.workplane(centerOption="CenterOfBoundBox")
.center(-w / 2 + x_offset + hole["x"], -h / 2 + y_offset + hole["y"])
.placeSketch(
cq.Sketch()
.trapezoid(hole["width"], hole["height"], 90, mode="a")
.vertices()
.fillet(hole["fillet"])
)
.cutBlind(-depth)
)
def punch_hole2(*, model, face, w, h, x_offset, y_offset, hole, depth):
return (
model.faces(face)
.workplane(centerOption="CenterOfBoundBox")
.center(-w / 2 + x_offset + hole["x"], -h / 2 + y_offset + hole["y"])
.placeSketch(hole["shape"])
.cutBlind(-depth)
)

View File

@@ -1,118 +0,0 @@
import cadquery as cq
from utils import extrude_shape, punch_hole2
width = 65
height = 30
pillar_height = 7
stand_positions = [(3.5, 3.5), (3.5, 26.5), (61.5, 26.5), (61.5, 3.5)]
stands = (
cq.Sketch().push(stand_positions).circle(3, mode="a").circle(2.65 / 2, mode="s")
)
elements = [
# CPU holder stands
{
"x": 0,
"y": 0,
"shape": stands,
"height": pillar_height,
},
{
"x": 0,
"y": 0,
"shape": cq.Sketch().push(stand_positions).circle(5),
"height": 0,
},
# Perimeter
{
"x": width / 2,
"y": height / 2,
"shape": (
cq.Sketch()
.trapezoid(width, height, 90, mode="a")
.trapezoid(width - 2, height - 2, 90, mode="s")
.vertices()
.fillet(3)
),
"height": 0.2,
},
]
hex_size = 6
vent_positions = []
for x in range(1, width // hex_size):
for y in range(1, int(height // hex_size / 0.8)):
vent_positions.append(
(
(x + (y % 2) / 2) * hex_size - hex_size * 0.2,
y * hex_size * 0.8 + hex_size * 0.2,
)
)
vents = [
{
"x": 0,
"y": 0,
"shape": cq.Sketch().push(vent_positions).regularPolygon((hex_size) / 2, 6),
}
]
holes = [] # TODO
def add(
*,
model,
width,
height,
thickness,
offset_x,
offset_y,
bottom_face,
back_face,
shell_t
):
# Vents
for vent in vents:
model = punch_hole2(
model=model,
face=bottom_face,
w=width,
h=height,
x_offset=offset_x + vent["x"],
y_offset=shell_t + offset_y + vent["y"],
hole=vent,
depth=shell_t,
)
# CPU holder extrusions
for element in elements:
model = extrude_shape(
model=model,
face=bottom_face,
w=width,
h=height,
x_offset=offset_x + element["x"],
y_offset=shell_t + offset_y + element["y"],
shape=element["shape"],
height=-(element["height"] + shell_t),
)
# Holes
for hole in holes:
model = punch_hole2(
model=model,
face=back_face,
w=width,
h=thickness,
x_offset=width - offset_x,
y_offset=shell_t,
hole=hole,
depth=shell_t,
)
return model

View File

@@ -1 +1 @@
cadquery2 cadquery