Compare commits
3 Commits
0335944118
...
445cb1caeb
Author | SHA1 | Date | |
---|---|---|---|
445cb1caeb | |||
56c880ffe8 | |||
1b17c1e585 |
@ -90,8 +90,9 @@ def add(
|
|||||||
cq.Sketch().polygon(
|
cq.Sketch().polygon(
|
||||||
[
|
[
|
||||||
[0, front_thickness],
|
[0, front_thickness],
|
||||||
[actual_height, back_thickness],
|
[shell_t, front_thickness],
|
||||||
[actual_height, 1000],
|
[actual_height + shell_t, back_thickness],
|
||||||
|
[actual_height + shell_t, 1000],
|
||||||
[0, 1000],
|
[0, 1000],
|
||||||
[0, front_thickness],
|
[0, front_thickness],
|
||||||
]
|
]
|
||||||
|
BIN
notebook_nueva/left_side_lid.stl
Normal file
BIN
notebook_nueva/left_side_lid.stl
Normal file
Binary file not shown.
82
notebook_nueva/lid.py
Normal file
82
notebook_nueva/lid.py
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import cadquery as cq
|
||||||
|
from cadquery import exporters
|
||||||
|
|
||||||
|
from modelo import mounting_pillar_positions, shell_t, width
|
||||||
|
from utils import hex_vents, punch_hole
|
||||||
|
|
||||||
|
# Dimensions for countersunk M4 screws
|
||||||
|
m4_top = 7.5
|
||||||
|
m4_bottom = 4
|
||||||
|
m4_height = 2.5
|
||||||
|
|
||||||
|
|
||||||
|
lip_thickness = 1.5
|
||||||
|
# Position of pillar + shell_t + pillar "radius" + lip
|
||||||
|
height = max([y for _, y in mounting_pillar_positions]) + 6 + shell_t + lip_thickness
|
||||||
|
thickness = shell_t
|
||||||
|
front_lip = 8
|
||||||
|
|
||||||
|
|
||||||
|
def model():
|
||||||
|
# Create the basic shape of the case bottom.
|
||||||
|
model = (
|
||||||
|
cq.Workplane("XY")
|
||||||
|
# Hollow box
|
||||||
|
.box(width, height, thickness)
|
||||||
|
.edges("|Z and >Y")
|
||||||
|
.fillet(2)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Make many holes
|
||||||
|
vent = hex_vents(size=6, width=width * 0.9, height=height * 0.9)[0]
|
||||||
|
model = punch_hole(
|
||||||
|
model=model,
|
||||||
|
face=">Z",
|
||||||
|
w=width,
|
||||||
|
h=height,
|
||||||
|
x_offset=0.05 * width,
|
||||||
|
y_offset=0.05 * height,
|
||||||
|
hole=vent,
|
||||||
|
depth=thickness,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add screw holes
|
||||||
|
for position in mounting_pillar_positions:
|
||||||
|
model = (
|
||||||
|
model.faces(">Z")
|
||||||
|
.workplane(centerOption="CenterOfBoundBox")
|
||||||
|
.center(-width / 2 + position[0], height / 2 - position[1])
|
||||||
|
.placeSketch(cq.Sketch().circle(6))
|
||||||
|
.extrude(-thickness)
|
||||||
|
.faces(">Z")
|
||||||
|
.workplane(centerOption="CenterOfBoundBox")
|
||||||
|
.center(-width / 2 + position[0], height / 2 - position[1])
|
||||||
|
.cskHole(m4_bottom, m4_top, 82, depth=None)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add front lip
|
||||||
|
|
||||||
|
model = (
|
||||||
|
model.faces(">Z")
|
||||||
|
.workplane(centerOption="CenterOfBoundBox")
|
||||||
|
.center(0, -height / 2 + lip_thickness / 2)
|
||||||
|
.placeSketch(cq.Sketch().trapezoid(width - 2 * shell_t, lip_thickness, 90))
|
||||||
|
.extrude(-front_lip - thickness)
|
||||||
|
)
|
||||||
|
|
||||||
|
return model
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
model = model()
|
||||||
|
exporters.export(model, "lid.stl")
|
||||||
|
|
||||||
|
exporters.export(
|
||||||
|
model.faces(">X").workplane(offset=-width / 2).split(keepTop=True),
|
||||||
|
"right_side_lid.stl",
|
||||||
|
)
|
||||||
|
exporters.export(
|
||||||
|
model.faces(">X").workplane(offset=-width / 2).split(keepBottom=True),
|
||||||
|
"left_side_lid.stl",
|
||||||
|
)
|
BIN
notebook_nueva/lid.stl
Normal file
BIN
notebook_nueva/lid.stl
Normal file
Binary file not shown.
BIN
notebook_nueva/right_side_lid.stl
Normal file
BIN
notebook_nueva/right_side_lid.stl
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user