agentcad-cli 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentcad_cli-0.1.1/PKG-INFO +145 -0
- agentcad_cli-0.1.1/README.md +133 -0
- agentcad_cli-0.1.1/pyproject.toml +32 -0
- agentcad_cli-0.1.1/setup.cfg +4 -0
- agentcad_cli-0.1.1/src/agentcad/__init__.py +3 -0
- agentcad_cli-0.1.1/src/agentcad/__main__.py +4 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/__init__.py +0 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/model/README.md +46 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/model/design.json +43 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/model/params.json +5 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/model/part.py +33 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/workspace/CLAUDE.md +420 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/workspace/cadproject.json +7 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/workspace/models/.gitkeep +0 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/workspace/references/build123d-guide.md +671 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/workspace/references/images/.gitkeep +0 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/workspace/references/notes.md +3 -0
- agentcad_cli-0.1.1/src/agentcad/_templates/workspace/references/validation-strategy.md +378 -0
- agentcad_cli-0.1.1/src/agentcad/checks/__init__.py +130 -0
- agentcad_cli-0.1.1/src/agentcad/checks/mesh.py +131 -0
- agentcad_cli-0.1.1/src/agentcad/checks/relations.py +155 -0
- agentcad_cli-0.1.1/src/agentcad/checks/section.py +199 -0
- agentcad_cli-0.1.1/src/agentcad/cli.py +235 -0
- agentcad_cli-0.1.1/src/agentcad/contract.py +160 -0
- agentcad_cli-0.1.1/src/agentcad/geometry.py +417 -0
- agentcad_cli-0.1.1/src/agentcad/inspect.py +102 -0
- agentcad_cli-0.1.1/src/agentcad/jsonio.py +30 -0
- agentcad_cli-0.1.1/src/agentcad/measure.py +80 -0
- agentcad_cli-0.1.1/src/agentcad/payloads.py +24 -0
- agentcad_cli-0.1.1/src/agentcad/precheck.py +153 -0
- agentcad_cli-0.1.1/src/agentcad/probe.py +215 -0
- agentcad_cli-0.1.1/src/agentcad/render.py +166 -0
- agentcad_cli-0.1.1/src/agentcad/report.py +151 -0
- agentcad_cli-0.1.1/src/agentcad/review.py +399 -0
- agentcad_cli-0.1.1/src/agentcad/runner.py +182 -0
- agentcad_cli-0.1.1/src/agentcad/section.py +346 -0
- agentcad_cli-0.1.1/src/agentcad/stl.py +265 -0
- agentcad_cli-0.1.1/src/agentcad/templates.py +21 -0
- agentcad_cli-0.1.1/src/agentcad/validate.py +234 -0
- agentcad_cli-0.1.1/src/agentcad/workspace.py +173 -0
- agentcad_cli-0.1.1/src/agentcad_cli.egg-info/PKG-INFO +145 -0
- agentcad_cli-0.1.1/src/agentcad_cli.egg-info/SOURCES.txt +60 -0
- agentcad_cli-0.1.1/src/agentcad_cli.egg-info/dependency_links.txt +1 -0
- agentcad_cli-0.1.1/src/agentcad_cli.egg-info/entry_points.txt +2 -0
- agentcad_cli-0.1.1/src/agentcad_cli.egg-info/requires.txt +4 -0
- agentcad_cli-0.1.1/src/agentcad_cli.egg-info/top_level.txt +1 -0
- agentcad_cli-0.1.1/tests/test_checks_relations.py +37 -0
- agentcad_cli-0.1.1/tests/test_checks_section.py +20 -0
- agentcad_cli-0.1.1/tests/test_cli.py +122 -0
- agentcad_cli-0.1.1/tests/test_deliver.py +28 -0
- agentcad_cli-0.1.1/tests/test_geometry.py +206 -0
- agentcad_cli-0.1.1/tests/test_jsonio.py +28 -0
- agentcad_cli-0.1.1/tests/test_precheck_review.py +219 -0
- agentcad_cli-0.1.1/tests/test_probe.py +118 -0
- agentcad_cli-0.1.1/tests/test_render.py +32 -0
- agentcad_cli-0.1.1/tests/test_runner.py +134 -0
- agentcad_cli-0.1.1/tests/test_section.py +170 -0
- agentcad_cli-0.1.1/tests/test_stale.py +81 -0
- agentcad_cli-0.1.1/tests/test_stl.py +200 -0
- agentcad_cli-0.1.1/tests/test_validate.py +96 -0
- agentcad_cli-0.1.1/tests/test_weak_check.py +123 -0
- agentcad_cli-0.1.1/tests/test_workspace.py +177 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentcad-cli
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Agent-first CAD workflow runtime
|
|
5
|
+
Author: AgentCAD contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: <3.13,>=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: build123d
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: pytest; extra == "dev"
|
|
12
|
+
|
|
13
|
+
# AgentCAD
|
|
14
|
+
|
|
15
|
+
AgentCAD is a CLI-first CAD workflow runtime for coding agents.
|
|
16
|
+
|
|
17
|
+
It gives a coding agent a repeatable workspace, a contract-driven modeling
|
|
18
|
+
protocol, deterministic build/export, geometric measurement, multi-view
|
|
19
|
+
previews, design-time and post-build validation, and a delivery manifest —
|
|
20
|
+
so the agent can iterate on CAD models with measurable feedback instead of
|
|
21
|
+
visual intuition.
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
design contract -> precheck -> params/source -> build
|
|
25
|
+
-> measure -> render -> validate -> review -> deliver
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## What's in the box
|
|
29
|
+
|
|
30
|
+
| Stage | Command | Purpose |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| Scaffold | `agentcad new <model>` | Create model folder; auto-init workspace |
|
|
33
|
+
| Sync | `agentcad sync` | Refresh workspace scaffold from latest templates |
|
|
34
|
+
| Precheck | `agentcad precheck <model>` | Solve `design.json` statically (schema, feature coverage, `min_clearance`) **before** part.py is written |
|
|
35
|
+
| Build | `agentcad build <model>` | Run `part.py` through build123d, export STEP + STL, hash-cache stale runs |
|
|
36
|
+
| Measure | `agentcad measure <model>` | Mesh stats + structural facts (bbox, watertight, triangles, voids) |
|
|
37
|
+
| Render | `agentcad render <model>` | Iso/front/top/side/back SVG previews + Z/X/Y cross-section SVGs |
|
|
38
|
+
| Probe | `agentcad probe <model>` | Cross-section diameter / bbox / void at specified Z, X, Y; `--scan` to discover step changes |
|
|
39
|
+
| Inspect | `agentcad inspect <model>` | Three-axis scan + automatic section SVGs + suggested probes |
|
|
40
|
+
| Validate | `agentcad validate <model>` | Build + measure + render + design checks + feature coverage; auto-emits debug SVGs on failure |
|
|
41
|
+
| Review | `agentcad review <model>` | Pre-delivery checklist with pairwise relations matrix and must-view SVG list |
|
|
42
|
+
| Deliver | `agentcad deliver <model>` | Delivery manifest |
|
|
43
|
+
| Report | `agentcad report <model>` | Markdown summary of validation result |
|
|
44
|
+
|
|
45
|
+
Every command supports `--json` for stable machine-readable output; failures
|
|
46
|
+
return JSON containing `stage`, `error.type`, `error.message`.
|
|
47
|
+
|
|
48
|
+
## Validation check types
|
|
49
|
+
|
|
50
|
+
| Type | Layer | Notes |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `bbox_size` | post-build | Outer envelope dimensions |
|
|
53
|
+
| `watertight` | post-build | STL is a closed manifold |
|
|
54
|
+
| `min_triangles` | post-build | Mesh density floor |
|
|
55
|
+
| `artifact_exists` | post-build | STEP / STL / SVG present |
|
|
56
|
+
| `metadata_equals` | post-build | Asserts a value emitted from `part.py` |
|
|
57
|
+
| `outer_diameter_at_z` | post-build | Cross-section radial size at Z |
|
|
58
|
+
| `inner_diameter_at_z` | post-build | Inner cavity diameter at Z |
|
|
59
|
+
| `section_bbox_at_z` | post-build | Cross-section AABB / void detection at Z |
|
|
60
|
+
| `diameter_decreases_along_z` | post-build | Monotonicity for tapers / lead-ins |
|
|
61
|
+
| `volume_range` | post-build | Volume sanity bounds |
|
|
62
|
+
| `min_clearance` | **design-time + post-build** | Pure-shape edge-to-edge clearance between two declared shapes (no STL required) |
|
|
63
|
+
| `hole_accessibility` | post-build | Annular clearance around a hole at the working plane |
|
|
64
|
+
| `min_wall_thickness` | post-build | Minimum point-pair distance inside a defined region |
|
|
65
|
+
| `feature_position` | post-build | Assert a 3D point is `solid` or `void` |
|
|
66
|
+
| `feature_coverage` | automatic | Every declared feature must reference at least one check |
|
|
67
|
+
|
|
68
|
+
The four "geometric relation" checks (last block) close the historical gap
|
|
69
|
+
where `inner_diameter_at_z` would happily report a 4.5 mm hole that was
|
|
70
|
+
half-covered by an adjacent wall.
|
|
71
|
+
|
|
72
|
+
## Quick start
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
uv tool install agentcad-cli
|
|
76
|
+
agentcad --help
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For local development:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
uv sync
|
|
83
|
+
uv run agentcad --help
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Quick example
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
uv run agentcad new bracket --project /tmp/my-cad-project
|
|
90
|
+
cd /tmp/my-cad-project
|
|
91
|
+
|
|
92
|
+
# 1. Design-time: solve the contract before writing geometry
|
|
93
|
+
uv run agentcad precheck bracket --json
|
|
94
|
+
|
|
95
|
+
# 2. Implement part.py, then run the post-build pipeline
|
|
96
|
+
uv run agentcad validate bracket --json
|
|
97
|
+
|
|
98
|
+
# 3. Pre-delivery review (relations matrix + must-view SVGs)
|
|
99
|
+
uv run agentcad review bracket --json
|
|
100
|
+
|
|
101
|
+
# 4. Deliver
|
|
102
|
+
uv run agentcad deliver bracket --json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The default generated model is a simple build123d cuboid. Agent rules and
|
|
106
|
+
common-error catalog live in `AGENTS.md`, `CLAUDE.md`, and `references/`
|
|
107
|
+
(always-on reference docs for build123d patterns and validation strategy).
|
|
108
|
+
|
|
109
|
+
## Examples
|
|
110
|
+
|
|
111
|
+
| Path | What it shows |
|
|
112
|
+
|---|---|
|
|
113
|
+
| `examples/fan-adapter-8025/` | Two validated models: a fan-to-duct adapter and a magnetic outlet plate |
|
|
114
|
+
| `examples/iphone15pro-case/` | Real-world phone case with multi-cutouts + section validation |
|
|
115
|
+
| `examples/e2e-test/` | Sub-agent end-to-end test: design → precheck → build → validate → review on a mounting bracket |
|
|
116
|
+
|
|
117
|
+
Re-run any example:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
cd examples/fan-adapter-8025
|
|
121
|
+
uv run agentcad validate fan_duct_adapter_8025 --json
|
|
122
|
+
uv run agentcad review fan_duct_adapter_8025 --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Tests
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
uv run pytest -v
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
125 tests at last count, covering CLI dispatch, workspace scaffolding, STL
|
|
132
|
+
reading and measurement, section extraction and SVG rendering, JSON IO,
|
|
133
|
+
post-build validation checks, weak-check warnings, stale build detection,
|
|
134
|
+
geometric primitives, and `precheck` / `review` integration.
|
|
135
|
+
|
|
136
|
+
## Documentation
|
|
137
|
+
|
|
138
|
+
- [`docs/DESIGN.md`](docs/DESIGN.md) — architecture, first principles, and
|
|
139
|
+
V0–V5 iteration roadmap (with delivered milestones marked).
|
|
140
|
+
- [`docs/STATUS.md`](docs/STATUS.md) — current implementation state, recent
|
|
141
|
+
lessons (build123d traps, hole-wall interference), and the planned next
|
|
142
|
+
research and engineering work.
|
|
143
|
+
- `AGENTS.md` / `CLAUDE.md` (workspace) — operating rules for the coding
|
|
144
|
+
agent, including the mandatory TDD red/green workflow and the common
|
|
145
|
+
design-error catalog.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# AgentCAD
|
|
2
|
+
|
|
3
|
+
AgentCAD is a CLI-first CAD workflow runtime for coding agents.
|
|
4
|
+
|
|
5
|
+
It gives a coding agent a repeatable workspace, a contract-driven modeling
|
|
6
|
+
protocol, deterministic build/export, geometric measurement, multi-view
|
|
7
|
+
previews, design-time and post-build validation, and a delivery manifest —
|
|
8
|
+
so the agent can iterate on CAD models with measurable feedback instead of
|
|
9
|
+
visual intuition.
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
design contract -> precheck -> params/source -> build
|
|
13
|
+
-> measure -> render -> validate -> review -> deliver
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## What's in the box
|
|
17
|
+
|
|
18
|
+
| Stage | Command | Purpose |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| Scaffold | `agentcad new <model>` | Create model folder; auto-init workspace |
|
|
21
|
+
| Sync | `agentcad sync` | Refresh workspace scaffold from latest templates |
|
|
22
|
+
| Precheck | `agentcad precheck <model>` | Solve `design.json` statically (schema, feature coverage, `min_clearance`) **before** part.py is written |
|
|
23
|
+
| Build | `agentcad build <model>` | Run `part.py` through build123d, export STEP + STL, hash-cache stale runs |
|
|
24
|
+
| Measure | `agentcad measure <model>` | Mesh stats + structural facts (bbox, watertight, triangles, voids) |
|
|
25
|
+
| Render | `agentcad render <model>` | Iso/front/top/side/back SVG previews + Z/X/Y cross-section SVGs |
|
|
26
|
+
| Probe | `agentcad probe <model>` | Cross-section diameter / bbox / void at specified Z, X, Y; `--scan` to discover step changes |
|
|
27
|
+
| Inspect | `agentcad inspect <model>` | Three-axis scan + automatic section SVGs + suggested probes |
|
|
28
|
+
| Validate | `agentcad validate <model>` | Build + measure + render + design checks + feature coverage; auto-emits debug SVGs on failure |
|
|
29
|
+
| Review | `agentcad review <model>` | Pre-delivery checklist with pairwise relations matrix and must-view SVG list |
|
|
30
|
+
| Deliver | `agentcad deliver <model>` | Delivery manifest |
|
|
31
|
+
| Report | `agentcad report <model>` | Markdown summary of validation result |
|
|
32
|
+
|
|
33
|
+
Every command supports `--json` for stable machine-readable output; failures
|
|
34
|
+
return JSON containing `stage`, `error.type`, `error.message`.
|
|
35
|
+
|
|
36
|
+
## Validation check types
|
|
37
|
+
|
|
38
|
+
| Type | Layer | Notes |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| `bbox_size` | post-build | Outer envelope dimensions |
|
|
41
|
+
| `watertight` | post-build | STL is a closed manifold |
|
|
42
|
+
| `min_triangles` | post-build | Mesh density floor |
|
|
43
|
+
| `artifact_exists` | post-build | STEP / STL / SVG present |
|
|
44
|
+
| `metadata_equals` | post-build | Asserts a value emitted from `part.py` |
|
|
45
|
+
| `outer_diameter_at_z` | post-build | Cross-section radial size at Z |
|
|
46
|
+
| `inner_diameter_at_z` | post-build | Inner cavity diameter at Z |
|
|
47
|
+
| `section_bbox_at_z` | post-build | Cross-section AABB / void detection at Z |
|
|
48
|
+
| `diameter_decreases_along_z` | post-build | Monotonicity for tapers / lead-ins |
|
|
49
|
+
| `volume_range` | post-build | Volume sanity bounds |
|
|
50
|
+
| `min_clearance` | **design-time + post-build** | Pure-shape edge-to-edge clearance between two declared shapes (no STL required) |
|
|
51
|
+
| `hole_accessibility` | post-build | Annular clearance around a hole at the working plane |
|
|
52
|
+
| `min_wall_thickness` | post-build | Minimum point-pair distance inside a defined region |
|
|
53
|
+
| `feature_position` | post-build | Assert a 3D point is `solid` or `void` |
|
|
54
|
+
| `feature_coverage` | automatic | Every declared feature must reference at least one check |
|
|
55
|
+
|
|
56
|
+
The four "geometric relation" checks (last block) close the historical gap
|
|
57
|
+
where `inner_diameter_at_z` would happily report a 4.5 mm hole that was
|
|
58
|
+
half-covered by an adjacent wall.
|
|
59
|
+
|
|
60
|
+
## Quick start
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
uv tool install agentcad-cli
|
|
64
|
+
agentcad --help
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
For local development:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
uv sync
|
|
71
|
+
uv run agentcad --help
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Quick example
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv run agentcad new bracket --project /tmp/my-cad-project
|
|
78
|
+
cd /tmp/my-cad-project
|
|
79
|
+
|
|
80
|
+
# 1. Design-time: solve the contract before writing geometry
|
|
81
|
+
uv run agentcad precheck bracket --json
|
|
82
|
+
|
|
83
|
+
# 2. Implement part.py, then run the post-build pipeline
|
|
84
|
+
uv run agentcad validate bracket --json
|
|
85
|
+
|
|
86
|
+
# 3. Pre-delivery review (relations matrix + must-view SVGs)
|
|
87
|
+
uv run agentcad review bracket --json
|
|
88
|
+
|
|
89
|
+
# 4. Deliver
|
|
90
|
+
uv run agentcad deliver bracket --json
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The default generated model is a simple build123d cuboid. Agent rules and
|
|
94
|
+
common-error catalog live in `AGENTS.md`, `CLAUDE.md`, and `references/`
|
|
95
|
+
(always-on reference docs for build123d patterns and validation strategy).
|
|
96
|
+
|
|
97
|
+
## Examples
|
|
98
|
+
|
|
99
|
+
| Path | What it shows |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `examples/fan-adapter-8025/` | Two validated models: a fan-to-duct adapter and a magnetic outlet plate |
|
|
102
|
+
| `examples/iphone15pro-case/` | Real-world phone case with multi-cutouts + section validation |
|
|
103
|
+
| `examples/e2e-test/` | Sub-agent end-to-end test: design → precheck → build → validate → review on a mounting bracket |
|
|
104
|
+
|
|
105
|
+
Re-run any example:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
cd examples/fan-adapter-8025
|
|
109
|
+
uv run agentcad validate fan_duct_adapter_8025 --json
|
|
110
|
+
uv run agentcad review fan_duct_adapter_8025 --json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Tests
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
uv run pytest -v
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
125 tests at last count, covering CLI dispatch, workspace scaffolding, STL
|
|
120
|
+
reading and measurement, section extraction and SVG rendering, JSON IO,
|
|
121
|
+
post-build validation checks, weak-check warnings, stale build detection,
|
|
122
|
+
geometric primitives, and `precheck` / `review` integration.
|
|
123
|
+
|
|
124
|
+
## Documentation
|
|
125
|
+
|
|
126
|
+
- [`docs/DESIGN.md`](docs/DESIGN.md) — architecture, first principles, and
|
|
127
|
+
V0–V5 iteration roadmap (with delivered milestones marked).
|
|
128
|
+
- [`docs/STATUS.md`](docs/STATUS.md) — current implementation state, recent
|
|
129
|
+
lessons (build123d traps, hole-wall interference), and the planned next
|
|
130
|
+
research and engineering work.
|
|
131
|
+
- `AGENTS.md` / `CLAUDE.md` (workspace) — operating rules for the coding
|
|
132
|
+
agent, including the mandatory TDD red/green workflow and the common
|
|
133
|
+
design-error catalog.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agentcad-cli"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Agent-first CAD workflow runtime"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11,<3.13"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "AgentCAD contributors" }
|
|
14
|
+
]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"build123d"
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
agentcad = "agentcad.cli:main"
|
|
21
|
+
|
|
22
|
+
[tool.setuptools.packages.find]
|
|
23
|
+
where = ["src"]
|
|
24
|
+
|
|
25
|
+
[tool.setuptools.package-data]
|
|
26
|
+
"agentcad._templates" = ["**/*.md", "**/*.json", "**/*.py", "**/.gitkeep"]
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
dev = ["pytest"]
|
|
30
|
+
|
|
31
|
+
[tool.pytest.ini_options]
|
|
32
|
+
testpaths = ["tests"]
|
|
File without changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# {name}
|
|
2
|
+
|
|
3
|
+
AgentCAD model folder.
|
|
4
|
+
|
|
5
|
+
## Files you edit
|
|
6
|
+
|
|
7
|
+
- `design.json` — design intent + validation checks (the design contract)
|
|
8
|
+
- `params.json` — tunable dimensions
|
|
9
|
+
- `part.py` — build123d geometry (must assign final shape to `result`)
|
|
10
|
+
|
|
11
|
+
## Recommended workflow
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
agentcad precheck {name} --json # 1. solve design.json statically
|
|
15
|
+
# write part.py once precheck is green
|
|
16
|
+
agentcad build {name} --json # 2. generate STEP/STL
|
|
17
|
+
agentcad measure {name} --json # 3. measure geometry stats
|
|
18
|
+
agentcad validate {name} --json # 4. run all checks (auto-renders SVGs)
|
|
19
|
+
agentcad review {name} --json # 5. pre-delivery checklist + relations matrix
|
|
20
|
+
agentcad deliver {name} --json # 6. write delivery manifest
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Common errors to design *against*
|
|
24
|
+
|
|
25
|
+
For every hole declared in `params.json`, also declare a `min_clearance` check
|
|
26
|
+
in `design.json` between the hole cylinder and each adjacent solid (walls,
|
|
27
|
+
plates, flanges, edges). This catches the classic "hole edge buried under a
|
|
28
|
+
wall" bug at design time, before any code is written.
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"id": "hole_X_clearance",
|
|
33
|
+
"type": "min_clearance",
|
|
34
|
+
"feature_a": {"type": "cylinder", "axis": "z",
|
|
35
|
+
"center": [hole_x, hole_y], "radius": hole_r,
|
|
36
|
+
"z_range": [z0, z1]},
|
|
37
|
+
"feature_b": {"type": "box",
|
|
38
|
+
"x_range": [...], "y_range": [...], "z_range": [...]},
|
|
39
|
+
"min_mm": 0.0
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
See `../references/validation-strategy.md` for a complete catalog of design
|
|
44
|
+
errors and the check types that catch them.
|
|
45
|
+
|
|
46
|
+
Generated artifacts go to `outputs/`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "design-spec.v1",
|
|
3
|
+
"model": "{name}",
|
|
4
|
+
"units": "mm",
|
|
5
|
+
"intent": "Default rectangular sample block.",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "base_block",
|
|
9
|
+
"intent": "Rectangular solid block with parameter-driven envelope.",
|
|
10
|
+
"checks": [
|
|
11
|
+
"bbox_size",
|
|
12
|
+
"watertight"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"checks": [
|
|
17
|
+
{
|
|
18
|
+
"id": "bbox_size",
|
|
19
|
+
"type": "bbox_size",
|
|
20
|
+
"expected": [
|
|
21
|
+
40.0,
|
|
22
|
+
30.0,
|
|
23
|
+
20.0
|
|
24
|
+
],
|
|
25
|
+
"tolerance": 0.2
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "watertight",
|
|
29
|
+
"type": "watertight",
|
|
30
|
+
"expected": true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "step_artifact",
|
|
34
|
+
"type": "artifact_exists",
|
|
35
|
+
"path": "outputs/{name}.step"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "stl_artifact",
|
|
39
|
+
"type": "artifact_exists",
|
|
40
|
+
"path": "outputs/{name}.stl"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Default AgentCAD build123d model.
|
|
2
|
+
|
|
3
|
+
Tunable values live in params.json. The final geometry must be assigned to
|
|
4
|
+
global variable `result`.
|
|
5
|
+
"""
|
|
6
|
+
import json
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
from build123d import *
|
|
10
|
+
|
|
11
|
+
PARAMS = json.loads((Path(__file__).with_name("params.json")).read_text(encoding="utf-8"))
|
|
12
|
+
|
|
13
|
+
length = float(PARAMS["length"])
|
|
14
|
+
width = float(PARAMS["width"])
|
|
15
|
+
height = float(PARAMS["height"])
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def build():
|
|
19
|
+
with BuildPart() as bp:
|
|
20
|
+
add(Box(length, width, height))
|
|
21
|
+
return bp.part
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
result = build()
|
|
25
|
+
metadata = {
|
|
26
|
+
"schema": "agentcad.part.metadata.v1",
|
|
27
|
+
"units": "mm",
|
|
28
|
+
"anchors": {
|
|
29
|
+
"origin": [0, 0, 0],
|
|
30
|
+
"x_min": [-length / 2, 0, 0],
|
|
31
|
+
"x_max": [length / 2, 0, 0],
|
|
32
|
+
},
|
|
33
|
+
}
|