case: tune the overhang radius

This commit is contained in:
2023-12-27 02:24:26 +00:00
parent aa57d262e2
commit e248d2013e

View File

@@ -7,7 +7,8 @@ overhang_leftright = 2
overhang_top = 2
overhang_bot = 3.5
# how much to smooth the overhangs, else the main opening in front appears rectangular
overhang_radius = 2
# if set to the body radius minus the overhang, then this will appear perfectly symmetric with the body fillet itself.
overhang_radius = 6.6
def _makeShell(solid, thickness: float=1, combine=False, **kwargs):
"""
@@ -35,11 +36,10 @@ def front_cutaway(case):
# N.B.: i think this logic isn't 100% correct
return front_face_cutaway.faces("|Z").each(lambda f: f.thicken(-thickness), combine=False) \
.edges("|Z").fillet(overhang_radius)
# front_cutaway = front_face_cutaway.faces("|Z").each(lambda f: f.thicken(thickness).translate((0, 0, -thickness)), combine=False)
# return front_face_cutaway.faces("|Z").each(lambda f: f.thicken(thickness).translate((0, 0, -thickness)), combine=False)
def case(phone):
# the entire case, before cutting anything away:
case = _makeShell(phone.solids(tag="body"), thickness)
case = case.cut(front_cutaway(case))
# TODO: compress the case along the Z axis, to give a snugger fit (0.8mm is a good compression)