Generate SVG top view, adjust some dimensions

This commit is contained in:
Roberto Alsina 2023-03-31 15:25:03 -03:00
parent 86a2686f66
commit a240a31fd2

View File

@ -5,9 +5,8 @@ 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_top = 8
m4_bottom = 4
m4_height = 2.5
lip_thickness = 1.5
@ -45,12 +44,12 @@ def model():
model = (
model.faces(">Z")
.workplane(centerOption="CenterOfBoundBox")
.center(-width / 2 + position[0], height / 2 - position[1])
.center(-width / 2 + position[0], height / 2 - position[1] - shell_t)
.placeSketch(cq.Sketch().circle(6))
.extrude(-thickness)
.faces(">Z")
.workplane(centerOption="CenterOfBoundBox")
.center(-width / 2 + position[0], height / 2 - position[1])
.center(-width / 2 + position[0], height / 2 - position[1] - shell_t)
.cskHole(m4_bottom, m4_top, 82, depth=None)
)
@ -72,6 +71,14 @@ if __name__ == "__main__":
model = model()
exporters.export(model, "lid.stl")
exporters.export(
model,
"lid.svg",
opt={
"projectionDir": (0, 0, 1),
},
)
exporters.export(
model.faces(">X").workplane(offset=-width / 2).split(keepTop=True),
"right_side_lid.stl",