Subzero Labs

Free code · Subzero Labs

Ava's home-remote case code (build123d)

From the Subzero Labs video Setting Up Bambu Lab P2S for My Local AI.

Free, no sign-up. Copy it, use it, share it.

case_v3.py

from build123d import *

# 1. Shell base
shell = Pos(0.4, 0, 0) * fillet(Box(71.2, 36.0, 34.5).edges(), radius=3) - Pos(0.4, 0, 0) * Box(67.2, 32.0, 30.5)

# 2. Split at z = 0
front = shell & Pos(0, 0, 50) * Box(200, 200, 100)
back = shell & Pos(0, 0, -50) * Box(200, 200, 100)

# 3. Tongue on FRONT half (inner ring)
front = front + (Pos(0.4, 0, -1.0) * Box(69.2, 34.0, 2.0) - Pos(0.4, 0, 0) * Box(67.2, 32.0, 30.5))

# 4. Groove in BACK half
back = back - Pos(0.4, 0, -1.1) * Box(69.6, 34.4, 2.2)

# 7. Port notch on -Y side (cut from BOTH halves)
front = front - Pos(0.5, -17.0, 2.75) * Box(55, 8, 9.5)
back = back - Pos(0.5, -17.0, 2.75) * Box(55, 8, 9.5)

# 8. SD-card notch at -X end (cut from BOTH halves)
front = front - Pos(-34.2, 0, 5.25) * Box(8, 16, 4)
back = back - Pos(-34.2, 0, 5.25) * Box(8, 16, 4)

# 9. Talk button slits (front half only)
front = front - Pos(3.6, -17.0, 10.25) * Box(0.8, 6, 5.5)
front = front - Pos(15.6, -17.0, 10.25) * Box(0.8, 6, 5.5)

# 10. Thin the tab on the outside (front half only)
front = front - Pos(9.6, -17.6, 10.25) * Box(11.2, 0.8, 5.5)

# 11. Pusher on the inside of the tab (front half only)
front = front + Pos(9.6, -15.8, 8.5) * Box(9.0, 0.4, 3.0)

# Extra: Window over screen (replaces step 5)
prof = Rectangle(33.0, 28.0)
prof = fillet(prof.vertices().group_by(Axis.X)[0], 3.9)
prof = fillet(prof.vertices().group_by(Axis.X)[-1], 1.4)
front = front - Pos(6.25, 0, 14.0) * extrude(prof, 4.0) - Pos(6.25, 0, 16.05) * extrude(prof, 1.2, taper=-45)

# 6. Back vents (back half only)
for y in [-8, -4, 0, 4, 8]:
    back = back - Pos(0, y, -17.25) * Box(40, 2.0, 6)

export_stl(front, "case_v3_front.stl")
export_stl(back, "case_v3_back.stl")
print(front.bounding_box().size)
print(back.bounding_box().size)

code

build123d code for the two-half Pi Zero 2 W + Whisplay HAT + PiSugar 3 case: shell, split, tongue + groove, port and SD notches, flex talk button, rounded bevelled screen window, back vents

Shared as shown in the video. Replace any <PLACEHOLDERS> with your own values.