File size: 6,078 Bytes
5b34050 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | ---
license: apache-2.0
pretty_name: FreeCAD computer-use environment (REA)
tags:
- computer-use
- cua
- gui-agent
- rl-environment
- agentenv
- desktop
- linux
- rea
- cad
- 3d
---
# FreeCAD: a computer-use environment

**The real FreeCAD 0.21 3D CAD running on an Ubuntu 24.04 desktop, as an [agentenv](https://pypi.org/project/agentenv-framework/) computer environment. An agent completes the task only through screenshots, mouse and keyboard, and a verifier grades the saved files with no model.**
FreeCAD 0.21 starts with a synthetic part already open: a 160 x 100 x 5 mm plate. The agent has to cut a 10 mm hole through the middle of the plate using only FreeCAD's menus, toolbars and property editor: switch to the Part workbench, add a cylinder, name it Hole, size and place it, subtract it from the plate with a Boolean cut, and save. Every agent run stayed in the GUI, at about 55 actions per run. (With the Python console left open and allowed, the same agent solved a sibling task 5 of 5 times in about 10 actions, for about $0.52 per run, by typing Python instead.)
## Watch
- Agent runs (Claude Code with Claude Sonnet 5.5): [run 1](media/solve-1.mp4), [run 2](media/solve-2.mp4), [run 3](media/solve-3.mp4), [run 4](media/solve-4.mp4), [run 5](media/solve-5.mp4)
- Scripted witness, which proves the task can be done through the computer: [witness.mp4](media/witness.mp4)
Each video is the computer's own screen recording at 10 frames per second.
## The task
> FreeCAD is already open with ~/Documents/plate.FCStd loaded; it holds one part, Plate, a 160 x 100 x 5 mm box. Using FreeCAD's menus, toolbars and dialogs only (not the Python console or macros), cut a 10 mm diameter hole straight through the middle of the plate: switch to the Part workbench (View > Workbench > Part), add a cylinder from it and name it Hole, size and place it with its properties, subtract it from Plate with Part > Boolean > Cut, then save the document in place.
`bundle/artifacts/add-hole-gui-check/verify.py` reads the app's files through the computer's `data/get` view and passes only if every check holds:
| Check | Kind | File |
| --- | --- | --- |
| `cut` | `value_equals` | `Documents/plate.FCStd` |
| `named-hole` | `value_equals` | `Documents/plate.FCStd` |
| `radius` | `value_equals` | `Documents/plate.FCStd` |
| `middle-x` | `value_equals` | `Documents/plate.FCStd` |
| `middle-y` | `value_equals` | `Documents/plate.FCStd` |
| `starts-below` | `value_equals` | `Documents/plate.FCStd` |
| `tall-enough` | `value_equals` | `Documents/plate.FCStd` |
| `upright` | `value_equals` | `Documents/plate.FCStd` |
`.FCStd` is a zip archive. REA's view opens it and parses the `Document.xml` inside, and the checks address elements by name with selectors such as `[name=Object][@type=Part::Cut]`. They require a Part::Cut; a cylinder labelled Hole with radius 5 mm ± 0.01; its centre within 1 mm of the plate's (x 80, y 50); upright; and starting at or below the plate with a height of at least 5 mm.
## Results
5 of 5 runs passed, about $1.25 per run.
| Run | Outcome | Cost | Video |
| --- | --- | --- | --- |
| 1 | passed | $1.51 | [video](media/solve-1.mp4) |
| 2 | passed | $1.08 | [video](media/solve-2.mp4) |
| 3 | passed | $1.47 | [video](media/solve-3.mp4) |
| 4 | passed | $1.03 | [video](media/solve-4.mp4) |
| 5 | passed | $1.18 | [video](media/solve-5.mp4) |
## Run it
You need Docker. `agentenv-framework` builds the computer: Ubuntu 24.04 with the app installed from the FreeCAD maintainers' PPA (`freecad` 0.21.2, amd64).
```bash
pip install agentenv-framework==0.9.1431
hf download earakely-scale/FreeCADComputerEnv-REA --repo-type dataset --local-dir freecad
agent-env run freecad/bundle --task add-hole-gui --agent claude-code --model <model>
```
The agent needs a model provider configured for agentenv. `--task smoke` only boots the computer, with no agent. `bundle/README.md` describes the bundle in detail.
## How it was made
[REA](https://github.com/morluto/rea) built this environment from a real session with the app:
1. **Capture.** REA launched FreeCAD on a Linux desktop and recorded its package, windows and opened files while a scripted user made the edit. It also recorded the app's state folders before and after.
2. **Export.** REA turned the capture into an agentenv `computer_app`. It installs the app, seeds the starting files, starts the app, and waits for its main window. It also serves typed views of the app's files for verifiers.
3. **Task.** The task's checks were validated against the capture: they fail on the starting state and pass on the captured end state.
4. **Witness and runs.** Scripted computer actions solved the task in a fresh computer, and the verifier failed before, passed after and failed again after `data/reset`. Then an agent solved it 5 times, each run recorded.
## What's inside
```
bundle/ the agentenv bundle: envs/ (app module, seed files), tasks/, artifacts/ (verifier), evals/
media/ witness and agent-run recordings (MP4) with short GIF previews
results.json the runs above, with each check's result
```
## Limits
- The checks address the cylinder as the first object created after the plate, because FreeCAD's GUI cannot set an object's internal name; an agent that leaves another object before the cylinder fails.
- The 'goes through' checks are separate (starts at or below the plate, at least 5 mm tall), so a cylinder far below the plate would also pass.
- The prompt names each step, and the screen is the same on every boot, so the task tests careful GUI operation more than planning.
- FreeCAD for Ubuntu 24.04 comes only from the maintainers' PPA, which builds amd64 only; this environment needs an amd64 host.
- Five runs is a small sample.
## Licences
The bundle code, the task and the synthetic seed files are Apache-2.0. FreeCAD itself is not included: the computer installs it from the FreeCAD maintainers' PPA (`freecad` 0.21.2, amd64) at build time, under its own licence (LGPL-2.0-or-later).
|