How storytold/cadcraft works
CADCraft is a Rust 2D/3D CAD application with desktop, browser, CLI, and agent-facing entry points. The main workflow is to open or create a drawing, edit it through CAD commands and precision tools, then inspect, render, or export it. README capabilities include DXF/DWG, layouts and plotting, parametric constraints, and MCP/control interfaces. Source excerpts establish several internal calls; other links below are documented at product level, so unsampled subsystem wiring is not asserted.
Main entry points: doc_state.rs Drawing document · session.rs Command session · main.rs Browser app · menus.rs CAD interface
Components 21
App entry points
- Desktop app
apps/cadcraft/src/main.rs - Browser app
apps/cadcraft-web/src/main.rs - Drawing upload
apps/cadcraft-web/src/upload.rs - Drawing download
apps/cadcraft-web/src/download.rs - CLI
apps/cadcraft-cli/src/lib.rs - MCP server
crates/mcp/src/server.rs - JSON control
apps/cadcraft/src/control_server.rs
Editing and control
- CAD interface
crates/ui-egui/src/menus.rs - Command session
crates/engine/src/session.rs - Selection and snaps
crates/engine/src/select.rs
Drawing capabilities
- Drawing commands
crates/engine/src/cmd/props.rs - Parametric solver
crates/constraints/src/model.rs - Drawing document
crates/engine/src/doc_state.rs - Inspect drawing
crates/engine/src/cmd/inquiry.rs
Render and formats
- Render and plot
crates/render/src/pipeline.rs - DXF and exports
crates/io/src/dxf_write/sections.rs - DWG support
crates/dwg/src/lib.rs
Geometry and text
- Geometry kernel
crates/geom/src/region.rs - Text shaping
crates/fonts/src/ttf.rs
Other components
- CAD user
- Agent client
Connections 25
- CAD user → Desktop app: uses
README.md - CAD user → Browser app: uses
README.md - CAD user → CLI: uses
README.md - Desktop app → CAD interface: runs
apps/cadcraft/src/main.rs - Browser app → CAD interface: runs
apps/cadcraft-web/src/main.rs - Browser app → Drawing upload: opens files
apps/cadcraft-web/src/main.rs - Browser app → Drawing download: downloads saves
apps/cadcraft-web/src/main.rs - CAD user → CAD interface: edits through
README.md - CAD interface → Command session: runs commands
- Command session → Selection and snaps: uses
crates/engine/src/session.rs - Command session → Drawing commands: dispatches
crates/engine/src/session.rs - Command session → Drawing document: updates
crates/engine/src/session.rs - Drawing commands → Drawing document: edits
- Agent client → MCP server: sends requests
README.md - Agent client → JSON control: sends requests
README.md - Agent client → CLI: drives commands
README.md - MCP server → Inspect drawing: inspects via backend
crates/mcp/src/server.rs - JSON control → Command session: dispatches commands
- Command session → Parametric solver: solves constraints
- Drawing document → Render and plot: renders
- Drawing document → DXF and exports: reads and writes
README.md - Drawing document → DWG support: opens and saves
README.md - Drawing document → Geometry kernel: uses geometry
- Render and plot → Text shaping: shapes text with
- Drawing document → Inspect drawing: is inspected by
README.md