Make screen_pillars more parametric

This commit is contained in:
2023-04-15 19:41:26 -03:00
parent e015585a8b
commit ea06783e66
8 changed files with 21 additions and 5 deletions

View File

@ -4,6 +4,13 @@ import cadquery as cq
elements = None
bottom_holes = None
# These are set from dimensions.py
pillar_width = 0
pillar_height = 0
screw_head_radius = 0
screw_head_depth = 0
screw_radius = 0
def init(positions, thickness):
"""Because these need to match in multiple models, we create the
@ -13,7 +20,9 @@ def init(positions, thickness):
{
"x": 0,
"y": 0,
"shape": cq.Sketch().push(positions).trapezoid(12, 12, 90, mode="a"),
"shape": cq.Sketch()
.push(positions)
.trapezoid(pillar_width, pillar_height, 90, mode="a"),
"height": thickness,
}
]
@ -22,13 +31,13 @@ def init(positions, thickness):
{
"x": 0,
"y": 0,
"shape": cq.Sketch().push(positions).circle(3, mode="a"),
"depth": thickness - 13, # (screw thread length - threaded insert depth)
"shape": cq.Sketch().push(positions).circle(screw_head_radius, mode="a"),
"depth": screw_head_depth
},
{
"x": 0,
"y": 0,
"shape": cq.Sketch().push(positions).circle(1.8, mode="a"),
"shape": cq.Sketch().push(positions).circle(screw_radius, mode="a"),
"depth": 100,
},
]