forked from 1b-agent/fieldcraft-upstream
demo video: name FieldCraft in the tool, its README and the README section
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm
This commit is contained in:
1 parent
8a8ed75103
commit
a423a9ef49
3 files changed
+13
-12
No files matched your search
@@ -9,11 +9,12 @@ drive the same commands.
|
||||
geometry boundary (SolidCraft's kernel and tessellator) are in place; meshing is next. See
|
||||
[ROADMAP.md](ROADMAP.md).
|
||||
|
||||

|
||||

|
||||
|
||||
An AI agent drives the app over [MCP](docs/mcp.md): it opens an I-beam, hex meshes it, defines
|
||||
the material, the clamp and a 1000 N tip load, solves, and shows the von Mises stress and the
|
||||
deformed shape (tip deflection 0.176 mm; beam theory with shear 0.177 mm).
|
||||
An AI agent drives FieldCraft over [MCP](docs/mcp.md), each stage captioned with the tool it
|
||||
calls: it opens an I-beam, hex meshes it, defines the material, the clamp and a 1000 N tip load,
|
||||
solves, and shows the von Mises stress and the deformed shape (tip deflection 0.176 mm; beam
|
||||
theory with shear 0.177 mm).
|
||||
[MP4](docs/media/ibeam-analysis.mp4) · regenerated by [tools/demo-video](tools/demo-video/README.md).
|
||||
|
||||
## Build
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`make.py` regenerates the README's demo, `docs/media/ibeam-analysis.mp4` and
|
||||
`docs/media/ibeam-analysis.gif`: an agent analyses an I-beam cantilever over MCP while the
|
||||
desktop app shows each step.
|
||||
FieldCraft desktop app shows each step.
|
||||
|
||||
```sh
|
||||
python3 tools/demo-video/make.py # build, run, encode into docs/media
|
||||
@@ -11,7 +11,7 @@ python3 tools/demo-video/make.py --frames /tmp/f # also keep the captured pictu
|
||||
cd tools/demo-video && python3 -m unittest # test the caption drawing
|
||||
```
|
||||
|
||||
Needs Python 3 (standard library only), a display for the app window (the pictures are drawn
|
||||
Needs Python 3 (standard library only), a display for the FieldCraft window (the pictures are drawn
|
||||
offscreen, so a locked screen is fine) and `ffmpeg` with libx264 on the `PATH` (or `FFMPEG`).
|
||||
It honours `CARGO_TARGET_DIR`.
|
||||
|
||||
@@ -21,7 +21,7 @@ What it does:
|
||||
2. Writes the corpus cantilever I-beam (`tests/corpus/cantilever-i-beam`: 40 x 40 mm, 3 mm
|
||||
flanges, a 2 mm web upright, 200 mm long along x) as a `.solidcraft` design to a temporary
|
||||
folder with `corpus --part cantilever-i-beam --design`.
|
||||
3. Starts the app with `--control PORT` and `fieldcraft-cli mcp --connect 127.0.0.1:PORT`, and
|
||||
3. Starts FieldCraft (`fieldcraft`) with `--control PORT` and `fieldcraft-cli mcp --connect 127.0.0.1:PORT`, and
|
||||
speaks MCP (JSON-RPC over stdio) to it. Every step is an MCP tool call: `open` the design,
|
||||
`mesh` (`hex_sweep`, 4 mm), `batch` (steel, a solid section, the root clamp, a kinematic
|
||||
coupling of the free end at x = 200 mm to a reference point loaded with 1000 N down, −z), `check_model`, `solve`
|
||||
@@ -43,7 +43,7 @@ What it does:
|
||||
1280 x 848) and the GIF (960 px, its own palette), and prints the tip deflection and the peak
|
||||
von Mises stress.
|
||||
|
||||
The theme is the app's default (dark).
|
||||
The theme is FieldCraft's default (dark).
|
||||
|
||||
The script checks the solution against beam theory and stops when it is off. Tip deflection:
|
||||
P L³ / 3 E I = 0.1429 mm in bending plus P L / G A_web = 0.0335 mm in shear, 0.1763 mm; the
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Regenerate the README demo video: an I-beam cantilever analysed by an agent over MCP.
|
||||
"""Regenerate the README demo video: an agent analyses an I-beam cantilever in FieldCraft over MCP.
|
||||
|
||||
Every analysis step goes through the MCP server (`fieldcraft-cli mcp --connect`), bridged to
|
||||
the desktop app, and every frame is the app window captured offscreen through the MCP
|
||||
the FieldCraft desktop app, and every frame is its window captured offscreen through the MCP
|
||||
`screenshot` tool (`source: window`). A caption bar names the tool behind each stage
|
||||
(caption.py draws it; ffmpeg's `overlay` filter composites it). See README.md beside this file.
|
||||
|
||||
@@ -91,13 +91,13 @@ def wait_for_port(port, app, timeout=180.0):
|
||||
end = time.monotonic() + timeout
|
||||
while time.monotonic() < end:
|
||||
if app.poll() is not None:
|
||||
raise SystemExit(f"the app exited with {app.returncode} before its control channel opened")
|
||||
raise SystemExit(f"FieldCraft exited with {app.returncode} before its control channel opened")
|
||||
try:
|
||||
with socket.create_connection(("127.0.0.1", port), timeout=1.0):
|
||||
return
|
||||
except OSError:
|
||||
time.sleep(0.5)
|
||||
raise SystemExit(f"the app's control channel on port {port} did not open within {timeout:.0f} s")
|
||||
raise SystemExit(f"FieldCraft's control channel on port {port} did not open within {timeout:.0f} s")
|
||||
|
||||
|
||||
class Mcp:
|
||||
|
||||
Reference in new issue
Block a user