Files
solidPythonTesting/bracket.py

35 lines
718 B
Python

import solid2
extra_space = 10
slop = 0.5
screen_height = 87
screen_width = 155
screen_depth = 3
pi_height = 56
pi_width = 85
pi_depth = 16
def padded(num: int) -> int:
return num + (2 * extra_space)
base = (
solid2.cube(padded(screen_height), padded(screen_width), screen_depth + 1)
.difference()(
solid2.cube(
screen_height + slop, screen_width + slop, screen_depth + 1
).translate(extra_space, extra_space, -1)
)
.difference()(
solid2.cube(pi_height + slop, pi_width + slop, 50).translate(
padded(screen_height) / 2 - pi_height / 2,
padded(screen_width) / 2 - pi_width / 2,
-2,
)
)
)
base.save_as_scad()