Add AI 3D modeling walkthrough article, AI CAD skill pack, and update Discord/3D Fuel links
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
---
|
||||
name: cad-qa-inspector
|
||||
description: Quality assurance and dimensional verification skill for any CAD project (<ProjectName>). Runs Step 0 toolchain & target use-case intake (3D printed vs. Game Design/General CAD) with the user, and audits source ruler photos, cross-view 1:1 mm orthographic SVG/DXF/FigCraft blueprints, clearances, and SolidCraft/FreeCAD B-Rep solids.
|
||||
---
|
||||
|
||||
# Universal CAD Quality Assurance, Metrology & DFM Inspector Skill (`cad-qa-inspector`)
|
||||
|
||||
Use this skill at project kickoff (to confirm available CAD tools and whether the model is for 3D printing or another use case) and after any 2D blueprint or 3D CAD update to audit **metrology calibration, cross-view orthographic consistency, parametric timeline integrity, and hardware interference**.
|
||||
|
||||
---
|
||||
|
||||
## 0. Step 0: Mandatory CAD Toolchain & Target Use-Case Intake (Check `.cad-tools.json` or Ask User)
|
||||
|
||||
**Do NOT search the filesystem to guess where CAD binaries live, and do NOT assume every project is 3D printed.** Before running any verification or build scripts on a new project:
|
||||
1. Check if `.cad-tools.json` exists in the workspace or project root (or if tool paths and target use case are already documented in `AGENTS.md`).
|
||||
2. If `.cad-tools.json` is missing or incomplete, **ask the user** (using the `ask_question` tool or a concise intake prompt):
|
||||
- **Q1: Available 3D & 2D CAD Tools**: Which of the following tools are installed, and where are their executables located?
|
||||
- **SolidCraft (`solidcraft-cli`)**: Path to binary (e.g., `solidcraft-cli` on `$PATH`, `/mnt/bulk/CraftApps/solidcraft/solidcraft-cli`, or custom path) for step-by-step `.solidcraft` feature timelines, `.3mf`/`.obj`/`.step`/`.stl` exports, B-rep `inspect.interference`/`inspect.clearance`, and Vulkan GPU renders.
|
||||
- **CadCraft 2D (`cadcraft-cli`)**: Path to binary (e.g., `cadcraft-cli` on `$PATH`, `/mnt/bulk/CraftApps/cadcraft/cadcraft-cli`, or not installed) for native 1:1 mm `.dxf`, `.svg`, and `.png` blueprint export.
|
||||
- **FigCraft (`figcraft-cli`)**: Path to binary (configured in `.cad-tools.json` or not installed) for `.figcraft` boards, `.svg`/`.pdf`/`.png` blueprint presentation sheets, and headless rendering.
|
||||
- **FreeCAD Headless (`FreeCADCmd`)**: Invocation command (e.g., `flatpak run --command=FreeCADCmd org.freecad.FreeCAD`, native `freecadcmd`, AppImage path, or `null` when using SolidCraft + CadCraft/FigCraft only) for OpenCASCADE `.step`/`.stl`/`.FCStd` modeling and boolean verification.
|
||||
- **Q2: Target Use Case (3D Printed vs. Game Design / General CAD)**: Will this model be **3D printed**, or is it for another purpose (e.g., **Game Design / 3D Asset**, **Mixed-Media Relief Sculpture**, **CNC / Sheet Metal**, or **Unconstrained Mechanical Assembly**)?
|
||||
- **If Yes (3D Printed, `"is_3d_printed": true`)**: Ask *"What is your target 3D printer's maximum build volume $(X \text{ x } Y \text{ x } Z\text{ mm})$ and preferred single-part safety limit?"* (e.g., $270 \text{ x } 270 \text{ x } 270\text{ mm}$ max / $255 \text{ x } 255 \text{ x } 255\text{ mm}$ safe limit).
|
||||
- **If No (Not 3D Printed, `"is_3d_printed": false`)**: Set `"printer_max_bed_mm": null` and `"safe_part_limit_mm": null` in `.cad-tools.json`. **Skip all print-bed size constraints, bed-splitting joints, and print-orientation rules**, allowing monolithic parts and focusing QA on dimensional accuracy, clean mesh/B-Rep topology, PBR appearances, and zero-interference assembly fit.
|
||||
3. Save the confirmed configuration to `.cad-tools.json` in the project root:
|
||||
```json
|
||||
{
|
||||
"is_3d_printed": true,
|
||||
"target_use_case": "3d_printing",
|
||||
"printer_name": "Snapmaker U1",
|
||||
"printer_max_bed_mm": [270.0, 270.0, 270.0],
|
||||
"safe_part_limit_mm": [255.0, 255.0, 255.0],
|
||||
"tools": {
|
||||
"solidcraft_cli": "/mnt/bulk/CraftApps/solidcraft/solidcraft-cli",
|
||||
"cadcraft_cli": "/mnt/bulk/CraftApps/cadcraft/cadcraft-cli",
|
||||
"figcraft_cli": "/mnt/bulk/CraftApps/figcraft/figcraft-cli",
|
||||
"freecad_cmd": ["flatpak", "run", "--command=FreeCADCmd", "org.freecad.FreeCAD"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 1. Seven-Point Universal CAD QA Checklist
|
||||
|
||||
1. **Metrology & Source Photo Calibration Audit**:
|
||||
- Inspect EXIF orientation tags (`Rotate 90 CW` / `Rotate 270 CW` / etc.) before measuring pixel coordinates on reference ruler photos (`Source Images/**` or `SourceImages/**`).
|
||||
- Calibrate pixel-to-millimeter scale against steel ruler graduations using 1D projective homography when perspective foreshortening is present, and verify all primary hardware envelope dimensions and datum heights (such as full chassis height vs. ruler length).
|
||||
2. **Orthographic Projection Identity Across All 3 Views (`1 px = 1 mm`)**:
|
||||
- Verify `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, and `<ProjectName>_Top_View.svg` (and `<ProjectName>_Blueprints.figcraft` when used) are valid XML/documents with `1 px = 1 mm` scale and zero CSS/syntax errors.
|
||||
- Confirm every part's world $(X, Y, Z)$ coordinates match across Side $(Y, Z)$, Front $(X, Z)$, and Top $(X, Y)$ views.
|
||||
3. **Keep-Out & Moving-Hardware Clearance Verification**:
|
||||
- Confirm $0.0\text{ mm}$ encroachment into keep-out zones (e.g., overhanging top covers/lids cleared via **Stepped Edge Rabbet Reliefs**, hinged doors, touchscreens, fans, cables).
|
||||
4. **Moment-Arm & Anti-Rotation Structural Equilibrium**:
|
||||
- Verify cantilevered loads are supported by a positive two-point force couple (e.g., **Orthogonal Anti-Rotation Return Flange** + **Coaxial Boss Sleeve** + **Vertical Front-Pillar Riser Bridge**) so the assembly cannot rotate or rack under load.
|
||||
5. **Step-by-Step Parametric Timeline Audit (`SolidCraft` & `FreeCAD`)**:
|
||||
- Run `<solidcraft_cli> eval CAD/SolidCraft/<PartOrAssembly>.solidcraft` and verify:
|
||||
- All tunable fit dimensions and thicknesses are defined in `"params"` (`parameters.add`),
|
||||
- Every 2D profile is recorded in `"sketches"` with `"status": "solved"`,
|
||||
- Every 3D operation is named in `"timeline"` with `"error": null` (and **zero** `file.insert_step` shortcuts for designed parts).
|
||||
- When FreeCAD is enabled, verify `CAD/<ProjectName>_Full_Assembly.FCStd` contains a top-level `Params` `Spreadsheet::Sheet` and individual `PartDesign::Body` feature trees.
|
||||
6. **Exact B-Rep Zero-Interference Audit (`0.0000 mm³` Clash)**:
|
||||
- Confirm `0` interferences in `solidcraft-cli` (`inspect.interference`) and $0.0000\text{ mm}^3$ boolean overlap in headless FreeCAD (`part.common(ref).Volume < 0.001`).
|
||||
7. **3D Print Build-Volume, Coplanar Build-Plate Datum & FDM Fit Allowances (*ONLY When `"is_3d_printed": true`*)**:
|
||||
- **When `"is_3d_printed": true`**:
|
||||
- Verify every printable component's bounding box $(X, Y, Z)$ is $\le$ `safe_part_limit_mm` in `.cad-tools.json`.
|
||||
- Verify each printed part has a **Coplanar Build-Plate Datum Face** ($Z_{\text{print}} = 0$, zero out-of-plane boss stickout) for support-free bed printing.
|
||||
- Verify **$0.20\text{ mm}$ clearance allowances** on interlocking cleats/dovetails and **$\Delta R = +0.50\text{ to }+0.80\text{ mm}$ radial slip-fit bore allowances** on large FDM bores.
|
||||
- **When `"is_3d_printed": false` (Game Design / Sculpture / General CAD)**:
|
||||
- Skip print-bed bounding-box limits, part-splitting checks, and print-bed orientation rules.
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
---
|
||||
name: freecad-step-builder
|
||||
description: Parametric 3D CAD solid modeling skill using headless FreeCAD OpenCASCADE (FreeCADCmd) to generate watertight STEP, FCStd, printable STL files, and standalone 3D WebGL assembly viewers for any CAD project (<ProjectName>).
|
||||
---
|
||||
|
||||
# FreeCAD OpenCASCADE B-Rep, Printable STL & 3D Viewer Skill (`freecad-step-builder`)
|
||||
|
||||
This skill governs parametric 3D OpenCASCADE B-Rep solid modeling, boolean interference verification, `.step`/`.stl` export, and standalone interactive 3D WebGL viewer generation (`<ProjectName>_3D_Assembly_Viewer.html`) for **any CAD project (`<ProjectName>`)** using headless FreeCAD (`FreeCADCmd`).
|
||||
|
||||
---
|
||||
|
||||
## 0. Step 0: Resolve `FreeCADCmd` via `.cad-tools.json` or User Prompt
|
||||
|
||||
**Do NOT search the filesystem to guess how FreeCAD is installed.**
|
||||
1. Check `.cad-tools.json` in the workspace root for `"freecad_cmd"` (or check if the user already provided the FreeCAD command/path in the conversation or project `AGENTS.md`).
|
||||
2. If not yet configured, ask the user (or have the Designer / QA Inspector agent ask via `ask_question`) how FreeCAD is installed:
|
||||
- Flatpak: `flatpak run --command=FreeCADCmd org.freecad.FreeCAD <script.py>`
|
||||
- Native package: `freecadcmd <script.py>` or `FreeCADCmd <script.py>`
|
||||
- AppImage / Custom path: `/path/to/FreeCAD.AppImage -c <script.py>`
|
||||
- Or Not installed (use `SolidCraft` only).
|
||||
3. Save the command in `.cad-tools.json` and guard script entrypoints with:
|
||||
```python
|
||||
if __name__ in ("__main__", "<script_stem>"):
|
||||
build_and_export()
|
||||
```
|
||||
because `FreeCADCmd` sets `__name__` to the script filename stem rather than `"__main__"`.
|
||||
|
||||
---
|
||||
|
||||
## 1. Standard Project Output Structure (`<ProjectName>`)
|
||||
|
||||
> **Blueprint-First Gate**: Do NOT build 3D FreeCAD solids until the 1:1 mm orthographic 2D SVG blueprints (`<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`) have been generated and reviewed by the user.
|
||||
|
||||
All 3D deliverables are modeled in millimeters ($1\text{ unit} = 1.0\text{ mm}$) in assembled world coordinates inside `<ProjectName>/CAD/`:
|
||||
|
||||
| Deliverable Type | Path Pattern | Purpose |
|
||||
| :--- | :--- | :--- |
|
||||
| **Parametric FreeCAD Project** | `CAD/<ProjectName>_Full_Assembly.FCStd` & `CAD/FCStd/<PartName>.FCStd` | Native FreeCAD document with a `Params` **`Spreadsheet::Sheet`** and separate **`PartDesign::Body`** containers holding sequential `Sketcher::SketchObject` + `PartDesign::Pad` / `PartDesign::Pocket` features for human editing. |
|
||||
| **Individual Component STEP** | `CAD/STEP/<PartName>.step` | Exact OpenCASCADE B-Rep solid for CAD interchange. |
|
||||
| **Individual Component STL** | `CAD/STL/<PartName>.stl` | High-resolution watertight mesh (`LinearDeflection=0.15`, `AngularDeflection=0.35`) for 3D printing. |
|
||||
| **Sub-Assembly STEP** | `CAD/STEP/<ProjectName>_Parts_Assembly.step` | Multi-body STEP assembly of all printable components. |
|
||||
| **Full Hardware Assembly** | `CAD/STEP/<ProjectName>_Full_Assembly.step` | Complete assembly including host hardware and payload reference solids. |
|
||||
| **Interactive 3D WebGL Viewer** | `<ProjectName>_3D_Assembly_Viewer.html` | Zero-dependency standalone HTML/WebGL viewer with Orbit/Pan/Zoom, Explode slider (`0%..100%`), camera presets, and per-part visibility toggles. |
|
||||
|
||||
---
|
||||
|
||||
## 2. Mandatory Step-by-Step Parametric `PartDesign::Body` Build History Standard
|
||||
|
||||
**CRITICAL RULE: Never Export a Collapsed Static `Part::Feature` Solid as the Primary `.FCStd` Model**:
|
||||
Instead of fusing/cutting raw `Part.Shape` objects in Python memory and assigning the final shape to a single non-editable `Part::Feature` (`obj.Shape = final_shape`), **always construct each part as a native `PartDesign::Body` with a step-by-step feature history driven by a `Spreadsheet::Sheet` (`Params`)**:
|
||||
|
||||
1. **Create a Parametric `Spreadsheet::Sheet` (`Params`)**:
|
||||
- Add a `Spreadsheet::Sheet` named `"Params"` to the FreeCAD document and register every key dimension (board/payload lengths, fan hole spacing, PSU cradle width/height, wall thicknesses, clip overhangs, dovetail clearances) with human-readable labels in Column A, numeric values in Column B, and **aliases** via `sheet.setAlias("B2", "fan_hole_spacing")`.
|
||||
2. **Build Each Component as a Separate `PartDesign::Body`**:
|
||||
- Create one `PartDesign::Body` per printable part (`doc.addObject("PartDesign::Body", part_name)`).
|
||||
- Add sequential features inside each `PartDesign::Body` so a human opening the `.FCStd` file in FreeCAD GUI sees every step in the Model Tree and can double-click any sketch or pad/pocket to edit it:
|
||||
- **Step A (`Sketcher::SketchObject`)**: `sk = body.newObject("Sketcher::SketchObject", "Sketch_<FeatureName>")`, attach to the appropriate plane (`XY_Plane`, `XZ_Plane`, `YZ_Plane` or a datum plane offset), add closed wire geometry (`Part.LineSegment`, `Part.Circle`, `Part.ArcOfCircle`), and apply `Sketcher.Constraint('Coincident', ...)` constraints.
|
||||
- **Step B (`PartDesign::Pad` Additive Extrusion)**: `pad = body.newObject("PartDesign::Pad", "Pad_<FeatureName>")`, set `pad.Profile = sk`, `pad.Length = ...` (or bind to spreadsheet via `pad.setExpression("Length", "<<Params>>.wall_thickness")`).
|
||||
- **Step C (`PartDesign::Pocket` Subtractive Cutout / Bore / Duct / Mortise)**: `pocket = body.newObject("PartDesign::Pocket", "Pocket_<FeatureName>")`, set `pocket.Profile = sk_cut`, `pocket.Type = 0` (Dimension) or `1` (ThroughAll), and `pocket.Reversed = True/False`.
|
||||
3. **Group Reference Hardware Separately**:
|
||||
- Place non-printed reference hardware solids (e.g., SBC board + heatsink, PSU brick, 120 mm fans, host printer) inside a `App::DocumentObjectGroup` named `"Reference_Hardware"` so they are cleanly separated from the editable `PartDesign::Body` components.
|
||||
|
||||
---
|
||||
|
||||
## 3. Technical CAD & DFM Design Patterns (User Intent to Engineering Implementation)
|
||||
|
||||
1. **Step-by-Step `PartDesign::Body` Sketch-to-Pad/Pocket Modeling**:
|
||||
- Construct cantilever webs, fan shrouds/plenums, PSU cradles, snap-fit clips, clevis hooks, and dovetail tenons/mortises as individual named `Sketcher::SketchObject` + `PartDesign::Pad` / `PartDesign::Pocket` steps inside each part's `PartDesign::Body`.
|
||||
2. **Cantilever Snap-Fit Retention Clips & Overhang Ledges (`Snap-Fit Retention Tabs`)**:
|
||||
- *User intent*: *"Hold the power supply or board in place with overhangs or clips."*
|
||||
- *CAD implementation*: Model vertical **Cradle Side-Walls** that constrain lateral $(X, Y)$ translation, topped by **Cantilever Snap-Fit Retention Ledges (Overhang Hooks)** with a $1.5\text{ to }2.5\text{ mm}$ inward catch lip, a $30^\circ\text{--}45^\circ$ top **Lead-In Insertion Chamfer** (so the component snaps down past the flex tab during installation), and a $0.30\text{ mm}$ vertical/lateral clearance allowance around the payload envelope.
|
||||
3. **Coplanar Build-Plate Datum Face (Zero-Stickout Flush Bosses)**:
|
||||
- *User intent*: *"Make the round hole part flush with the arm so it's flat on the bed to print."*
|
||||
- *CAD implementation*: Make the axial length of cylindrical mounting bosses equal to the structural web thickness and align their outer faces to be strictly **coplanar** ($\Delta X = 0$). Eliminating out-of-plane boss stickout ensures the entire outer side face serves as a flat $Z_{\text{print}} = 0$ build-plate datum requiring zero supports.
|
||||
4. **Orthogonal Anti-Rotation Return Flange (Corner-Wrapping Reaction Pad)**:
|
||||
- *User intent*: *"Wrap the front corner so the sleeve on the round peg can't rotate."*
|
||||
- *CAD implementation*: Extending a $90^\circ$ **Orthogonal Return Flange** around the chassis corner onto a flat orthogonal datum face constrains rotation ($\theta = 0$) and resolves cantilevered bending moment ($M = F \cdot d$) into a tension-at-pin / compression-at-pad force couple.
|
||||
5. **Interlocking Cleat & Shrouded Clevis Gravity Joint**:
|
||||
- *User intent*: *"Have the top piece hook straight down over the front leg."*
|
||||
- *CAD implementation*: Terminate the lower return flange in an upward **Male Cleat Tang** with a rear **Receiver Channel** and a lower **Horizontal Bearing Shoulder (Step Ledge)**. Form a mating **Female Clevis Saddle** on the upper cantilever rail flanked by **Axial Retention End-Cheeks (Shrouded Side Flanges)** that capture the cleat laterally and prevent the lower brace from sliding off its mounting boss.
|
||||
6. **Shouldered Half-Lap Dovetail Ledger Joint (Blind Mortises + Integral Drop-In Tenons)**:
|
||||
- *User intent*: *"Have a lip that the center piece rests on with dovetails on top instead of separate bowties."*
|
||||
- *CAD implementation*: Step the inner mating edge into a **Lower Half-Lap Bearing Ledger** (carrying vertical shear in direct compression) and cut **Blind (Stopped) Female Dovetail Mortises** into the upper half. Extrude **Integral Male Dovetail Tenons** ($0.20\text{ mm}$ XY clearance allowance) on the ends of the spanning cross-member so it drops straight in from the top and locks lateral tension ($F_X$) and in-plane racking without separate butterfly/dutchman keys.
|
||||
7. **Stepped Edge Rabbet Relief (`Rabbet` / `Rebate Cut`) for Overhanging Lids**:
|
||||
- *User intent*: *"Reverse L notch at the top back to clear a cover that overhangs the front by 5 mm."*
|
||||
- *CAD implementation*: Cut a two-sided rectangular **Edge Rabbet Relief** (e.g., $6\text{ mm}$ deep x $5\text{ mm}$ high) along the upper-rear edge to clear the overhanging cover lip while preserving a lower **Undercut Datum Contact Toe** that reaches back to bear against the primary machine datum plane.
|
||||
8. **FDM Bore Shrinkage Allowance & Coaxial Flange Counterbore**:
|
||||
- *User intent*: *"Open up a tight spool holder hole by 0.5 mm radius."*
|
||||
- *CAD implementation*: Apply an **ISO Free-Running Slip-Fit Clearance Allowance** ($\Delta R = +0.50\text{ to }+0.80\text{ mm}$, or $+1.0\text{ to }+1.6\text{ mm}$ diametral clearance) on large FDM-printed bores ($\varnothing 30\text{--}75\text{ mm}$) to compensate for inner-perimeter shrinkage and seam bulge, paired with a coaxial **Counterbore** clearing the mounting base flange.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dual Automated Verification Gates
|
||||
|
||||
- **Gate 1 (Manifold & Zero-Clash Gate)**:
|
||||
- Assert `solid.isValid() == True` and `solid.Volume > 0` for every component.
|
||||
- Assert `part_solid.common(host_reference_solid).Volume < 0.001` ($0.0000\text{ mm}^3$ interference with the host machine, overhanging covers, doors, and keep-out envelopes).
|
||||
- Assert `part_i.common(part_j).Volume < 0.001` ($0.0000\text{ mm}^3$ boolean overlap across all mating components).
|
||||
- **Gate 2 (Conditional Print Bed Bounding-Box Gate ONLY when `"is_3d_printed": true`)**:
|
||||
- When `"is_3d_printed": true` in `.cad-tools.json`, assert `bbox.XLength <= SAFE_LIMIT and bbox.YLength <= SAFE_LIMIT and bbox.ZLength <= SAFE_LIMIT`.
|
||||
- When `"is_3d_printed": false` (e.g., Game Design, Digital Twin, CNC, or Unconstrained CAD), skip print-bed bounding-box limits.
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
---
|
||||
name: solidcraft-3d-builder
|
||||
description: Parametric 3D CAD modeling, STEP/3MF assembly packaging, exact B-rep interference/clearance analysis, and Vulkan GPU rendering skill for any CAD project (<ProjectName>) using solidcraft-cli. Always checks .cad-tools.json (or asks the user for the solidcraft-cli path) and builds parts and assemblies step-by-step with user parameters and named timeline features.
|
||||
---
|
||||
|
||||
# SolidCraft Parametric 3D CAD, 3MF & GPU Render Skill (`solidcraft-3d-builder`)
|
||||
|
||||
Uses `solidcraft-cli` (configured via `.cad-tools.json` or provided by the user in Step 0) to build `.solidcraft` projects for **any CAD project (`<ProjectName>`)** with **100% traceable step-by-step parametric feature timeline history**, editable user parameters, face-tagged `.3mf` slicer files, B-rep clearance/interference audits, and studio renders.
|
||||
|
||||
---
|
||||
|
||||
## 0. Step 0: Resolve `solidcraft-cli` Path via `.cad-tools.json` or User Prompt
|
||||
|
||||
**Do NOT search the filesystem for `solidcraft-cli`.**
|
||||
1. Check `.cad-tools.json` in the workspace root for `"solidcraft_cli"` (or check if the user already provided the path in the conversation/project `AGENTS.md`).
|
||||
2. If not yet configured, ask the user (or have the Designer / QA Inspector agent ask via `ask_question`) whether `SolidCraft` is available and what path/command to use, then save it in `.cad-tools.json`.
|
||||
|
||||
---
|
||||
|
||||
## 1. Mandatory Core Rule: Step-by-Step Parametric Feature Tree & User Parameters
|
||||
|
||||
> **CRITICAL RULE: NEVER IMPORT BAKED `.step` FILES FOR DESIGNED PARTS**:
|
||||
> You MUST **always** build `.solidcraft` parts and assemblies **step-by-step from scratch** using native `solidcraft-cli` parametric commands (`parameters.add`, `component.create`, `sketch.create`, `sketch.line`, `sketch.circle.*`, `sketch.rectangle.*`, `sketch.finish`, `solid.extrude`, `solid.revolve`, `solid.box`, `solid.cylinder`, `solid.fillet`, `solid.chamfer`, `plastic.*`, `sheet.*`).
|
||||
> **Do NOT use `file.insert_step` to import static/dumb solids for designed parts.** Every action taken to construct a part must be recorded in the `.solidcraft` feature timeline and driven by named user parameters so the user can open any `.solidcraft` file and adjust hole sizes, fit allowances, or thicknesses directly in SolidCraft without re-running external scripts.
|
||||
|
||||
### 3 Requirements for Every `.solidcraft` Document
|
||||
1. **Parametric User Variables (`parameters.add`) for Every Tunable Dimension & Fit Allowance**:
|
||||
- Define all slip-fit bore radii, counterbore radii/depths, structural web thicknesses, spotface radii, and joint clearance allowances at the start of the script using `parameters.add`:
|
||||
```json
|
||||
{
|
||||
"command": "parameters.add",
|
||||
"params": {
|
||||
"name": "spool_bore_r",
|
||||
"expression": "25.8 mm",
|
||||
"comment": "Slip-fit mounting barrel bore radius (51.6 mm diameter, +0.8 mm radial clearance allowance)"
|
||||
}
|
||||
}
|
||||
```
|
||||
- Reference parameter names directly as string expressions in feature commands (e.g., `"radius": "spool_bore_r"`, `"distance": "side_arm_w"`, `"height": "front_leg_w"`).
|
||||
2. **Standard CAD Feature Naming Convention in the Timeline**:
|
||||
- Always pass an explicit, technical `"name"` on every `component.create`, `sketch.create`, `solid.extrude`, `solid.cylinder`, `solid.box`, `solid.fillet`, and `solid.chamfer` command using standard CAD nomenclature:
|
||||
- `Sketch_<Part>_<Feature>` (e.g., `Sketch_B_L_Cantilever_Web`, `Sketch_B_L_Truss_Lightening_Pocket`, `Sketch_B_L_Return_Flange_Cleat`)
|
||||
- `Extrude_<Part>_<Feature>` (bosses, webs, return flanges, dovetail tenons)
|
||||
- `Cut_<Part>_<Feature>` (through-bores, counterbores, spotfaces, rabbet reliefs, blind dovetail mortises, truss pockets)
|
||||
3. **Standard Project Deliverables (`<ProjectName>`)**:
|
||||
- `CAD/SolidCraft/<PartName>.solidcraft` & `CAD/SolidCraft/<PartName>_Script.json` (each individual printable part with its full step-by-step feature timeline and user parameters)
|
||||
- `CAD/SolidCraft/<ProjectName>_Assembly.solidcraft` & `CAD/SolidCraft/<ProjectName>_Full_Assembly.solidcraft` (multi-component assemblies built step-by-step using `component.activate` `"root"` + `component.create`)
|
||||
- `CAD/3MF/<PartName>.3mf` & `CAD/3MF/<ProjectName>_Assembly.3mf` (`"format": "3mf-tagged"` slicer packages with B-rep face tags and PBR colors)
|
||||
- `CAD/SolidCraft/<ProjectName>_BRep_Inspection.json` (full step-by-step execution log + `inspect.interference` and `inspect.clearance` results)
|
||||
- `CAD/SolidCraft/<ProjectName>_Studio_Render.png` & `CAD/SolidCraft/<ProjectName>_Snapshot_<View>.png` (hardware Vulkan GPU renders)
|
||||
|
||||
---
|
||||
|
||||
## 2. Translating User Descriptions into Technical CAD Features in SolidCraft
|
||||
|
||||
| User Request / Intent | Technical CAD Feature Name | SolidCraft Feature Construction Pattern |
|
||||
| :--- | :--- | :--- |
|
||||
| *"Reverse L notch to clear an overhanging lid/cover"* | **Stepped Edge Rabbet Relief (`Rabbet_Relief`)** | Profile step in the primary `YZ` sketch plus a boolean `solid.box` (`"operation": "cut"`, `"name": "Cut_<Part>_Top_Cover_Rabbet_Relief"`) removing the upper-rear interference zone while preserving the lower **Undercut Datum Contact Toe**. |
|
||||
| *"Make the boss flush with the arm so it lies flat on the bed"* | **Coplanar Flush Boss (`Flush_Spool_Boss`)** | Extrude the side web and the coaxial `solid.cylinder` boss from the exact same datum plane `x0` with identical `"distance"` / `"height": "side_arm_w"` (`"operation": "join"`) so the outer plane has **zero stickout** and serves as the flat print-bed datum. |
|
||||
| *"Wrap around the corner so it can't rotate"* | **Orthogonal Anti-Rotation Return Flange (`Return_Flange`)** | Create a `YZ` sketch at the outer side datum plane spanning the front bearing pad and extrude across the orthogonal front pillar width (`"distance": "front_leg_w"`, `"operation": "join"`). |
|
||||
| *"Hook over from the top"* | **Interlocking Cleat Tang & Shrouded Clevis Saddle (`Cleat_Tang` / `Clevis_Saddle`)** | Model an upward **Male Cleat Tang** + **Rear Receiver Channel** + **Lower Bearing Shoulder** on the lower return flange, and a mating **Female Clevis Saddle** + **Axial Retention End-Cheeks** on the upper cantilever rail. |
|
||||
| *"Rest on a lip with drop-in dovetails (no separate bowties)"* | **Shouldered Half-Lap Dovetail Ledger (`Blind_Dovetail_Mortise` / `Dovetail_Tenon`)** | Cut **Blind (Stopped) Female Dovetail Mortises** (`Sketch_<Part>_Dovetail_Mortise` + `solid.extrude` `"cut"`) into the top half of a solid lower **Bearing Ledger**, and extrude **Integral Male Dovetail Tenons** (`0.20 mm` clearance allowance) on the mating spreader beam ends. |
|
||||
| *"Open up a tight hole by 0.5 mm"* | **Slip-Fit Bore Allowance (`Slip_Fit_Bore` + `Flange_Counterbore`)** | Update the user parameter `spool_bore_r` (or `mount_bore_r`) via `parameters.add` / `parameters.set` and cut with coaxial `solid.cylinder` features (`Cut_<Part>_Flange_Counterbore` + `Cut_<Part>_Barrel_Bore`). |
|
||||
|
||||
---
|
||||
|
||||
## 3. CLI Reference & Coordinate Plane Mapping
|
||||
|
||||
1. **Step-by-Step Native Parametric Modeling (`run`)**:
|
||||
```bash
|
||||
<solidcraft_cli_path> run <script.json> --results --json-out <report.json>
|
||||
```
|
||||
- **2D Sketches on Custom Planes (`sketch.create`)**:
|
||||
- **`YZ` Plane at $X = x_0$** (2D `(u, v)` maps 1:1 to world `(Y, Z)`, extrudes along $+X$):
|
||||
`{"origin": [x0, 0.0, 0.0], "x_dir": [0.0, 1.0, 0.0], "y_dir": [0.0, 0.0, 1.0]}`
|
||||
- **`XY` Plane at $Z = z_0$** (2D `(u, v)` maps 1:1 to world `(X, Y)`, extrudes along $+Z$):
|
||||
`{"origin": [0.0, 0.0, z0], "x_dir": [1.0, 0.0, 0.0], "y_dir": [0.0, 1.0, 0.0]}`
|
||||
- **`XZ` Plane at $Y = y_0$** (2D `(u, v)` maps 1:1 to world `(X, Z)`):
|
||||
`{"origin": [0.0, y0, 0.0], "x_dir": [1.0, 0.0, 0.0], "y_dir": [0.0, 0.0, 1.0]}`
|
||||
2. **Instant B-Rep & Timeline Audit (`eval` / `inspect`)**:
|
||||
```bash
|
||||
<solidcraft_cli_path> eval CAD/SolidCraft/<part_or_assembly>.solidcraft
|
||||
```
|
||||
Verify `"params"`, `"sketches"` (`"status": "solved"`), `"timeline"` (`"error": null`), and `"bodies"`.
|
||||
3. **In-Place Parameter Revision Without Re-Engineering**:
|
||||
```json
|
||||
{
|
||||
"commands": [
|
||||
{"command": "file.open", "params": {"path": "CAD/SolidCraft/<PartName>.solidcraft"}},
|
||||
{"command": "parameters.set", "params": {"name": "spool_bore_r", "expression": "26.0 mm"}},
|
||||
{"command": "timeline.rebuild", "params": {}},
|
||||
{"command": "file.export", "params": {"path": "CAD/3MF/<PartName>.3mf", "format": "3mf-tagged"}},
|
||||
{"command": "file.save", "params": {"path": "CAD/SolidCraft/<PartName>.solidcraft", "preview": true}}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
---
|
||||
name: svg-blueprint-drafter
|
||||
description: Orthographic 1:1 millimeter (1 px = 1 mm) 2D engineering blueprint creation and editing skill using FigCraft (figcraft-cli), CadCraft (cadcraft-cli), and SVG for any CAD project (<ProjectName>_Blueprints.figcraft, <ProjectName>_Side_View.svg, <ProjectName>_Front_View.svg, <ProjectName>_Top_View.svg, CAD/DXF/*.dxf).
|
||||
---
|
||||
|
||||
# Orthographic 1:1 mm FigCraft, CadCraft DXF & SVG Engineering Blueprint Skill (`svg-blueprint-drafter`)
|
||||
|
||||
Use this skill as the **mandatory first design stage** when creating or modifying 1:1 millimeter (`1 px = 1 mm`) third-angle orthographic 2D engineering drawings and blueprint boards (`<ProjectName>_Blueprints.figcraft`, `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, and `CAD/DXF/<ProjectName>_*_View.dxf`) for **any CAD project**.
|
||||
|
||||
> **CRITICAL RULE: Blueprint-First Iteration Gate**: Always draft ONLY the 2D orthographic blueprints first and **stop for user review and iteration** before creating any 3D CAD files (`.solidcraft`, `.FCStd`, `.step`, `.stl`, `.3mf`).
|
||||
|
||||
---
|
||||
|
||||
## 0. Step 0: CAD Toolchain & Target Use-Case Intake (Check `.cad-tools.json` or Ask User)
|
||||
|
||||
Before starting a new blueprint or running external CAD tools, check if `.cad-tools.json` exists in the project or workspace root. If it does not exist (and the user has not already specified their tools/target in the prompt), **ask the user** (via `ask_question` or direct prompt):
|
||||
1. **Which 2D/3D CAD tools are available on your system, and what are their paths/commands?**
|
||||
- **SolidCraft CLI (`solidcraft-cli`)**: Path to executable (configured in `.cad-tools.json`)?
|
||||
- **CadCraft 2D CLI (`cadcraft-cli`)**: Path to executable (for `.dxf`, `.svg`, `.png` CAD drafting)?
|
||||
- **FigCraft CLI (`figcraft-cli`)**: Path to executable (for `.figcraft` boards, `.svg`/`.pdf`/`.png` blueprint sheets & conversions)?
|
||||
- **FreeCAD Headless (`FreeCADCmd`)**: Flatpak (`flatpak run --command=FreeCADCmd org.freecad.FreeCAD`), native `freecadcmd`, AppImage path, or `null`?
|
||||
2. **Will this model be 3D printed, or is it for another target (e.g., Game Design / 3D Asset, Mixed-Media Relief Sculpture, CNC / Sheet Metal, or Unconstrained CAD)?**
|
||||
- **If 3D Printed (`"is_3d_printed": true`)**: Ask for the target 3D printer's maximum build volume $(X \text{ x } Y \text{ x } Z\text{ mm})$ and design modular part splits and coplanar build-plate datum faces to fit the bed.
|
||||
- **If NOT 3D Printed (`"is_3d_printed": false`)**: Do **not** impose 3D printer bed size limits or split parts for bed fit (`"printer_max_bed_mm": null`, `"safe_part_limit_mm": null`).
|
||||
3. Save the answers to `.cad-tools.json` in the project root so all skills and subagents use the configured paths and target rules without searching the filesystem.
|
||||
|
||||
---
|
||||
|
||||
## 1. Translating User Descriptions into Standard Mechanical Engineering & CAD Terminology
|
||||
|
||||
Users often describe mechanical solutions in intuitive, everyday language. As a CAD & Mechanical Engineering specialist, you must immediately recognize these informal descriptions, map them to formal **ASME Y14.5 / ISO GD&T and DFM (Design for Manufacturability)** concepts, and implement them with engineering precision:
|
||||
|
||||
| User's Everyday Description | Formal Mechanical Engineering & CAD Terminology | How to Engineer It in 2D Blueprints & 3D CAD |
|
||||
| :--- | :--- | :--- |
|
||||
| *"Reverse L shape / notch at the top back to clear a cover that overhangs the front by 5 mm"* | **Stepped Edge Relief (`Rabbet` / `Rebate Cut`) above an Undercut Datum Contact Toe** | Step the upper-rear profile forward by $\text{Overhang} + 1.0\text{ mm}$ clearance (e.g., $6.0\text{ mm}$) down to $\text{Depth} + 1.0\text{ mm}$ (e.g., $5.0\text{ mm}$ below top datum), while extending the lower vertical leg back to $Y = 0.2\text{ mm}$ so it bears against the primary machine datum wall below the cover lip. |
|
||||
| *"Make the round hole part flush with the arm so it's flat on the bed to print"* | **Coplanar Build-Plate Datum Face / Zero-Stickout Flush Boss ($Z_{\text{print}} = 0$)** | Set the axial width of cylindrical bosses/rings equal to the structural web thickness and align their outer faces on a single coplanar datum plane ($\Delta X = 0\text{ mm}$). Eliminates out-of-plane boss stickout and print supports. |
|
||||
| *"Wrap the part around the front corner so it can't rotate on the round peg"* | **Orthogonal Anti-Rotation Return Flange & Moment-Resisting Reaction Pad** | A single cylindrical bore on a round boss is a 1-DOF revolute joint. Extending a $90^\circ$ return flange around the chassis corner onto an orthogonal datum face constrains rotation ($\theta = 0$) and resolves cantilevered bending moment ($M = F \cdot d$) into a tension-at-pin / compression-at-pad force couple. |
|
||||
| *"Have the top bracket hook straight down over the front leg to hold the shelf"* | **Interlocking Cleat & Clevis Gravity Joint (Upward Hook Tang + Shrouded Captive End-Cheeks + Lower Bearing Shoulder)** | The lower column terminates in an upward **Male Cleat Tang** with a rear **Receiver Channel** and a lower **Horizontal Bearing Shoulder (Step Ledge)**. The upper cantilever rail drops straight down via a mating **Female Clevis Saddle** flanked by **Axial Retention End-Cheeks** that lock the lower brace against sliding off its mounting boss. |
|
||||
| *"Add a bridge piece to raise the platform while reusing the already-printed lower sides"* | **Intermediate Vertical Front-Pillar Riser Bridge (Bottom Female Clevis Saddle to Upper Male Cleat Tang)** | A vertical column that hooks onto the existing lower part's top J-Hook cleat via an identical bottom **Female Clevis Saddle** + **Outer Lateral Capture Cheek**, rises along the structural pillar outside keep-out zones, and replicates the **Male J-Hook Cleat** at the elevated datum height. |
|
||||
| *"Have a lip that the middle piece rests on with dovetails on top instead of separate bowties"* | **Shouldered Half-Lap Dovetail Ledger Joint (Integral Drop-In Dovetail Tenons in Blind/Stopped Mortises)** | The mating edge is stepped horizontally into a **Lower Half-Lap Bearing Ledger** (supporting vertical shear in direct compression) and an upper wall housing **Blind (Stopped) Female Dovetail Mortises**. The spanning truss features **Integral Male Dovetail Tenons** that drop vertically into the blind mortises, locking tension and racking with zero loose butterfly/dutchman keys. |
|
||||
| *"Hold the power supply or board in place with overhangs or clips"* | **Cantilever Snap-Fit Retention Clips & Overhang Ledges with Lead-In Chamfers** | Vertical cradle walls with inward-projecting cantilever hook ledges ($1.5\text{ to }2.5\text{ mm}$ catch overhang) and $30^\circ\text{--}45^\circ$ top lead-in insertion chamfers that deflect elastically during insertion and snap over the top face of the PSU/PCB. |
|
||||
| *"Funnel air from a 120mm fan into a narrower heatsink and across the back"* | **Converging Static-Pressure Plenum Shroud & Split-Bypass Backplate Cooling Channel** | A sealed converging transition duct channeling axial fan discharge into longitudinal heatsink fin tunnels without bypass leakage, paired with a rear plenum channel sweeping boundary-layer air across the backplate. |
|
||||
| *"Open up the hole by 0.5 mm radius because it's too tight"* | **FDM Bore Shrinkage Allowance & Free-Running Slip-Fit Clearance ($\Delta R = +0.50\text{ to }+0.80\text{ mm}$) with Counterbore Relief** | Increase the nominal bore radius by $+0.50\text{ to }+0.80\text{ mm}$ ($+1.0\text{ to }+1.6\text{ mm}$ diametral clearance) to compensate for FDM inner-perimeter chordal error and seam bulge, paired with a coaxial **Counterbore** clearing the mounting base flange. |
|
||||
| *"Triangle side arm with cutouts and an X-frame in the middle"* | **Triangulated Cantilever Gusset with Truss Lightening Pockets & X-Braced Space-Frame Spreader Beam** | Use triangulated diagonal compression struts with internal **Web Lightening Pockets** (triangular truss windows with generous corner radii) and an open **X-Braced Diagonal Cross-Member** with **Counterbored Elastomeric Foot Spotfaces**. |
|
||||
|
||||
---
|
||||
|
||||
## 2. Two-Folder Blueprint Organization (`Drafts/` vs. `Working Drafts/`), `History/Steps.md`, & Orthographic Naming
|
||||
|
||||
To keep blueprint review and project traceability clean inside `<ProjectDir>/`:
|
||||
1. **Multi-Option Exploration (`<ProjectDir>/Drafts/`)**:
|
||||
- Whenever there is more than one design option under consideration, generate all candidate option blueprints inside `<ProjectDir>/Drafts/` (e.g., `<ProjectDir>/Drafts/<ProjectName>_Option1_<Tag>_Side_View.svg`, `<ProjectName>_Option2_<Tag>_Side_View.svg`, etc.).
|
||||
2. **Active Selected & Iterated Design (`<ProjectDir>/Working Drafts/` & `<ProjectDir>/`)**:
|
||||
- Once the user selects an option (or when iterating on a single chosen design), place the active orthographic blueprints inside `<ProjectDir>/Working Drafts/` and `<ProjectDir>/` (`<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`) and iterate on them there until approved for 3D CAD.
|
||||
3. **Project Step & Iteration History (`<ProjectDir>/History/Steps.md` & `<ProjectDir>/Steps.md`)**:
|
||||
- On every user ask and design step, append a new entry to `<ProjectDir>/History/Steps.md` (and `<ProjectDir>/Steps.md`) summarizing **only** the project-specific ask and design/file updates (omitting meta-updates to workspace agent/skill files) in the exact format:
|
||||
```markdown
|
||||
Step X
|
||||
User Ask:
|
||||
<Summary of user request>
|
||||
Updates:
|
||||
<Summary of design, dimension, direction, and file updates>
|
||||
```
|
||||
|
||||
| Orthographic View | Active Working Blueprint (`Working Drafts/` & Root) | Multi-Option Exploration (`Drafts/`) | DXF Filename (`cadcraft_cli`) | Projected World Axes |
|
||||
| :--- | :--- | :--- | :--- | :--- |
|
||||
| **Side View (Right/Left Profile)** | `<ProjectName>_Side_View.svg` | `Drafts/<ProjectName>_Option<N>_<Tag>_Side_View.svg` | `CAD/DXF/<ProjectName>_Side_View.dxf` | **World $(X, Z)$ or $(Y, Z)$** |
|
||||
| **Front View (Front/Section Elevation)** | `<ProjectName>_Front_View.svg` | `Drafts/<ProjectName>_Option<N>_<Tag>_Front_View.svg` | `CAD/DXF/<ProjectName>_Front_View.dxf` | **World $(Y, Z)$ or $(X, Z)$** |
|
||||
| **Top View (Plan View)** | `<ProjectName>_Top_View.svg` | `Drafts/<ProjectName>_Option<N>_<Tag>_Top_View.svg` | `CAD/DXF/<ProjectName>_Top_View.dxf` | **World $(X, Y)$** |
|
||||
|
||||
---
|
||||
|
||||
## 3. Core Orthographic Blueprint Rules (`1 px = 1 mm`)
|
||||
|
||||
1. **Strict 1:1 Millimeter Scale**:
|
||||
- Every coordinate, width, height, radius, and path segment in the SVG must be drawn at **`1 SVG user unit (px) = 1.0 mm`**.
|
||||
- Include a background millimeter grid (`<pattern id="mmGrid" width="50" height="50">` with $10\text{ mm}$ minor lines and $50\text{ mm}$ major lines) so any measurement can be visually verified against the grid.
|
||||
2. **Unified 3D World Coordinate Datums $(X, Y, Z)$ Across All 3 Views**:
|
||||
- Define a clear, physical 3D origin $(X=0, Y=0, Z=0)$ anchored to the primary mating hardware features (e.g., machine centerline $X = 0$, front or mounting datum face $Y = 0$, top crown or reference deck $Z = 0$).
|
||||
- Every feature coordinate must satisfy exact projection identity across views:
|
||||
- $X_{\text{Front}} \equiv X_{\text{Top}}$
|
||||
- $Y_{\text{Side}} \equiv Y_{\text{Top}}$
|
||||
- $Z_{\text{Side}} \equiv Z_{\text{Front}}$
|
||||
3. **Design for Manufacturability (DFM) & Assembly Constraints**:
|
||||
- **When `"is_3d_printed": true` (Additive Manufacturing Mode)**:
|
||||
- **Single-Piece Print Bed Envelope**: Every modular component's 3D bounding box $(W, D, H)$ must fit within the user's configured `safe_part_limit_mm` in `.cad-tools.json`.
|
||||
- **Coplanar Build-Plate Datum Face**: Design each printed part with at least one completely flat, unencumbered outer face (`0.0 mm` boss stickout) so it lies directly on the print bed without supports.
|
||||
- **When `"is_3d_printed": false` (Game Design / Sculpture / CNC / General CAD Mode)**:
|
||||
- **No Print-Bed Splitting Required**: Do not split components to fit a 3D printer build volume unless modular assembly is explicitly requested by the user.
|
||||
- **Clearance & Keep-Out Envelopes (All Modes)**: Explicitly draw dashed outlines for moving lids, doors, screens, cables, or mating hardware and verify positive clearance in all views.
|
||||
|
||||
---
|
||||
|
||||
## 4. Standard SVG Layer & Visual Styling Architecture
|
||||
|
||||
Structure every `<ProjectName>_*_View.svg` into clean, semantic `<g>` groups from back to front:
|
||||
1. `<defs>`: CSS stylesheet, arrow markers (`#arrow-start`, `#arrow-end`, `#arrow-force`), and `#mmGrid` pattern.
|
||||
2. **Background & Header Block**: Dark engineering slate canvas (`#0f172a`), millimeter grid rect, title, scale (`1 px = 1 mm`), and datum summary.
|
||||
3. **Host Machine / Reference Environment Group (`id="host-reference-*"`)**: Reference hardware body, doors, screens, mounting bosses, and overhanging covers/bezels.
|
||||
4. **Payload / Supported Equipment Group (`id="payload-*"`)**: Supported device envelope, mounting feet/fasteners, and gravity/load vectors (`class="force-line"`).
|
||||
5. **Designed CAD Assembly Group (`id="<project>-parts-*"`)**: Distinct color-coded classes for each structural part (`Part A`, `Part B`, `Part C`, `Part D`, etc.), plus dashed joint interface lines (`class="joint-line"`).
|
||||
6. **Engineering Dimensions & Callouts (`id="dimensions-*"`)**: Extension lines (`class="dim-ext"`), double-arrow dimension lines (`class="dim-line"`), and bold monospace millimeter labels (`class="dim-text"`).
|
||||
7. **Footer Legend & Part Summary**: Color swatches and exact bounding-box dimensions ($W \text{ x } D \text{ x } H\text{ mm}$) for every part.
|
||||
|
||||
---
|
||||
|
||||
## 5. Automated Blueprint & Vector Authoring with `figcraft-cli` and `cadcraft-cli`
|
||||
|
||||
When **FigCraft (`figcraft_cli`)** or **CadCraft (`cadcraft_cli`)** is configured in `.cad-tools.json`, you can construct editable, parametric 2D vector blueprints, multi-view presentation boards, and CAD `.dxf` drawings programmatically:
|
||||
|
||||
### A. FigCraft (`figcraft-cli`) Vector Blueprints, 2D Booleans & Multi-View Blueprint Boards
|
||||
Use `figcraft_cli` to build an interactive `<ProjectName>_Blueprints.figcraft` master board containing all three orthographic views (`Side_View`, `Front_View`, `Top_View`), dimension callouts, BOM/parameter tables, and embedded 3D renders:
|
||||
|
||||
1. **CLI Commands**:
|
||||
```bash
|
||||
# Execute a JSON command script and save native .figcraft file
|
||||
<figcraft_cli_path> run <blueprint_script.json> --out <ProjectName>_Blueprints.figcraft
|
||||
|
||||
# Export individual top-level frames (Side_View, Front_View, Top_View) to SVG, PNG, or multi-page PDF
|
||||
<figcraft_cli_path> export <ProjectName>_Blueprints.figcraft -o . --format svg
|
||||
<figcraft_cli_path> export <ProjectName>_Blueprints.figcraft -o . --format png --scale 2
|
||||
<figcraft_cli_path> render <ProjectName>_Blueprints.figcraft -o <ProjectName>_Blueprint_Sheet.png --scale 2
|
||||
```
|
||||
2. **Core `figcraft-cli run` Commands for Blueprint Drafting**:
|
||||
- **Orthographic View Frames & Grids (`frame.create`, `grid.add`, `node.set`)**:
|
||||
- Create top-level frames named `<ProjectName>_Side_View`, `<ProjectName>_Front_View`, and `<ProjectName>_Top_View` at `1 px = 1 mm` scale with dark blueprint fill (`#0f172a`).
|
||||
- Attach $10\text{ mm}$ minor and $50\text{ mm}$ major grids via `grid.add` (`{"kind": "grid", "size": 10, "color": "#1e293b"}`).
|
||||
- **Vector Primitives & Point Polygons (`shape.*`, `vector.create`, `vector.offset`)**:
|
||||
- `shape.rectangle`: `{x, y, width, height, parent, props: {name, fill, stroke, strokeWeight, cornerRadius}}` (Supports per-corner radii `[tl, tr, br, bl]` for fillets and rabbets!).
|
||||
- `shape.ellipse`: `{x, y, width, height, parent, props: {name, fill, stroke, strokeWeight, dashes}}` (For bores, counterbores, and spotfaces).
|
||||
- `vector.create`: `{points: [[x1, y1], [x2, y2], ...], closed: true, parent, props: {name, fill, stroke, strokeWeight}}` (Pass exact 2D millimeter coordinates `[[u, v], ...]` directly).
|
||||
- `vector.offset`: `{ids, offset}` (Generate uniform wall thicknesses, perimeter shells, or clearance envelopes).
|
||||
- **Native 2D Boolean Operations (`bool.union`, `bool.subtract`, `bool.intersect`, `bool.exclude`, `bool.flatten`)**:
|
||||
- Construct complex 2D part silhouettes by combining outer profiles with cut shapes (bores, counterbores, rabbet reliefs, blind dovetail mortises, truss lightening pockets) using `bool.subtract` or `bool.union`.
|
||||
- **Dimensions, Callout Arrows & Engineering Tables (`shape.line`, `shape.arrow`, `board.connector`, `text.create`, `board.table`)**:
|
||||
- Use `shape.arrow` or `board.connector` (`style: "straight" | "elbow"`, `startCap: "triangleArrow"`, `endCap: "triangleArrow"`, `label: "245.0 mm"`) for dimension lines and leader callouts.
|
||||
- Use `board.table` (`{rows, columns, cells: [["Part", "Dimensions (mm)", "Qty", "Notes"], ...], x, y}`) to auto-build clean Title Blocks, Revision Schedules, and Bill of Materials (BOM) tables.
|
||||
- Use `image.place` (`{path: "CAD/SolidCraft/<ProjectName>_Studio_Render.png", x, y, width, height, mode: "fit"}`) to embed reference ruler photos or SolidCraft Vulkan GPU renders directly onto the blueprint sheet.
|
||||
- **Batching & Exporting Inside a Script (`file.save`, `file.export`, `file.exportFramesPdf`)**:
|
||||
- Save the native editable document with `{"command": "file.save", "params": {"path": "<ProjectName>_Blueprints.figcraft", "overwrite": true}}`.
|
||||
- Export each view frame to `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg` via `file.export` (`{"ids": [frame_id], "format": "svg", "path": "<ProjectName>_Side_View.svg"}`) and export a print-ready multi-page engineering PDF via `file.exportFramesPdf` (`{"path": "<ProjectName>_Blueprints.pdf"}`).
|
||||
|
||||
### B. CadCraft 2D (`cadcraft-cli`) Precision 1:1 mm DXF/DWG CAD Drafting
|
||||
When `cadcraft_cli` is configured in `.cad-tools.json`, generate native 1:1 mm CAD `.dxf`, `.dwg`, `.svg`, `.png`, and `.pdf` sheets in `CAD/DXF/`:
|
||||
```bash
|
||||
<cadcraft_cli_path> run --metric <dxf_script.json>
|
||||
<cadcraft_cli_path> convert CAD/DXF/<ProjectName>_Full_Assembly.dxf CAD/DXF/<ProjectName>_Full_Assembly.pdf
|
||||
```
|
||||
Using `layer.new`, `line`, `polyline`, `circle`, `arc`, `dim.linear`, `dim.radius`, `dim.diameter`, `text`, and `file.export`.
|
||||
|
||||
Reference in New Issue
Block a user