Active Printer: Bambu Lab P2S Build Volume:
256 × 256 × 256 mm(X × Y × Z) Primary CAD Engine: build123d (Python OpenCascade B-Rep CAD) + FreeCAD Python API compatible (.step,.3mf,.stl) Primary Slicer: Bambu Studio (.step&.3mfnative arc slicing) Core Mandate: Support-Free FDM Design (<= 45°overhangs, teardrop horizontal holes,Z = 0bottom chamfers, sacrificial counterbore bridges) + Continuous Self-Learning from user feedback.
When an AI agent (Antigravity, Cursor, Claude Code, Copilot, Windsurf, Codex, etc.) is asked:
- "How do I use this repository?"
- "Help me get started"
- "Help me set up BambuForge for my printer"
- Or when asked to generate any 3D model before the user's printer configuration has been confirmed:
The agent MUST immediately ask the user:
"What printer and model do you have?"
(e.g., Bambu Lab X1C / P1S / P2S / A1 / A1 Mini, Voron 2.4, Prusa MK4/XL, Creality Ender 3 / K1, Elegoo Neptune, etc., your nozzle size [0.4 mm default], and whether you have multi-material / AMS units).
Upon receiving the user's printer response, the agent must automatically complete the environment fine-tuning:
- Calibrate Section 2 (Hardware Profile & Constraints): Update the
Build Volume (X × Y × Z),Safe Volume, andStandard Nozzleto match the user's specific printer. - Clarify Print Speed & Quality Preference for Bulky Objects:
When modeling large/bulky objects (e.g. planters, bins, housings, structural frames) where miniature precision is not critical, proactively ask the user:
"What print quality/speed do you prefer?"
0.20 mm Standard: Higher surface resolution, smoother layer lines; best for miniatures, detailed textures, and tight press-fits.0.28 mm Extra Draft: ~35–45% faster printing with higher layer adhesion; ideal for bulky planters, pots, saucers, and storage boxes.
- Calibrate Material & Slicing Defaults:
- Bambu Lab Printers (P2S / X1C / P1S / A1 / A1 Mini): Set machine profile strings and configure AMS slots (
1..4or1..16). - Other FDM Printers (Prusa / Voron / Creality / Any FDM): Configure
.step/.stlmulti-body exports and OrcaSlicer / PrusaSlicer settings.
- Bambu Lab Printers (P2S / X1C / P1S / A1 / A1 Mini): Set machine profile strings and configure AMS slots (
- Persist & Confirm: Update
AGENTS.mdand present the user with a tailored quick-start guide ready to accept their first model prompt.
Every model request is isolated in its own dedicated folder under models/:
<WORKSPACE_ROOT>\
├── AGENTS.md # Master rules, printer specs, model registry & learned preferences
├── build.ps1 # Root task runner & worktree orchestrator
├── .gitignore # Excludes .venv/, .worktrees/, temp slicer files
├── .venv/ # Dedicated Python 3.11 environment (build123d, trimesh, matplotlib)
├── .worktrees/ # Isolated git worktrees for parallel agents & tasks
├── scripts/ # Cross-platform automation scripts
│ ├── worktree.ps1 # PowerShell worktree manager (new, list, remove, merge-back, sync)
│ └── worktree.sh # Bash worktree manager (macOS/Linux)
├── .agents/
│ └── skills/
│ ├── 3d-print-modeling/ # Parametric build123d / FreeCAD FDM design skill + helper library
│ ├── bambu-studio-ai/ # Local zero-subscription CAD-to-Bambu Studio pipeline & analyzer
│ ├── self-learning-cad/ # Continuous preference capture, tolerance tuning & gap-closing skill
│ ├── bambuforge-repo-sync/ # Automated bidirectional skill sync with public BambuForge repo
│ └── worktree/ # Multi-agent task isolation & git worktree manager skill
└── models/
└── <model-name>/ # Dedicated directory per requested 3D model
├── <model-name>.py # Parametric build123d / FreeCAD Python source
├── ASSEMBLY_GUIDE.md # Illustrated step-by-step assembly & usage instructions
├── exports/ # Ready-to-slice .step, .3mf, and .stl files for Bambu Studio
├── previews/ # Rendered multi-angle PNG views, 3D assembly guide & viewer
└── notes.md # Model dimensions, print settings, and post-print feedback
| Parameter | Value | Design Impact |
|---|---|---|
| Build Volume (X × Y × Z) | 256 × 256 × 256 mm |
Keep single-piece parts <= 250 mm per axis for safe skirt/brim margin; split larger parts with dovetails/dowels. |
| Standard Nozzle | 0.4 mm |
Design wall thicknesses as multiples of extrusion width (0.42 mm outer / 0.45 mm inner): 0.85 mm (2 walls), 1.25 mm (3 walls), 1.65 mm (4 walls), 2.0+ mm (structural). |
| Standard Layer Height | 0.20 mm Standard0.24 mm Standard (@BBL P2S) |
Default is 0.20 mm. On the Bambu Lab P2S (0.4 mm nozzle), Bambu Studio's stock thick-layer preset is 0.24mm Standard @BBL P2S (note: Bambu Studio does not ship a stock 0.28 mm preset for P2S 0.4 mm). Design vertical Z-steps, thin drip floors (1.20 mm), short raised ribs (0.96 mm), and sacrificial bridges as exact multiples of 0.24 mm (or 0.20 mm). |
| Preferred Export Formats | .step, .3mf, .stl |
Always export .step alongside .3mf/.stl—Bambu Studio slices .step files with true circular arcs (G2/G3) and zero facet artifacts, and .step files open directly in FreeCAD as editable solids. |
All models created in this workspace must be engineered to print with zero supports (or minimal built-in breakaway features only when physically unavoidable):
- The 45° Overhang Invariant:
- All outward-sloping walls, brackets, and gussets must stay at
<= 45°from vertical (>= 45°from the build plate). - Never create floating cantilevers; support ledges from below with a
45°chamfered ramp or lofted gusset.
- All outward-sloping walls, brackets, and gussets must stay at
- Bottom Edge Treatment (
Z = 0Chamfer, Never Fillet):- Any edge touching
Z = 0or facing downward must use a45°chamfer (e.g.,0.8 mm – 1.5 mmviachamfer(part.faces().sort_by(Axis.Z)[0].edges(), length=1.0)), never a downward-facing radius/fillet (which starts at nearly90°overhang on the first layers). - Use
fillet()on vertical edges (edges().filter_by(Axis.Z)) and top edges.
- Any edge touching
- Horizontal Holes & Tunnels:
- Holes
<= 5 mmdiameter can print circular. - Horizontal holes
> 5 mmdiameter must use a teardrop profile (45° pointed/truncated roof) or diamond/hexagonal top so the ceiling bridges cleanly without sagging.
- Holes
- Counterbored Screw Holes (Floating Ceilings):
- When a screw head recess is on the bottom (
Z = 0) and the shaft hole is above it, never leave a floating annular ring. Add a0.20 mm(single-layer) sacrificial bridge across the bore (punched through easily by the screw).
- When a screw head recess is on the bottom (
- Bridging Limits:
- Keep unsupported horizontal bridges
<= 15 mmfor functional accuracy (<= 25 mmcosmetic max on P2S). For wider spans, arch or chamfer the ceiling at45°.
- Keep unsupported horizontal bridges
- Print Orientation (
Z = 0Ready):- Always export models pre-oriented in their optimal print orientation sitting flat on
Z = 0(min_z = 0.0), centered in X/Y.
- Always export models pre-oriented in their optimal print orientation sitting flat on
- 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 mmshaft insideØ 3.00–3.10 mmteardrop bores,Ø 5.20 mm × 1.92 mmflanged head,+2.40 mmextra shaft length past the outer knuckle =0.40 mmrotational clearance +2.00 mmflat ring landing seat,Ø 3.16 mmsplit cantilever barb with0.75 mmflex slot, printed flat onZ = 0for5×axial shear strength and0.0%overhang) with matching push-on counterbored Snap Retaining Rings ("Collars") (Ø 5.20 mmOD,1.92 mmheight,Ø 2.85 mminner bore,Ø 3.28 × 0.72 mmupward counterbore recess,0.0%overhang). - Always include
1retaining ring per active pin plus spares neatly laid out alongside the pins on the.3mfplate (4walls,100%infill), include the rings in the assembled.step& interactive 3D viewer, and programmatically verify0.000000 mm³resting collision plus positive axial pull-off lock bite (verify_pin_ring_retention()). Usebuild_toolless_snap_pin_and_ring()from.agents/skills/3d-print-modeling/scripts/p2s_cad_helpers.py.
(Updated automatically by the Self-Learning Skill as we test prints on your specific P2S and filaments)
| Fit Type | Per-Side Clearance | Diameter / Total Gap | Typical Use Case |
|---|---|---|---|
| Press / Interference Fit | 0.05 – 0.08 mm |
0.10 – 0.15 mm |
Bearings, magnets, permanent dowels (always add 0.5 mm lead-in chamfer) |
| Snug / Snap Fit | 0.12 – 0.15 mm |
0.25 – 0.30 mm |
Snap-fit enclosure lids, friction-fit caps |
| Sliding / Clearance Fit | 0.20 – 0.25 mm |
0.40 – 0.50 mm |
Drawers, sliding rails, removable covers, print-in-place joints |
| Loose / Free Fit | 0.35 – 0.50 mm |
0.70 – 1.00 mm |
Hinges, cable pass-throughs, quick-drop organizers |
| Horizontal Fastener Holes | +0.15 mm radius |
+0.30 mm diameter |
M3 hole = 3.3 mm, M4 = 4.3 mm, M5 = 5.3 mm |
| Heat-Set Inserts (Ruthex/CNC) | Standard taper | Nominal spec | M3 = 4.0 mm hole w/ 4.4 mm top counterbore |
The repository root checkout on main is considered clean and stable. When multiple AI agents are operating concurrently or when developing separate models/features:
- If another agent is actively working in the workspace (or to isolate any new model, CAD engine modification, or experiment), never work directly in the root checkout.
- Always spawn a dedicated git worktree under
.worktrees/:# Windows PowerShell .\scripts\worktree.ps1 new model/<descriptor> # Or via task runner: .\build.ps1 -Task worktree-new -Branch model/<descriptor>
# Linux / macOS ./scripts/worktree.sh new model/<descriptor>
- Local Working Studio (
3D-Automation): Contains the primary Python.venv,models/, and local worktrees. - Sibling Remote (
bambuforge): Points to local sibling repo../BambuForge. Fetch anytime with:.\scripts\worktree.ps1 sync-remote bambuforge - Upstream GitHub (
origin): Points tohttps://github.com/mlgitdev/BambuForge.gitfor PRs and issue correlation.
- Worktrees do NOT duplicate
.venv/. - Every worktree automatically inherits the root Python environment at
..\..\.venv\Scripts\python.exe(build123d 0.13, OpenCascade 8.0, Trimesh, Matplotlib). - All CAD generators and slicing scripts must run using this shared interpreter.
- Atomic Local Git Commit Per Task (Mandatory): Every completed 3D model, CAD revision, slicer profile update, or skill refinement MUST be committed locally to
mainin the3D-Automationworkspace using Conventional Commits (feat(models): ...,fix(cad): ...,chore(skills): ...) before concluding the task. (Keep3D-Automationcommits strictly local; nevergit push originraw3D-Automationcommits directly to the publicBambuForgeGitHub remote—only sanitized updates go upstream viasync_to_bambuforge.py.) - One-Command Merge-Back, Worktree Removal & Agent Branch Deletion: Never leave temporary agent-created branches (
model/*,feat/*,fix/*,sub/*,docs/*) or.worktrees/*folders dangling after task completion:# Merge back into main .\scripts\worktree.ps1 finish model/<descriptor> main # Safely remove the worktree .\scripts\worktree.ps1 remove model/<descriptor> -DeleteBranch
- User-Created Branch Protection: Never leave agent-created branches behind, and never delete branches explicitly created by the user unless requested.
- For full operational workflows, consult the
worktreeskill.
Whenever the user requests a fine-tuning adjustment, reports a print fit issue, or expresses a preference:
- Immediate Action: Apply the change to the active model in
models/<model-name>/. - Gap Analysis & Persistence: Update
.agents/skills/self-learning-cad/references/learned-preferences.mdand section 7. Learned User Preferences below so the agent never repeats the same mistake and automatically applies the preference to all future models. - Workflow Invocation: Always consult
.agents/skills/3d-print-modeling/SKILL.md,.agents/skills/bambu-studio-ai/SKILL.md, and.agents/skills/self-learning-cad/SKILL.mdwhen designing, analyzing, or refining models.
This section is automatically populated by the
self-learning-cadskill 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.
- Printer: Configure via First-Run Onboarding (Section 0).
- Default Slicing Philosophy: Support-free (
<= 45°overhangs,Z = 0chamfers),gyroidsparse infill, native.step+.3mfmulti-plate exports, and non-destructive versioned.3mfiterations. - Multi-Color Strategy: Offer both flush AMS inlay (
1.60–2.00 mmdepth) and zero-waste single-color clip-together lattice/comb assemblies (0filament swaps) when appropriate.
| Date | Model Folder | Description | Status | Print Feedback / Notes |
|---|---|---|---|---|
| (auto) | models/<model-name>/ |
New models generated in this workspace are indexed here automatically. | — | — |