CamCraft

Developers

Crate map

CamCraft is a Cargo workspace. Each crate holds one concern.

CratePackageRole
crates/geometrycamcraft-geometryMeshes, slicing, 2D regions, mesh repair
crates/clcamcraft-clThe cutter-location (CL) move stream
crates/toolscamcraft-toolsTool library and tool laws
crates/motioncamcraft-motionToolpath generators: 2D, 3D, drilling, multi-axis, turning
crates/simcamcraft-simStock simulation and the verifier
crates/postcamcraft-postThe .cps post-processor engine and the standalone post binary
crates/kernelcamcraft-kernelThe B-rep kernel seam: a thin Kernel trait (primitives, booleans, offset, blends, measure) and the bench that compares candidate engines
crates/appcamcraft-appDocument model on a Flecs ECS world, commands with undo/redo, operations, posting, the camcraft-cli binary and its MCP server
crates/uicamcraft-uiThe egui desktop interface
xtaskxtaskProject tooling: the test gates, packaging and release steps

assets/ holds the post processors (assets/posts/*.cps), machine definitions (assets/machines/*.mch), UI icons, fonts and themes. testdata/ holds the test models.

Layering

The layering is strict: ui → app → flecs. UI panels, widgets and dialogs never touch the ECS world directly; they queue commands, and only app-layer commands and systems make raw Flecs calls. ECS components are declared in one place, crates/app/src/schema.rs, and are registered for every binary at startup.

Code shape

Never crash, never gouge

The project's first rule: output is correct, or it is refused with a diagnostic. unwrap(), expect() and panic!() are not used outside tests; errors are handled or propagated. Degenerate input (zero-area triangles, broken STEP files, nonsense tolerances) gives a clean error, not a crash or a hang. Anything a collision check or simulation flags as unsafe blocks the post.

Clean room

CamCraft reimplements user-visible behaviour (operation types, parameters, workflow) from public documentation, G-code standards (RS-274, ISO 6983) and machining handbooks. No vendor code, text, icons, tool libraries or post processors are read or copied, and new toolpath algorithms are written from published technical literature. The full protocol is in AGENTS.md.