72 lines
7.2 KiB
Markdown
72 lines
7.2 KiB
Markdown
---
|
|
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.
|
|
|