Universal CAD Quality Assurance, Metrology & DFM Inspector Skill (`cad-qa-inspector`)
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.
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:
- Check if
.cad-tools.jsonexists in the workspace or project root (or if tool paths and target use case are already documented inAGENTS.md). - If
.cad-tools.jsonis missing or incomplete, ask the user (using theask_questiontool 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-clion$PATH,/mnt/bulk/CraftApps/solidcraft/solidcraft-cli, or custom path) for step-by-step.solidcraftfeature timelines,.3mf/.obj/.step/.stlexports, B-repinspect.interference/inspect.clearance, and Vulkan GPU renders. - CadCraft 2D (
cadcraft-cli): Path to binary (e.g.,cadcraft-clion$PATH,/mnt/bulk/CraftApps/cadcraft/cadcraft-cli, or not installed) for native 1:1 mm.dxf,.svg, and.pngblueprint export. - FigCraft (
figcraft-cli): Path to binary (configured in.cad-tools.jsonor not installed) for.figcraftboards,.svg/.pdf/.pngblueprint presentation sheets, and headless rendering. - FreeCAD Headless (
FreeCADCmd): Invocation command (e.g.,flatpak run --command=FreeCADCmd org.freecad.FreeCAD, nativefreecadcmd, AppImage path, ornullwhen using SolidCraft + CadCraft/FigCraft only) for OpenCASCADE.step/.stl/.FCStdmodeling and boolean verification.
- SolidCraft (
- 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": nulland"safe_part_limit_mm": nullin.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.
- If Yes (3D Printed,
- Q1: Available 3D & 2D CAD Tools: Which of the following tools are installed, and where are their executables located?
- Save the confirmed configuration to
.cad-tools.jsonin the project root:{ "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
- 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/**orSourceImages/**). - 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).
- Inspect EXIF orientation tags (
- 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.figcraftwhen used) are valid XML/documents with1 px = 1 mmscale 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.
- Verify
- 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).
- 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.
- Step-by-Step Parametric Timeline Audit (
SolidCraft&FreeCAD):- Run
<solidcraft_cli> eval CAD/SolidCraft/<PartOrAssembly>.solidcraftand 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 zerofile.insert_stepshortcuts for designed parts).
- All tunable fit dimensions and thicknesses are defined in
- When FreeCAD is enabled, verify
CAD/<ProjectName>_Full_Assembly.FCStdcontains a top-levelParamsSpreadsheet::Sheetand individualPartDesign::Bodyfeature trees.
- Run
- Exact B-Rep Zero-Interference Audit (
0.0000 mm³Clash):- Confirm
0interferences insolidcraft-cli(inspect.interference) and \(0.0000\text{ mm}^3\) boolean overlap in headless FreeCAD (part.common(ref).Volume < 0.001).
- Confirm
- 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_mmin.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.
- Verify every printable component's bounding box \((X, Y, Z)\) is \(\le\)
- When
"is_3d_printed": false(Game Design / Sculpture / General CAD):- Skip print-bed bounding-box limits, part-splitting checks, and print-bed orientation rules.
- When
