Added hole support for CPU holder
This commit is contained in:
parent
4f1b09ab95
commit
d64654f7b1
@ -124,43 +124,45 @@ def add(
|
||||
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,
|
||||
)
|
||||
if bottom_face:
|
||||
# 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),
|
||||
)
|
||||
# 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,
|
||||
)
|
||||
if back_face:
|
||||
# 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
|
||||
|
@ -200,7 +200,7 @@ def model():
|
||||
offset_x=cpu_offset_x,
|
||||
offset_y=cpu_offset_y,
|
||||
bottom_face="<Z",
|
||||
back_face=None,
|
||||
back_face=None, # Not exposing the holes
|
||||
shell_t=shell_t,
|
||||
)
|
||||
|
||||
|
@ -33,4 +33,4 @@ def punch_hole2(*, model, face, w, h, x_offset, y_offset, hole, depth):
|
||||
.center(-w / 2 + x_offset + hole["x"], -h / 2 + y_offset + hole["y"])
|
||||
.placeSketch(hole["shape"])
|
||||
.cutBlind(-depth)
|
||||
)
|
||||
)
|
@ -60,7 +60,14 @@ vents = [
|
||||
}
|
||||
]
|
||||
|
||||
holes = [] # TODO
|
||||
holes = [
|
||||
# One hole for everything TODO: improve
|
||||
{
|
||||
"x": -width / 2,
|
||||
"y": 1 + pillar_height,
|
||||
"shape": cq.Sketch().trapezoid(50, 6, 90, mode="a").vertices().fillet(1),
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
def add(
|
||||
@ -76,43 +83,45 @@ def add(
|
||||
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,
|
||||
)
|
||||
if bottom_face:
|
||||
# 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),
|
||||
)
|
||||
# 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,
|
||||
)
|
||||
if back_face:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user