Import CAD projects and cad-router v1
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
# Backend and artifact contract
|
||||
|
||||
## Router input
|
||||
|
||||
Capture these fields when known:
|
||||
|
||||
- Natural-language request and normalized part family.
|
||||
- Units and dimensions.
|
||||
- Manufacturing intent: machining, printing, laser cutting, simulation, or concept.
|
||||
- Required primary and secondary output formats.
|
||||
- New model versus modification, and existing source/artifact paths.
|
||||
- Part versus assembly, standard components, mating requirements, and motion relationships.
|
||||
- Required parameter controls, replay, semantic tags, or FreeCAD interchange.
|
||||
- Geometry and visual validation targets.
|
||||
|
||||
## Route decision
|
||||
|
||||
Record:
|
||||
|
||||
- `selected_backend`: `build123d`, `simplecadapi`, or `cadam`.
|
||||
- Origin project and optional executable adapter.
|
||||
- `runner_skill`: installed Skill responsible for generation.
|
||||
- Ranked backend scores and human-readable reasons.
|
||||
- Fallback order.
|
||||
- Workflow profiles such as `requirement_refinement` and `visual_repair`.
|
||||
- Focused downstream Skills.
|
||||
- Any explicit override and its reason.
|
||||
|
||||
## Task manifest
|
||||
|
||||
Write `cad-task.json` beside the task artifacts with this minimum shape:
|
||||
|
||||
```json
|
||||
{
|
||||
"schema_version": "1.0",
|
||||
"request": "Create a 120 mm connecting rod",
|
||||
"route": {
|
||||
"selected_backend": "build123d",
|
||||
"runner_skill": "cad",
|
||||
"project": "text-to-cad",
|
||||
"fallback_order": ["simplecadapi", "cadam"],
|
||||
"workflow_profiles": ["caddesigner_ecip"]
|
||||
},
|
||||
"source": {
|
||||
"path": "connecting_rod.py",
|
||||
"format": "python",
|
||||
"backend": "build123d"
|
||||
},
|
||||
"artifacts": [
|
||||
{"path": "connecting_rod.step", "role": "primary"},
|
||||
{"path": "connecting_rod.stl", "role": "secondary"}
|
||||
],
|
||||
"parameters": {},
|
||||
"assumptions": [],
|
||||
"validation": [],
|
||||
"viewer_links": []
|
||||
}
|
||||
```
|
||||
|
||||
Paths are relative to the task directory unless an external input must remain absolute.
|
||||
|
||||
## Backend adapter requirements
|
||||
|
||||
Any future executable adapter must:
|
||||
|
||||
1. Accept an explicit task directory and explicit source/output paths.
|
||||
2. Never scan or generate an entire workspace implicitly.
|
||||
3. Preserve a human-editable source of truth.
|
||||
4. Report backend name and version.
|
||||
5. Return nonzero on generation failure.
|
||||
6. Emit machine-readable artifact paths and validation facts.
|
||||
7. Avoid importing code from sibling Skill directories; call installed tools or self-contained runtimes.
|
||||
8. Keep permanent CAD artifacts under the repository `models/` root when working inside this repository.
|
||||
9. Start CAD Viewer at the task directory, not the repository-wide examples directory.
|
||||
@@ -0,0 +1,59 @@
|
||||
# Backend capabilities
|
||||
|
||||
## build123d through CAD Skill
|
||||
|
||||
Use as the default STEP-first backend.
|
||||
|
||||
Best fit:
|
||||
|
||||
- Brackets, connecting rods, cranks, levers, shafts, bushings, flanges, plates, housings, covers, enclosures, fixtures, and machined features.
|
||||
- Parametric Python sources with holes, pockets, slots, bosses, ribs, shells, fillets, chamfers, lofts, sweeps, and revolves.
|
||||
- Source-level assemblies, named datums, joints, imported components, measurements, alignment checks, and existing STEP inspection.
|
||||
- STEP primary output with STL, 3MF, or GLB sidecars.
|
||||
|
||||
Weak signals: a specialized mechanical family already implemented by SimpleCADAPI, SCAD-native output, browser-only execution, or decorative repeated CSG where OpenSCAD is substantially shorter.
|
||||
|
||||
## SimpleCADAPI
|
||||
|
||||
Use for its standard mechanical factories and replayable modeling graph.
|
||||
|
||||
Best fit:
|
||||
|
||||
- Spur, helical, and herringbone gears; internal ring gears; racks; cycloidal discs; ball bearings.
|
||||
- Planetary and cycloidal reducers, joint actuators, and mechanism-heavy assemblies.
|
||||
- Parameter expressions, operation-graph JSON, replay, semantic tags, topology queries, and FreeCAD translation.
|
||||
- Reusable mechanical product families whose formulas should become deterministic library functions.
|
||||
|
||||
Before invocation, inspect the installed package and Skill versions together. Do not mix the current single-`Solid` boolean API with older `*rsolidlist` documentation. If the installed runtime and docs disagree, stop that route and use build123d or repair the installation.
|
||||
|
||||
## CADAM
|
||||
|
||||
Use CADAM's separately installed OpenSCAD WASM runtime for fast CSG authoring and printable parameterized models. Execute generated SCAD through `scripts/cadam_compile.mjs`; do not copy CADAM's GPL runtime into this Skill.
|
||||
|
||||
Best fit:
|
||||
|
||||
- Vases, containers, knobs, adapters, printable threads, lattice/honeycomb patterns, repeated details, decorative models, and quick concept geometry.
|
||||
- SCAD source, STL output, simple projected DXF, and UI-facing parameter controls.
|
||||
- BOSL/BOSL2/MCAD-backed printable features.
|
||||
|
||||
Do not use as the primary route for editable STEP, stable face/edge references, fit-critical source-level assemblies, or modification of imported STEP.
|
||||
|
||||
## CADDesigner workflow profile
|
||||
|
||||
CADDesigner is not a fourth geometry engine. Apply its ECIP workflow to every route, then enable requirement expansion and visual repair when requirements are vague, reference images carry important intent, or visual complexity makes one-pass generation unreliable. Do not launch CADDesigner's separate LLM/Redis stack:
|
||||
|
||||
1. Refine the request into a measurable brief.
|
||||
2. Confirm important fit- or safety-critical unknowns.
|
||||
3. Generate and execute backend source.
|
||||
4. Validate deterministic geometry facts.
|
||||
5. Inspect a multi-view render against the brief.
|
||||
6. Repair visual mismatches, capped at three automatic visual rounds.
|
||||
|
||||
## Focused downstream Skills
|
||||
|
||||
- `$dxf`: 2D profiles, flat patterns, laser/plasma/waterjet drawings.
|
||||
- `$urdf`, `$srdf`, `$sdf`: robot structure, MoveIt semantics, and simulation models/worlds.
|
||||
- `$gcode`: slice validated meshes with a real slicer.
|
||||
- `$sendcutsend`: vendor-specific manufacturing preflight.
|
||||
- `$bambu-labs`: cautious local printer handoff.
|
||||
- `$cad-viewer`: visual review of supported generated artifacts.
|
||||
Reference in New Issue
Block a user