Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .agents/skills/3d-print-modeling/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ Read [fdm-design-principles.md](./references/fdm-design-principles.md) and impor
* **Wide Horizontal Overhead Arches (Print-Flat Horizontal YZ-Dovetail Lock):** Never print a wide semicircular carry arch monolithically over an open hollow vessel. Print the arch **flat on its side at `Z = 0`** (`0.00%` overhang and `5×` stronger continuous-fiber PETG/PLA lifting strength) with `28°–32°` horizontal YZ-dovetail tenons that slide horizontally (`+X → -X`) into twin bark/wall-blended rim buttress pockets (supported below by `<= 38°` ramps)—mechanically pull-out proof under vertical `+Z` lifting loads.
* **Angled Spout / Coupling Stubs & Helical Wedge-Cam Collars:** Elevate stubs to **`>= 48°` above horizontal** (`<= 42°` from vertical), omit `45°` inward tip chamfers (which push the `6 o'clock` bevel past `90°`), and place bayonet lugs at `12`, `4`, and `8` o'clock (`6 o'clock` underside lug-free → `0.00 mm²` overhang). Every bayonet collar or swivel socket **MUST** incorporate a helical wedge-cam clamping ramp (`~10°` draw, `40°–43.6°` inner cam bevel matching the stub lug underside) + positive rotation stop + crush-rib / TPU / rubber seal, verified by **both** `assert_bayonet_cam_lock_action()` (zero-collision entry/lock + active wedge engagement) and **`assert_nut_slides_over_part()`** (`0.000000 mm³` 36-pose kinematic slide-over collision from tip to flange). Avoid bare-PETG multi-link snap hoses below tank waterlines; use monolithic spouts or 1-piece hose-barb adapters for real silicone/vinyl tubing.
* **Watertight Vessel Floor & Hydraulic Passage Integrity Gate (`clip_bore_above_floor` + `assert_watertight_vessel_integrity`):** For any hollow watertight vessel with an angled side-wall bore (watering cans, pitchers, planters, tanks), ALWAYS hard-clip the angled bore cutter strictly above `Z >= floor_thick_mm + 0.5 mm` so a downward-tilted bore can NEVER groove or puncture the tank floor. Programmatically assert BOTH `volume(solid_floor_disk - vessel_body) == 0.000000 mm³` (100% unbroken watertight floor across full interior radius) AND `volume(spout_flow_probe ^ vessel_body) == 0.000000 mm³` (unobstructed water passage into cavity), and visually inspect a top-down interior + bottom-face render before delivery.
14. **Toolless Box Hinges & Latches — Mandatory Extended Pin + Push-On Snap Retaining Ring ("Collar") Default:**
* Unless the user explicitly requests screws or a different fastener, NEVER ship bare barb-only hinge/latch pins that rely on a tiny barb lip catching a knuckle edge.
* Always use `build_toolless_snap_pin_and_ring()` and `verify_pin_ring_retention()` from [`p2s_cad_helpers.py`](./scripts/p2s_cad_helpers.py) (detailed in [fdm-design-principles.md](./references/fdm-design-principles.md) Section 11):
* **Extended Lay-Down D-Profile Pin (`Z = 0`, `0.0%` Overhang):** `Ø 2.75 mm` shaft in `Ø 3.00–3.10 mm` teardrop bores, `Ø 5.20 × 1.92 mm` flanged head, **`+2.40 mm` extra shaft landing seat past the outer knuckle** (`0.40 mm` play + `2.00 mm` flat ring seat), followed by a `Ø 3.16 mm` split cantilever barb (`0.75 mm` slot) and tapered pilot tip.
* **Matching Push-On Snap Retaining Ring ("Collar"):** `Ø 5.20 mm` OD × `1.92 mm` H (`Ø 2.85 mm` inner bore + `Ø 3.28 × 0.72 mm` upward counterbore detent recess, `0.0%` overhang). Include `1` ring per active pin plus at least `1` spare on the `.3mf` plate (`4` walls, `100%` infill), include assembled rings in `.step` + HTML 3D viewer, and assert `0.000000 mm³` rest collision + positive pull-off lock bite.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,31 @@ When engineering enclosures, faceplates, signage, or flush multi-color inlays ac
- **PEI Release Layer & Flow Ceiling:** Print `95A` TPU at `222 / 225 °C` nozzle, **`35 °C` Textured PEI with Glue Stick as a release barrier** (never `> 50 °C` bare PEI), Flow `1.00`, **$V_{max} = 3.6\text{ mm}^3/\text{s}$** (`25–45 mm/s` linear speeds), Retraction `0.4 mm @ 20 mm/s` + Wipe `ON`, **Avoid Crossing Walls `ON`**, and dry **`65–70 °C` for `6–8 h`**. Always use the printer's **Unload** command rather than yanking warm filament manually.
- **Filament Profile & Catalog Hygiene Rule:** When cataloging filaments, profiles, and visual guides, record only **brand, filament type/grade, SKU (e.g., `Kingroon TPU 95A`, SKU `C0468`), and technical printing specs** (temperatures, drying, flow, retraction, bed prep, feeding). Never clutter profiles, tables, or reference cards with store/listing packaging details (`10KG`, `10 × 1 kg bundle`, warehouse region `US/EU`, or color-specific purchase variants).

---

## 11. Toolless Hinge & Latch Pins + Push-On Snap Retaining Rings ("Collars") Standard

Unless the user explicitly requests screws, threaded rods, or a different fastener, **all toolless 3D-printed hinged boxes, clamshell lids, flip-leaves, and pivoting latches MUST use the Extended Snap-Pin + Push-On Retaining Ring ("Collar") architecture** (implemented in `p2s_cad_helpers.build_toolless_snap_pin_and_ring()`):

1. **Why Bare Barb-Only Pins Fail vs. Pin + Snap Retaining Ring:**
- Relying solely on a tiny `0.15 mm` radial barb to catch directly against an outer hinge knuckle bore edge invites wear and accidental pull-back through the `Ø 3.00–3.10 mm` bore.
- Extending the pin shaft past the outer knuckle by a dedicated **`+2.40 mm` flat landing seat** and snapping a matching **counterbored retaining ring (`Ø 5.20 mm` OD)** over the split barb locks the pin mechanically between two symmetrical `Ø 5.20 mm` flanges (head on entry side, snap collar on exit side) with zero metal hardware.

2. **Calibrated Geometry & Tolerances (`0.4 mm` Nozzle, `0.20 / 0.24 mm` Layer Height):**
- **Knuckle Through-Bore:** `Ø 3.00–3.10 mm` horizontal teardrop bore (`45°` roof, `0.0%` overhang).
- **Pin Shaft:** `Ø 2.75 mm` (`0.25–0.35 mm` total diametral clearance for effortless rotation).
- **Flanged Entry Head:** `Ø 5.20 mm × 1.92 mm` (`8 × 0.24 mm`), resting flush against the outer left knuckle (`0.20 mm` axial play).
- **Mandatory Extra Shaft Length Past Outer Knuckle:**
$$L_{\text{grip}} = L_{\text{knuckle\_span}} + 0.40\text{ mm (axial play)} + 2.00\text{ mm (flat ring landing seat)} = L_{\text{knuckle\_span}} + 2.40\text{ mm}$$
- **Split Cantilever Barb & Pilot Tip:** Flares `Ø 2.75 → Ø 3.16 mm` over `0.50 mm`, tapers `Ø 3.16 → Ø 1.80 mm` over `1.50 mm`, plus `0.70 mm` rounded pilot nose (`+5.10 mm` total protrusion beyond the outer knuckle); bisected by a `0.75 mm × 5.80 mm` flex relief slot so the two prongs compress cleanly through both the knuckle bore and retaining ring.
- **Print Orientation (`0.0%` Overhang, `5×` Axial Shear Strength):** Print flat horizontally at `Z = 0.00 mm` using a `45°` D-profile flat-bottom cross-section (`z_axis = 0.90 mm`) so continuous extruded filaments run along the full pin axis.
- **Matching Push-On Snap Retaining Ring ("Collar"):**
- `OD = Ø 5.20 mm` (matches the pin flanged head), `H = 1.92 mm` (`8 × 0.24 mm`), `0.24 mm` `45°` outer chamfers.
- Inner retention bore `Ø 2.85 mm` (`+0.10 mm` over `Ø 2.75 mm` shaft; positively blocks `Ø 3.16 mm` barb).
- Upward-opening top counterbore detent recess **`Ø 3.28 mm × 0.72 mm`** (`3 × 0.24 mm`, prints flat at `Z = 0` with **`0.0%` overhang**). Assembled flat-face inward against the outer knuckle, counterbore outward toward the barb.

3. **Mandatory `.3mf` Plate Parity & Programmatic Verification:**
- Ship **`1` Snap Retaining Ring per active pin PLUS at least `1` spare ring** laid out beside their matching pins on the `.3mf` plate (`4` walls, `100%` infill).
- Include every assembled pin AND retaining ring in the assembled `.step` export and interactive HTML 3D viewer.
- Run `verify_pin_ring_retention(pin_asm, ring_asm)` asserting **`0.000000 mm³`** resting collision AND positive **`> 0.15 mm³`** axial interference when pulling the ring outward over the barb.

117 changes: 117 additions & 0 deletions .agents/skills/3d-print-modeling/scripts/p2s_cad_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import trimesh
from build123d import (
Align,
Axis,
Box,
BuildPart,
BuildSketch,
Circle,
Expand All @@ -43,9 +45,11 @@
Plane,
Polygon,
Rectangle,
chamfer,
export_step,
export_stl,
extrude,
loft,
)

# Default 6-Color Architectural Planter Palette (Hex RGB + RGBA)
Expand Down Expand Up @@ -260,6 +264,119 @@ def make_sacrificial_counterbore(
return cb.part


def _d_profile_pin_face(radius: float, x_pos: float, z_axis: float = 0.90):
"""Support-free 45-deg flat-bottom D-profile cross-section for horizontal lay-down snap pins."""
pts = []
n_arc = 20
for i in range(n_arc + 1):
ang = math.radians(180.0 * i / n_arc)
pts.append((radius * math.cos(ang), z_axis + radius * math.sin(ang)))
half_flat = max(0.12, radius - z_axis)
pts.append((-half_flat, 0.0))
pts.append((+half_flat, 0.0))
with BuildSketch(Plane.YZ.offset(x_pos)) as sk:
Polygon(*pts, align=None)
return sk.sketch.faces()[0]


def build_toolless_snap_pin_and_ring(
l_knuckle_span: float,
shaft_dia: float = 2.75,
head_dia: float = 5.20,
head_h: float = 1.92,
barb_dia: float = 3.16,
slot_w: float = 0.75,
knuckle_clearance: float = 0.40,
ring_seat_len: float = 2.00,
ring_h: float = 1.92,
ring_inner_bore: float = 2.85,
ring_counterbore_dia: float = 3.28,
ring_counterbore_depth: float = 0.72,
) -> Dict[str, Part]:
"""
Standard toolless 3D-printable hinge/latch pin + push-on snap retaining ring ("collar")
for Bambu Lab P2S (0.00% overhang, 5x axial filament shear strength).

The pin shaft automatically extends `+knuckle_clearance + ring_seat_len` (+2.60 mm default)
beyond `l_knuckle_span` so the matching counterbored snap retaining ring seats freely on
the flat landing zone and locks positively behind the split cantilever barb.

Returns dict with keys:
- `pin_print`: flat-bottom D-profile pin centered on XY at Z = 0 for bed printing
- `pin_axis_x`: pin starting at X = 0 (outer head face), shaft axis along +X at Z = 0.90 mm
- `ring_print`: flat counterbored retaining ring centered on XY at Z = 0 (counterbore +Z)
- `ring_axis_x`: ring rotated +90 deg around Y (flat face at X = 0, counterbore facing +X)
"""
r_shaft = shaft_dia / 2.0
r_head = head_dia / 2.0
r_barb = barb_dia / 2.0
r_pilot = 0.90
z_axis = 0.90
l_grip = l_knuckle_span + knuckle_clearance + ring_seat_len

x0 = 0.0
x1 = head_h
x2 = x1 + l_grip
x3 = x2 + 0.50
x4 = x3 + 1.50
x5 = x4 + 0.70

head = loft([_d_profile_pin_face(r_head, x0, z_axis), _d_profile_pin_face(r_head, x1, z_axis)], ruled=True)
shaft = loft([_d_profile_pin_face(r_shaft, x1, z_axis), _d_profile_pin_face(r_shaft, x2, z_axis)], ruled=True)
barb_up = loft([_d_profile_pin_face(r_shaft, x2, z_axis), _d_profile_pin_face(r_barb, x3, z_axis)], ruled=True)
barb_dn = loft([_d_profile_pin_face(r_barb, x3, z_axis), _d_profile_pin_face(r_pilot, x4, z_axis)], ruled=True)
pilot = loft([_d_profile_pin_face(r_pilot, x4, z_axis), _d_profile_pin_face(r_pilot - 0.12, x5, z_axis)], ruled=True)

pin_full = head + shaft + barb_up + barb_dn + pilot
slot_cut = Box(5.8, slot_w, 6.0, align=(Align.MAX, Align.CENTER, Align.MIN)).translate((x5 + 0.2, 0.0, -0.5))
pin_axis_x = pin_full - slot_cut
bb = pin_axis_x.bounding_box()
pin_print = pin_axis_x.translate((
-(bb.min.X + bb.max.X) / 2.0,
-(bb.min.Y + bb.max.Y) / 2.0,
-bb.min.Z,
))

with BuildPart() as bp_ring:
with BuildSketch(Plane.XY):
Circle(radius=head_dia / 2.0)
Circle(radius=ring_inner_bore / 2.0, mode=Mode.SUBTRACT)
extrude(amount=ring_h)
ring = bp_ring.part - Cylinder(
radius=ring_counterbore_dia / 2.0,
height=ring_counterbore_depth + 0.5,
align=(Align.CENTER, Align.CENTER, Align.MIN),
).translate((0.0, 0.0, ring_h - ring_counterbore_depth))
bot_outer = [e for e in ring.faces().sort_by(Axis.Z)[0].edges() if e.bounding_box().size.X > head_dia * 0.8]
top_outer = [e for e in ring.faces().sort_by(Axis.Z)[-1].edges() if e.bounding_box().size.X > head_dia * 0.8]
if bot_outer:
ring = chamfer(bot_outer, length=0.24)
if top_outer:
ring = chamfer(top_outer, length=0.24)

return {
"pin_print": pin_print,
"pin_axis_x": pin_axis_x,
"ring_print": ring,
"ring_axis_x": ring.rotate(Axis.Y, 90.0),
}


def verify_pin_ring_retention(pin_asm: Part, ring_asm: Part, label: str = "Pin+Ring") -> float:
"""Asserts 0.000000 mm^3 rest collision and > 0.15 mm^3 positive axial pull-off lock bite over the split barb."""
it_rest = pin_asm & ring_asm
v_rest = float(it_rest.volume) if it_rest is not None else 0.0
if v_rest > 1e-4:
raise RuntimeError(f"PIN+RING REST COLLISION ({label}): {v_rest:.6f} mm^3")
v_pull = 0.0
for dx in (1.20, 1.50, 1.80, 2.10):
it_pull = pin_asm & ring_asm.translate((dx, 0.0, 0.0))
v_pull = max(v_pull, float(it_pull.volume) if it_pull is not None else 0.0)
if v_pull < 0.15:
raise RuntimeError(f"PIN+RING RETENTION BITE TOO WEAK ({label}): {v_pull:.4f} mm^3 < 0.15 mm^3")
return v_pull


def render_shaded_previews(
stl_path: Path,
previews_dir: Path,
Expand Down
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ All models created in this workspace **must** be engineered to print with **zero
* Keep unsupported horizontal bridges **`<= 15 mm`** for functional accuracy (`<= 25 mm` cosmetic max on P2S). For wider spans, arch or chamfer the ceiling at `45°`.
6. **Print Orientation (`Z = 0` Ready):**
* Always export models pre-oriented in their optimal print orientation sitting flat on `Z = 0` (`min_z = 0.0`), centered in X/Y.
7. **Toolless Hinge & Latch Pins + Snap Retaining Rings ("Collars") — Mandatory Default Unless Requested Otherwise:**
* For **every toolless box, clamshell, hinged lid, flip-leaf, or pivoting latch design** (unless the user explicitly requests metal screws/bolts or a different fastener), **NEVER** use bare barb-only pins that rely solely on a tiny barb catching against a knuckle edge.
* Always pair **extended horizontal flat-bottom D-profile Snap Pins** (`Ø 2.75 mm` shaft inside `Ø 3.00–3.10 mm` teardrop bores, `Ø 5.20 mm × 1.92 mm` flanged head, **`+2.40 mm` extra shaft length past the outer knuckle** = `0.40 mm` rotational clearance + `2.00 mm` flat ring landing seat, `Ø 3.16 mm` split cantilever barb with `0.75 mm` flex slot, printed flat on `Z = 0` for `5×` axial shear strength and `0.0%` overhang) with **matching push-on counterbored Snap Retaining Rings ("Collars")** (`Ø 5.20 mm` OD, `1.92 mm` height, `Ø 2.85 mm` inner bore, `Ø 3.28 × 0.72 mm` upward counterbore recess, `0.0%` overhang).
* Always include **`1` retaining ring per active pin plus spares** neatly laid out alongside the pins on the `.3mf` plate (`4` walls, `100%` infill), include the rings in the assembled `.step` & interactive 3D viewer, and programmatically verify **`0.000000 mm³`** resting collision plus **positive axial pull-off lock bite** (`verify_pin_ring_retention()`). Use `build_toolless_snap_pin_and_ring()` from `.agents/skills/3d-print-modeling/scripts/p2s_cad_helpers.py`.

---

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.2.2
Loading