Repository navigation
Releases: C2-POLY/code2form
Release list
Code2Form 0.7.0
Code2Form comes to iPhone and iPad: open a design from Files and turn it in 3D with a finger, scan an object with an iPhone that has a LiDAR camera, then take the scan to the studio on the Mac and measure it to draw your part around it.
What's new
- Code2Form on iPhone and iPad (#44, #45, #46): a native app over the same Rust engine as the studio. It opens
.c2fand.scadfiles from Files or iCloud Drive and draws them with Metal, with the studio's camera and lighting: one finger turns, two fingers move, a pinch zooms and a double tap frames the model. A card gives the model's size, triangles and volume, or the error that stopped the program at its line. A design that includes, imports or wires files beside it asks once for its folder. It is in TestFlight now, on its way to the App Store. - Scan an object (#47): on an iPhone or iPad with a LiDAR camera (an iPhone 12 Pro or later Pro), "Scan an object" opens Apple's guided capture: walk around the object, flip it for its underside, and the device rebuilds the mesh itself. It is saved as an STL in millimetres, Z up and standing on the XY plane, in Code2Form › Scans, and sent to the Mac by AirDrop.
- A scan as a reference in the studio (#48): drop a mesh on an open design and it goes in as
%import("…"), drawn see-through and left out of the model and its exports. The section view now draws the cut's outline, scans included, and its card gives the outline's size: cut a scan at a height and read its width and depth to write the part again. - Agents know scans (#49): the MCP server tells Claude and the studio's agent what a scan from the app is (millimetres, Z up, true to a millimetre or two) and how to use one: as a
%import()reference, measured withsection, with the user's caliper sizes over it and clearance where a part touches it.
Known limitations
- A scan is true to a millimetre or two. Glossy, black and see-through surfaces do not rebuild (a watch's screen comes out as a hole); a matte, textured object in bright, diffuse light scans best.
- The iPhone and iPad app opens and shows designs; setting parameters, exporting and editing the code on the device come next.
projection()withoutcutkeeps holes open where the reference implementation fills them, which changes the volume of some models (0.3% on the GEB example).- Part annotations are plain numbers: a part's pins do not follow its parameters.
- Masses and some dimensions of the library's parts are estimated where no source gives them; each file says which.
- A part in your own library (
~/Documents/Code2Form/libraries) is found before the app's part of the same name.
Downloads
| File | For |
|---|---|
Code2Form-0.7.0-macos-universal.zip |
The app, for every Mac (Apple silicon and Intel), macOS 11 or later |
c2f-0.7.0-macos-universal.zip |
The command line and MCP server, same platforms |
SHA256SUMS.txt |
Checksums of both |
The app is signed with a Developer ID and notarized by Apple: it opens without a warning.
The iPhone and iPad app is in TestFlight; it will be on the App Store after Apple's review. To build it yourself, see apps/ios/project.yml.
The agent needs Claude Code 2.1.300 or later, signed in, or an Anthropic API key (Settings › Agent).
Windows and Linux: build from source with Rust 1.85 or later (cargo build --release); see the README.
Code2Form 0.6.0
Manual modelling is here: select, move, turn and scale objects with the mouse, put down shapes, and draw sketches to extrude, each gesture written into the code. It was announced for 0.4.0 but missing from both 0.4.0 and 0.5.0; this release brings it.
What's new
- Manual modelling (#41, from #26, #27, #28): select objects in the view and drag their handles to move, turn and scale them; put down shapes and holes, combine them, round their edges, and draw constrained sketches to extrude or revolve, on a plane picked in the view. Every gesture is one edit of the code, and one undo step.
- Handles on real designs (#41): objects inside a
part("…")take the handles, and a move keeps a position the code computes:translate([0, 0, base_h])moved up by 5 becomestranslate([0, 0, base_h + 5]), still following the parameter. When a handle cannot act (a turn of a computed placement, an object copied by a loop), the reason shows at the pointer.
Known limitations
- A turn or a scale needs the object's placement written as numbers: on a computed placement, only the move handles work.
- The API engine of the agent was tested against a simulated API; Claude Code was tested for real.
projection()withoutcutkeeps holes open where the reference implementation fills them, which changes the volume of some models (0.3% on the GEB example).- Part annotations are plain numbers: a part's pins do not follow its parameters.
- Masses and some dimensions of the library's parts are estimated where no source gives them; each file says which.
- A part in your own library (
~/Documents/Code2Form/libraries) is found before the app's part of the same name.
Downloads
| File | For |
|---|---|
Code2Form-0.6.0-macos-universal.zip |
The app, for every Mac (Apple silicon and Intel), macOS 11 or later |
c2f-0.6.0-macos-universal.zip |
The command line and MCP server, same platforms |
SHA256SUMS.txt |
Checksums of both |
The app is not notarized by Apple yet. On first launch, macOS blocks it: open it once, then go to System Settings → Privacy & Security and click Open Anyway. Or run, once:
xattr -dr com.apple.quarantine /Applications/Code2Form.appThe agent needs Claude Code 2.1.300 or later, signed in, or an Anthropic API key (Settings › Agent).
Windows and Linux: build from source with Rust 1.85 or later (cargo build --release); see the README.
Code2Form 0.5.0
Talk to an AI agent inside the studio: it reads and edits the open model or circuit live, one undo step at a time, on your own Claude Code subscription or an Anthropic API key. And Code2Form has a website.
What's new
- An agent in the studio (#38): open it from the top bar or with Cmd+L, and a chat floats over the 3D view, growing with the conversation. The agent works on the document you have open, not on the file on disk: it changes the code, the customizer's parameters and the view, and you see the model change as it writes. Each change is one undo step, and Cmd+Alt+Z undoes a whole answer.
- Claude Code or an API key (#38): the agent runs on your own Claude Code (your subscription; nothing else to pay, and no price shown) or on an Anthropic API key kept in the Keychain. It can search the web and read pages, for a part's datasheet or a printing tip.
- Live electronics (#38): in a circuit, the agent places parts, wires them and checks the result; a change that would make a short or a wrong voltage is refused, with the checker's explanation.
- Show it instead of describing it (#38): select a part, a face, a wire or lines of code, and they go with your message; right-click in the view › Ask the agent….
- Start with the agent (#38): a new file offers to open a file, start in code, or start with the agent, which plans the object with you (
plan_object) before drawing it. Its replies show tables and lists properly, and the next step of the plan comes as a button. - You keep the last word (#38): ask the agent to wait for you, and each change shows as a diff, with the old model as a ghost in the view, until you accept it. Settings choose the engine, the model, what the agent may write, and keep it to the file's folder.
- A website (#39): https://c2-poly.github.io/code2form/, in English and French, with the latest download, its checksums and how to open the app the first time.
Guide: docs/agent.md.
Known limitations
- Manual modelling is not in this release. The 0.4.0 notes announced it (#26, #27, #28), but that work was lost from
mainbefore 0.4.0 was built, so neither 0.4.0 nor 0.5.0 contains it. It will come back in a later release. - The API engine was tested against a simulated API; Claude Code was tested for real.
projection()withoutcutkeeps holes open where the reference implementation fills them, which changes the volume of some models (0.3% on the GEB example).- Part annotations are plain numbers: a part's pins do not follow its parameters.
- Masses and some dimensions of the library's parts are estimated where no source gives them; each file says which.
- A part in your own library (
~/Documents/Code2Form/libraries) is found before the app's part of the same name.
Downloads
| File | For |
|---|---|
Code2Form-0.5.0-macos-universal.zip |
The app, for every Mac (Apple silicon and Intel), macOS 11 or later |
c2f-0.5.0-macos-universal.zip |
The command line and MCP server, same platforms |
SHA256SUMS.txt |
Checksums of both |
The app is not notarized by Apple yet. On first launch, macOS blocks it: open it once, then go to System Settings → Privacy & Security and click Open Anyway. Or run, once:
xattr -dr com.apple.quarantine /Applications/Code2Form.appThe agent needs Claude Code 2.1.300 or later, signed in, or an Anthropic API key (Settings › Agent).
Windows and Linux: build from source with Rust 1.85 or later (cargo build --release); see the README.
Code2Form 0.4.0
Note (27 October 2026): manual modelling (#26, #27, #28) is not in this release after all. That work was lost from
mainbefore 0.4.0 was built, so the app you download here does not have it. It is coming back in a later release; 0.5.0 does not have it either.
Model by hand as well as in code, plan an object with an agent before drawing it, then bring in its electronics; export to game engines, robots and CAD; a new window, a light theme, and the app in French.
What's new
- Plan before drawing (#36): the MCP prompt
plan_objectasks what the object must do, in short rounds of questions that follow your answers, then reviews its mechanics as an engineer would (masses, balance, forces and supports, torque, material, fastening, assembly, energy) and writes a brief you approve. New tools give it numbers:mass_properties(c2f mass: printed mass by material and infill, center of gravity, tipping angle),loads(c2f loads: the torque a shaft needs, what each support takes, the motor's margins, the reduction to aim for), andcheck_brief, which measures a design and its circuit against the brief. Guide:docs/plan-mode.md; example:examples/winder/. - From an idea to its electronics (#35): the prompts
design_objectandadd_electronicslead an agent from a description to an approved model, then to its parts placed, wired and checked inside it.electrifymakes a design ready for its circuit without rewriting it; parts get a sheet (description, specs, sources) and the catalogue a search in English and French;check_partandsave_partwrite a part from its product page;fitgives each part its clearance in its enclosure; wires takeviapoints andchannel_for(); the view cuts the enclosure open and sees through it;imagedraws a sheet of four views at one scale. Guide:docs/idea-to-build.md; example:examples/nightlight/. - Mechanical library (#36): 608, 625, 6800 and 6001 bearings, shafts, ISO screws and nuts, heat-set inserts, a coupling, an involute spur gear,
gear_pair()andbearing_seat(), the 28BYJ-48 stepper and an N20 gear motor; every part's mass on its sheet. Manual modelling (#26, #27, #28)(not in this release, see the note above): select, move, turn and scale objects in the view, put down shapes and holes, combine them, round their edges, and draw constrained sketches to extrude or revolve, on a plane picked in the view. Every gesture is one edit of the code, and one undo step.- Meshes in, more formats out (#34): open and insert STL, OBJ, 3MF and STEP files (STEP through FreeCAD, when it is installed), repaired as they load, or turned into an editable design; export OBJ, STEP, URDF (robots, with joints from
part()), the parts as JSON, and a view's outline as DXF. The MCPsectiontool cuts a mesh to measure it again as a design. - Godot and Unity (#25): export animated models as glTF, each
part()a node, its motion from$t. - Exploded view (#30, #32): slides a design's parts apart, radially or along each part's axis.
- A new window (#33): one bar on top with the File menu, the tabs, the layout switch, Render and Export; the code beside a view whose tools float over it.
- Settings (#19, #23, #31): a light theme beside the dark one, shortcuts of your own, STL in binary, export options, a window that opens where you left it, and the whole app in French.
Fixes
%and#parts are drawn where their transformations put them (#29).- The reference implementation is named nowhere in the app or the docs (#24).
Downloads
| File | For |
|---|---|
Code2Form-0.4.0-macos-universal.zip |
The app, for every Mac (Apple silicon and Intel), macOS 11 or later |
c2f-0.4.0-macos-universal.zip |
The command line and MCP server, same platforms |
SHA256SUMS.txt |
Checksums of both |
The app is not notarized by Apple yet. On first launch, macOS blocks it: open it once, then go to System Settings → Privacy & Security and click Open Anyway. Or run, once:
xattr -dr com.apple.quarantine /Applications/Code2Form.appTo open .c2f, .c2fc and .scad files with Code2Form by double-click: Finder → Get Info on a file → Open with → Code2Form → Change All.
Windows and Linux: build from source with Rust 1.85 or later (cargo build --release); see the README.
Known limitations
projection()withoutcutkeeps holes open where the reference implementation fills them, which changes the volume of some models (0.3% on the GEB example).- Part annotations are plain numbers: a part's pins do not follow its parameters.
- Masses and some dimensions of the library's parts are estimated where no source gives them; each file says which.
- The calculations of the plan are static orders of magnitude with margins: no dynamics, no finite elements.
check_brief's torque margin comes from the brief'sloadsscenario, not from the design's geometry. - A part in your own library (
~/Documents/Code2Form/libraries) is found before the app's part of the same name.
Code2Form 0.3.0
Electronics in 3D, tabs, print pauses, settings, and an MCP server for AI agents. One download now runs on every Mac.
What's new
- Electronics workspace (#20): parts declare their pins, mount holes and ports in
// @pincomments; a.c2fccircuit file places them and wires them. Code2Form checks the wiring before you solder (supply voltages, shorts, open grounds, reserved pins), draws every part in place with its wires in their colors, shows a pin's net on a click, and walks you through the soldering wire by wire in Assembly mode. Rewire, move, turn and remove parts with the mouse, drag new ones in from the Catalogue, and make your own from a template. An enclosure.c2ftakes its standoffs and openings from the circuit, and collisions and wire lengths are checked. A library of annotated parts ships with the app (XIAO ESP32-S3, ESP32-S3-DevKitC-1, MAX98357A, DRV8833, INMP441, capacitors, speaker, motor, touch plate). Guide:docs/electronics.md; example:examples/grogu/. - Tabs (#21): open several files at once, each with its own view, console and undo history; they come back at the next launch.
- Print pauses (#14, #15):
pause(z, message);asks the print to stop at a height, to drop magnets or nuts into closed cavities; the 3MF carries the pauses to PrusaSlicer. The view shows them, and a layer view cuts the model and edits them on its slider. - Settings (⌘,) (#16, #17, #18): the app icon in ten tints, the code's size, rendering as you type or on demand, and your own library and font folders.
- AI agents (#13, #20):
c2f mcpis a Model Context Protocol server: an agent such as Claude Code renders, pictures and exports models, and describes, checks and pictures circuits. - Command line:
c2f circuit check | wires | bom | stl | 3mfandc2f pins. - Open Recent (#10) lists the last ten files; the Turntable (#8, now in the View menu) turns the view around the model.
Fixes
- A worker test that failed at random now uses its own temporary file (#12).
projection()'s areas are pinned by tests, and the GEB volume gap is explained (#9).
Downloads
| File | For |
|---|---|
Code2Form-0.3.0-macos-universal.zip |
The app, for every Mac (Apple silicon and Intel), macOS 11 or later |
c2f-0.3.0-macos-universal.zip |
The command line, same platforms |
SHA256SUMS.txt |
Checksums of both |
The app is not notarized by Apple yet. On first launch, macOS blocks it: open it once, then go to System Settings → Privacy & Security and click Open Anyway. Or run, once:
xattr -dr com.apple.quarantine /Applications/Code2Form.appTo open .c2f, .c2fc and .scad files with Code2Form by double-click: Finder → Get Info on a file → Open with → Code2Form → Change All.
Windows and Linux: build from source with Rust 1.85 or later (cargo build --release); see the README.
Known limitations
projection()withoutcutkeeps holes open where the reference implementation fills them, which changes the volume of some models (0.3% on the GEB example).- Part annotations are plain numbers: a part's pins do not follow its parameters.
- Some dimensions of the library's parts are estimated; each file says which.
Code2Form 0.2.0
More ways out of Code2Form: 3MF for printing, SVG and DXF for cutting, plus find and replace in the editor.
What's new
- 3MF export: the toolbar's Export menu saves solids as STL or 3MF. A 3MF package carries its units (millimeters) and is 20 to 30 times smaller than the ASCII STL; PrusaSlicer loads it as a closed mesh, with nothing to repair, even where two colors meet.
- SVG and DXF export for 2D models, laid out as the reference implementation writes them: same page size in millimeters, same outlines.
- Find and replace in the editor: ⌘F to find, ⌘G and ⇧⌘G to step through the matches, ⌥⌘F to replace. One ⌘Z undoes a whole Replace All.
- Command line:
c2f 3mf,c2f svgandc2f dxfwrite to stdout, likec2f stl.
Fixes
offset(r = …)rounds its corners exactly as the reference implementation (release 2021.01) does: same points, same count.- Data files of a used library are named with
/on every system.
Under the hood
- Every push and pull request now runs the tests and clippy on macOS, Windows and Linux.
- The Liberation fonts 2.00.1 that the
text()tests compare against are kept in the repository, with their licence (SIL Open Font License 1.1).
Downloads
| File | For |
|---|---|
Code2Form-0.2.0-macos-arm64.zip |
The app, for Macs with Apple silicon (M1 or later), macOS 11 or later |
c2f-0.2.0-macos-arm64.zip |
The command line, same platform |
SHA256SUMS.txt |
Checksums of both |
The app is not notarized by Apple yet. On first launch, macOS blocks it: open it once, then go to System Settings → Privacy & Security and click Open Anyway. Or run, once:
xattr -dr com.apple.quarantine /Applications/Code2Form.appTo open .c2f and .scad files with Code2Form by double-click: Finder → Get Info on a file → Open with → Code2Form → Change All.
Intel Macs, Windows and Linux: build from source with Rust 1.85 or later (cargo build --release); see the README.
Known limitations
projection()withoutcutkeeps holes open where the reference implementation fills them, which changes the volume of some models (0.3% on the GEB example).- No undo history across reloads, recent files or animation yet.
Code2Form 0.1.0
First release of Code2Form: parametric 3D design as code, with a live preview.
Highlights
- Editor and live 3D view: syntax highlighting, errors marked on their line, a new render as you type; orbit, pan and zoom.
- Your files: designs are saved as
.c2f, and.scadfiles open as they are. - Customizer: parameters declared in comments get sliders, dropdowns, checkboxes and text fields, grouped by section; presets are saved next to the design in a
.jsonfile. - Geometry: CSG with Manifold,
text()with the bundled Liberation fonts,import()of STL, OFF, AMF, 3MF, DXF and SVG, andsurface()from.datand PNG. - STL export, checked with PrusaSlicer's own loader.
c2fcommand line: prints the AST, the CSG tree or an STL, with-D name=value,-p presets.jsonand-P preset.
Downloads
| File | For |
|---|---|
Code2Form-0.1.0-macos-arm64.zip |
The app, for Macs with Apple silicon (M1 or later), macOS 11 or later |
c2f-0.1.0-macos-arm64.zip |
The command line, same platform |
SHA256SUMS.txt |
Checksums of both |
The app is not notarized by Apple yet. On first launch, macOS blocks it: open it once, then go to System Settings → Privacy & Security and click Open Anyway. Or run, once:
xattr -dr com.apple.quarantine /Applications/Code2Form.appTo open .c2f and .scad files with Code2Form by double-click: Finder → Get Info on a file → Open with → Code2Form → Change All.
Intel Macs, Windows and Linux: build from source with Rust 1.85 or later (cargo build --release); see the README.
Known limitations
- Exports STL only for now.
offset(r = ...)places its arc points slightly differently from other implementations, which can move volumes by up to 0.3%.- No undo history across reloads, find and replace, or recent files yet.