Foxtrot is a fast viewer for STEP files, a standard interchange format for mechanical CAD. It is an experimental project built from the ground up, including new libraries for parsing and triangulation.
This repository includes a simple native GUI:
In addition, the same code can run in a browser (click to see the demo):
For more background on the project, check out this writeup by one of the main authors.
(Prerequisite: install Rust and Cargo, and clone this repository)
cargo run --release -- examples/cube_hole.step(Prerequisite: install wasm-pack and clone this repository)
cd wasm
wasm-pack build --target no-modules
python3 -m http.server --directory deploy # or the simple server of your choiceThen, open the local server's URL (typically 127.0.0.1:8000)
and select a sample file from the list.
cdt: Constrained Delaunay triangulation (standalone)express: Parser for EXPRESS schemas files and a matching code generation systemexperiments: Experiments with trait systems (unused)step: Auto-generated STEP file parser. This take a very long time to compile, so it is isolated into this crate.triangulate: Converts a file loaded bystepinto a triangle mesh, usingcdtas its corenurbs: A handful of NURBS / B-spline algorithms used bytriangulategui: GUI for rendering STEP files, using WebGPUwasm: Scaffolding to run in the browser using WebAssembly
step/src/ap214.rs is automatically generated from
10303-214e3-aim-long.exp, which is available via CVS here
(check out the APs folder).
To regenerate, run
cargo run --release --example gen_exp -- path/to/APs/10303-214e3-aim-long.exp step/src/ap214.rs
The test_assets/ directory contains STEP files used for tessellation
regression testing. To add components from a KiCad board:
pip install zstandard # one-time dependency
python3 scripts/ingest_kicad_pcb.py path/to/layout.kicad_pcbThis extracts embedded 3D models, deduplicates them into test_assets/,
and regenerates test_assets/baseline.json. You can pass multiple .kicad_pcb
files at once. After running, commit the new assets and updated baseline.
To run the regression suite against the baseline:
cargo run --release --example regression_test -- --compare test_assets/baseline.json© 2021 Formlabs
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Foxtrot is a proof-of-concept demo, not an industrial-strength CAD kernel. It may not work for your models! Even in the screenshots above, there are a handful of surfaces that it fails to triangulate; look in the console for details.
This isn't an official Formlabs project (experimental or otherwise), it is just code that happens to be owned by Formlabs.
No one at Formlabs is paid to maintain this, so set your expectations for support accordingly.

