Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,31 @@ When engineering enclosures, faceplates, signage, or flush multi-color inlays ac
- Keep the blind shutter pocket roof beneath the funnel floor (`-2.0°` slope toward the tilted bed side + `4.5°` wall draft on opposing pocket walls) so `46°` tilted printing yields `0.0 g` internal support.
- Build multi-vertex ruled lofts directly via `Face(Wire.make_polygon([Vector(x, y, z) for ...]))` and `loft([f_bot, f_top], ruled=True)` to prevent `BuildSketch` vertex re-indexing twists.

---

## 10. Universal Zero-Waste Multi-Color, Engraving, Print-Flat Strength & Texture Patterns

1. **Zero-Waste Single-Color Clip-Together Multi-Color Architecture (`0` Filament Swaps, Zero Glue):**
- For multi-color flat boards, panels, and inlays without AMS purge waste (or for single-extruder printers), avoid gluing dozens of tiny loose tiles.
- **2-Piece Flush Interlocking Lattice:** Split a checkered/grid face into (a) a single-color **Raised-Island Base Plate** and (b) a contrasting single-color **Window Lattice Frame** that drops over the raised islands inside a `45°` tapered shell window so both colors sit `100%` flush (`0.18 mm` clearance).
- **Comb-Linked Multi-Element Strips:** Join repeated color shapes (e.g. triangles, stripes, accents) along a thin concealed perimeter rail with staggered Z-heights (`>= 0.60 mm` vertical separation between colors) and lock all strips flush beneath a single **Snap-In Perimeter Retaining Frame**. Every color prints on its own zero-swap single-color plate.

2. **Single-Color Paint-Fillable Engravings & Flat-Printed Snap-Slide Lids:**
- For decorative single-color enclosures meant to be accent-painted with a fine brush (acrylic / model paint + wipe-off), print primary artwork faces flat in XY (`0.85–1.00 mm` deep, `>= 1.15 mm` stroke width) so paint pools crisply inside the grooves.
- On vertical side walls, use **`42°` V-chased or `42°`-roofed grooves (`0.65–0.80 mm` deep)** so overhangs remain `0.00% > 45°`.
- For two-part card/tool cases with zero-fall-off lids, pair a flat-printed dock with a flat-printed sliding cover captured by **`43.6°` dovetail rails** on three edges plus **twin `38.7°` octahedral snap-detents** (`0.12 mm`/side preload) and a `45°` U-shaped top finger pull-out scoop.

3. **Print-Flat Axial Strength (Rods, Handles & Zero-Hardware Clamps):**
- Never print thin high-stress rods, poles, or blade-clamping studs upright along Z where interlayer delamination causes snapping.
- Print solid rods and handles **flat along X/Y on `Z = 0`** using a narrow planar bed strip (`~2.0–2.4 mm`) transitioning via `45°` lower bevels into the rounded/octagonal crown so filament strands run continuously along the load axis.
- Slice structural rods at **`40–50%` `gyroid` infill** (rather than brittle `100%` solid or weak hollow shells) for optimal flex ductility and impact resistance.
- For zero-hardware clamping (e.g. replaceable blades or tool inserts), lock parts via **twin `45°` sliding dovetails blocked by a 360° knurled sliding collar** or a **`45°` 3-wing bayonet twist-lock**, shielding sharp edges in a snap-detent scabbard (`>= 1.3 mm` internal edge clearance).

4. **Upward-Facing Heightfield Texture Lofting (`n_z > 0` → `0.00%` Overhangs) & Support-Free Inverted Collars:**
- When adding continuous woven/rope/fluted textures across concave troughs and steep rising walls, compute the surface modulation strictly as a single-valued heightfield `z(x, y) = z_base(y) + Δz(x, y)` sampled uniformly in trough arc length `s` and lofted via explicit `Face(Wire.make_polygon(...))` sections. Because `n_z > 0` mathematically everywhere on a heightfield, overhangs `> 45°` stay strictly **`0.00%`**.
- Replace support-heavy curved stacking collars (downward fillets at `Z = 0`) with **inverted `42°–43°` beveled domes + `44°` self-centering nesting cradles**, and sculpt horizontal decorative wall coils with `<= 42.5°` beveled undersides transitioning into rounded crests (`0.00%` overhangs).

5. **Cross-Suite Interface Locking & Flip-Proof Captive Travel Storage:**
- In `0° → 180°` folding travel cases, keep playing surfaces unobstructed and house loose pieces in **removable contoured cassettes with flush-nesting snap-on captive lids** plus stepped hold-down bridges (`<= 0.55 mm` gap) so inverting the closed case cannot dislodge components.
- When companion models mate across separate projects, lock exact outer/inner envelope contracts (`±0.05 mm`) upfront and verify **`0.000000 mm³` collision** via an automated cross-suite `.step`-to-B-Rep boolean intersection test before release.

3 changes: 3 additions & 0 deletions .agents/skills/bambu-studio-ai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ Whenever packing multiple trays/modules and multi-color AMS sub-parts into a sin
10. **Bambu Studio 2.6 `"include"` G-Code Resolution, Native Presets & `"gyroid"` Infill:**
* Always use **`"gyroid"`** for `sparse_infill_pattern` (never `"rectilinear"`, which Bambu Studio 2.6 rejects for sparse infill with a warning popup).
* Resolve both `"inherits"` and `"include"` JSON templates inside `_flatten_bambu_json()` (`p2s_cad_helpers.py`) before generating the `.3mf` via `bambu-studio.exe --load-settings "<machine>;<process>" --load-filaments "<filament>" --export-3mf`. Verify programmatically that `printer_settings_id == "Bambu Lab P2S 0.4 nozzle"`, `curr_bed_type == "Textured PEI Plate"`, `filament_settings_id == ["Bambu PLA Basic @BBL P2S"]` (or the requested installed filament), `print_settings_id` matches an installed process preset (never a made-up unnamed profile), and `different_settings_to_system[1..2] == ["", ""]` so zero G-code security popups or `(filename)` preset renames occur.
11. **Non-Destructive `.3mf` Iteration & Parallel CLI Retry Guardrail:**
* When revising an existing model's `.3mf`, always preserve the prior file and emit a versioned sibling (e.g., `_v2_p2s_multiplate.3mf`) instead of overwriting in place, so the user can compare plates or keep a verified print profile intact.
* When multiple CAD subagents invoke `bambu-studio.exe --export-3mf` concurrently on Windows, shared cache/lock collisions can cause transient non-zero exit codes. Always wrap CLI calls in a **`3×` retry loop with `3 s` backoff** and verify the output `.3mf` exists and is non-empty before proceeding.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ This profile tunes **UJOYBIO / EjoyBio Elite PLA+** for **ultra-fine miniature r
## 4. Installed Locations & Programmatic Usage

1. **Live Bambu Studio User Directory (Installed & Ready in Slicer Dropdown):**
- `<USER_HOME>\AppData\Roaming\BambuStudio\user\944859351\process\0.20mm Precision @BBL P2S - Ujoy PLA+.json`
- `<USER_HOME>\AppData\Roaming\BambuStudio\user\944859351\process\0.16mm Precision @BBL P2S - Ujoy PLA+.json`
- `<USER_HOME>\AppData\Roaming\BambuStudio\user\944859351\process\0.24mm Standard @BBL P2S - Ujoy PLA+.json`
- `<USER_HOME>\AppData\Roaming\BambuStudio\user\<BAMBU_USER_ID>\process\0.20mm Precision @BBL P2S - Ujoy PLA+.json`
- `<USER_HOME>\AppData\Roaming\BambuStudio\user\<BAMBU_USER_ID>\process\0.16mm Precision @BBL P2S - Ujoy PLA+.json`
- `<USER_HOME>\AppData\Roaming\BambuStudio\user\<BAMBU_USER_ID>\process\0.24mm Standard @BBL P2S - Ujoy PLA+.json`
2. **Workspace Profiles Resource Directory:**
- `.agents/skills/bambu-studio-ai/resources/profiles/ujoybio_pla_plus_020mm_precision_project_settings.json`
- `.agents/skills/bambu-studio-ai/resources/profiles/ujoybio_pla_plus_016mm_precision_project_settings.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@
(rf"C:(\\\\|[\\/])Users(\\\\|[\\/]){_USER_KEYWORD}", "<USER_HOME>"),
(rf"[Cc]:/[Uu]sers/{_USER_KEYWORD}", "<USER_HOME>"),
(rf"{_USER_KEYWORD}", "mlgitdev"), # Public GitHub handle
(r"(BambuStudio[\\/]+user[\\/]+)\d{6,}", r"\1<BAMBU_USER_ID>"),
(r"(user_id\s*=\s*)\d{6,}", r"\1<BAMBU_USER_ID>"),
]

# Strict forbidden patterns that will abort the sync if detected in synced files
FORBIDDEN_PATTERNS = [
re.compile(rf"C:[\\/]Users[\\/]{_USER_KEYWORD}", re.IGNORECASE),
re.compile(rf"{_PRJ_KEYWORD}", re.IGNORECASE),
re.compile(r"BambuStudio[\\/]user[\\/]\d{6,}", re.IGNORECASE),
re.compile(r"user_id\s*=\s*\d{6,}", re.IGNORECASE),
re.compile(r"gho_[A-Za-z0-9_]{20,}"),
re.compile(r"ghp_[A-Za-z0-9_]{20,}"),
]
Expand All @@ -64,6 +68,64 @@
]


def sanitize_public_agents_md(text: str) -> str:
"""
Keeps BambuForge's public AGENTS.md general-purpose for all users by preserving
Sections 0..6 (Onboarding, Architecture, Hardware, Support-Free Rules, Tolerances,
Worktree Protocol, Self-Learning Loop) and replacing personal Section 7 & Section 8
(user-specific project preferences & private Model Registry) with clean starter templates.
"""
marker = "## 7. Learned User Preferences"
idx = text.find(marker)
if idx == -1:
return text
header_part = text[:idx].rstrip() + "\n\n"
public_tail = (
"## 7. Learned User Preferences (Auto-Updated)\n\n"
"> *This section is automatically populated by the `self-learning-cad` skill as you calibrate "
"your specific printer, filaments, and design preferences. Universal FDM engineering patterns "
"live in [`.agents/skills/3d-print-modeling/references/fdm-design-principles.md`]"
"(.agents/skills/3d-print-modeling/references/fdm-design-principles.md).*\n\n"
"* **Printer:** Configure via First-Run Onboarding (Section 0).\n"
"* **Default Slicing Philosophy:** Support-free (`<= 45°` overhangs, `Z = 0` chamfers), "
"`gyroid` sparse infill, native `.step` + `.3mf` multi-plate exports, and non-destructive "
"versioned `.3mf` iterations.\n"
"* **Multi-Color Strategy:** Offer both flush AMS inlay (`1.60–2.00 mm` depth) and zero-waste "
"single-color clip-together lattice/comb assemblies (`0` filament swaps) when appropriate.\n\n"
"---\n\n"
"## 8. Model Registry\n\n"
"| Date | Model Folder | Description | Status | Print Feedback / Notes |\n"
"| :--- | :--- | :--- | :--- | :--- |\n"
"| *(auto)* | `models/<model-name>/` | *New models generated in this workspace are indexed here automatically.* | — | — |\n"
)
return header_part + public_tail


PUBLIC_LEARNED_PREFS_TEMPLATE = (
"# Learned User Preferences & Calibrated CAD Rules\n\n"
"> **Purpose:** This file is the living memory of your personal 3D modeling workspace. "
"As you provide fit feedback, dimensional tweaks, or aesthetic preferences, the `self-learning-cad` "
"skill appends your personal rules here so the agent never repeats a mistake.\n>\n"
"> **Universal FDM Rules:** General-purpose, community-applicable design standards live in "
"[`fdm-design-principles.md`](../../3d-print-modeling/references/fdm-design-principles.md).\n\n"
"---\n\n"
"## 1. Core Baseline Preferences\n\n"
"* **Primary CAD Engine:** `build123d` (Python OpenCascade B-Rep) + FreeCAD-compatible `.step` / `.3mf` / `.stl`.\n"
"* **Support-Free Priority:** High (`<= 45°` overhangs, `Z = 0` chamfers, teardrop horizontal holes `> 5 mm`).\n"
"* **Infill Default:** `gyroid` sparse infill (`40–50%` for print-flat structural rods).\n\n"
"---\n\n"
"## 2. Personal Fine-Tuning Rules Log\n\n"
"| Date | Category | Model | Gap Identified | Permanent Rule Adopted |\n"
"| :--- | :--- | :--- | :--- | :--- |\n"
)


# Files inside synced directories that store personal workspace history and should be generalized/skipped in public BambuForge
SKIP_IN_PUBLIC = {
"feedback-log.jsonl",
}


def sanitize_text(text: str) -> str:
"""Applies privacy replacements to file contents."""
sanitized = text
Expand Down Expand Up @@ -111,6 +173,8 @@ def copy_and_sanitize(src: Path, dst: Path, dry_run: bool = False, memory_violat
else:
text = src.read_text(encoding="utf-8", errors="ignore")
sanitized = sanitize_text(text)
if src.name == "AGENTS.md":
sanitized = sanitize_public_agents_md(sanitized)
if memory_violations is not None:
memory_violations.extend(audit_text_for_pii(sanitized, src.name))
if not dry_run:
Expand All @@ -128,6 +192,12 @@ def copy_and_sanitize(src: Path, dst: Path, dry_run: bool = False, memory_violat
src_file = Path(root) / file_name
dst_file = target_root / file_name

if file_name in SKIP_IN_PUBLIC:
if not dry_run and dst_file.exists():
dst_file.unlink()
skipped_count += 1
continue

if not dry_run:
target_root.mkdir(parents=True, exist_ok=True)

Expand All @@ -136,8 +206,11 @@ def copy_and_sanitize(src: Path, dst: Path, dry_run: bool = False, memory_violat
shutil.copy2(src_file, dst_file)
copied_count += 1
else:
text = src_file.read_text(encoding="utf-8", errors="ignore")
sanitized = sanitize_text(text)
if file_name == "learned-preferences.md":
sanitized = PUBLIC_LEARNED_PREFS_TEMPLATE
else:
text = src_file.read_text(encoding="utf-8", errors="ignore")
sanitized = sanitize_text(text)
if memory_violations is not None:
memory_violations.extend(audit_text_for_pii(sanitized, str(rel_root / file_name)))
if not dry_run:
Expand Down

This file was deleted.

Loading
Loading