# three-bugs-studio/3bcad architecture

> Architecture diagram of the GitHub repository three-bugs-studio/3bcad, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/three-bugs-studio/3bcad
- Repository: https://github.com/three-bugs-studio/3bcad

## Overview

3BCAD is a desktop parametric CAD application. The main workflow is to create constrained sketches, build and edit feature-based parts, then inspect, assemble, draw, or prepare them for printing and export. The graph also preserves the documented assembly, drawing, and print-studio capabilities. Source excerpts establish only some wiring; dashed, uncited edges mark relationships whose implementation was not sampled.

Main entry points: [`crates/3bcad-app/src/main.rs`](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/main.rs) (Application entry), [`crates/3bcad-core/src/rebuild.rs`](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/rebuild.rs) (Feature rebuild), [`crates/3bcad-core/src/document.rs`](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/document.rs) (Part document), [`crates/3bcad-app/src/files.rs`](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/files.rs) (File workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop application"]
  node_entry["Application entry<br/>[main.rs]"]
  node_app["CAD workspace<br/>[app.rs]"]
  node_fileflow["File workflow<br/>[files.rs]"]
  node_translations["UI translations<br/>[i18n.rs]"]
end

subgraph group_design["Sketch and design"]
  node_sketch_ui["Sketch interaction<br/>[sketch_mode.rs]"]
  node_sketch_tools["Sketch tools<br/>[tools.rs]"]
  node_sketch_geom["Sketch geometry<br/>[geom.rs]"]
  node_sketch_solver["Constraint solver<br/>[solver.rs]"]
  node_document["Part document<br/>[document.rs]"]
  node_feature_rebuild["Feature rebuild<br/>[rebuild.rs]"]
  node_persistent_names["Persistent geometry names<br/>[naming.rs]"]
end

subgraph group_geometry["Geometry engine"]
  node_kernel_ops["Solid operations<br/>[operations.rs]"]
  node_kernel_boolean["Boolean geometry<br/>[boolean.rs]"]
  node_viewport["GPU viewport<br/>[pipeline.rs]"]
end

subgraph group_product["Product workflows"]
  node_assembly["Assembly workflow<br/>[assembly.rs]"]
  node_assembly_core["Assembly model<br/>[assembly.rs]"]
  node_drawing["Engineering drawings<br/>[drawing.rs]"]
  node_print_studio["3D Print studio<br/>[print.rs]"]
end

subgraph group_exchange["File exchange"]
  node_io_api["Format exchange<br/>[lib.rs]"]
  node_slicer_bridge["Slicer bridge<br/>[slicer.rs]"]
end

node_user(("CAD user"))

node_user -->|"launches"| node_entry
node_entry -->|"creates workspace"| node_app
node_user -.->|"draws sketches"| node_sketch_ui
node_sketch_ui -.->|"uses tools"| node_sketch_tools
node_sketch_tools -->|"edits geometry"| node_sketch_geom
node_sketch_geom -.->|"solves constraints"| node_sketch_solver
node_user -.->|"edits part"| node_document
node_document -->|"requests rebuild"| node_feature_rebuild
node_feature_rebuild -->|"resolves references"| node_persistent_names
node_feature_rebuild -.->|"builds features"| node_kernel_ops
node_kernel_ops -->|"combines solids"| node_kernel_boolean
node_app -.->|"renders model"| node_viewport
node_user -.->|"assembles parts"| node_assembly
node_assembly -.->|"edits assembly"| node_assembly_core
node_user -.->|"creates drawings"| node_drawing
node_user -.->|"prepares print"| node_print_studio
node_fileflow -.->|"imports and exports"| node_io_api
node_print_studio -.->|"opens slicer"| node_slicer_bridge
node_fileflow -.->|"opens and saves"| node_document
node_entry -.->|"localizes UI"| node_translations

click node_entry "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/main.rs"
click node_app "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/app.rs"
click node_fileflow "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/files.rs"
click node_translations "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/i18n.rs"
click node_sketch_ui "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/ui/sketch_mode.rs"
click node_sketch_tools "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-sketch/src/tools.rs"
click node_sketch_geom "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-sketch/src/geom.rs"
click node_sketch_solver "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-sketch/src/solver.rs"
click node_document "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/document.rs"
click node_feature_rebuild "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/rebuild.rs"
click node_persistent_names "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/naming.rs"
click node_kernel_ops "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-kernel/src/operations.rs"
click node_kernel_boolean "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-kernel/src/boolean.rs"
click node_viewport "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-render/src/pipeline.rs"
click node_assembly "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/assembly.rs"
click node_assembly_core "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/assembly.rs"
click node_drawing "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/drawing.rs"
click node_print_studio "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/print.rs"
click node_io_api "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-io/src/lib.rs"
click node_slicer_bridge "https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-io/src/slicer.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_app,node_fileflow,node_translations,node_user toneBlue
class node_sketch_ui,node_sketch_tools,node_sketch_geom,node_sketch_solver,node_document,node_feature_rebuild,node_persistent_names toneAmber
class node_kernel_ops,node_kernel_boolean,node_viewport toneMint
class node_assembly,node_assembly_core,node_drawing,node_print_studio toneRose
class node_io_api,node_slicer_bridge toneIndigo
```

## Components

### Desktop application

- [Application entry](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/main.rs): `crates/3bcad-app/src/main.rs`
- [CAD workspace](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/app.rs): `crates/3bcad-app/src/app.rs`
- [File workflow](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/files.rs): `crates/3bcad-app/src/files.rs`
- [UI translations](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/i18n.rs): `crates/3bcad-app/src/i18n.rs`

### Sketch and design

- [Sketch interaction](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/ui/sketch_mode.rs): `crates/3bcad-app/src/ui/sketch_mode.rs`
- [Sketch tools](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-sketch/src/tools.rs): `crates/3bcad-sketch/src/tools.rs`
- [Sketch geometry](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-sketch/src/geom.rs): `crates/3bcad-sketch/src/geom.rs`
- [Constraint solver](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-sketch/src/solver.rs): `crates/3bcad-sketch/src/solver.rs`
- [Part document](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/document.rs): `crates/3bcad-core/src/document.rs`
- [Feature rebuild](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/rebuild.rs): `crates/3bcad-core/src/rebuild.rs`
- [Persistent geometry names](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/naming.rs): `crates/3bcad-core/src/naming.rs`

### Geometry engine

- [Solid operations](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-kernel/src/operations.rs): `crates/3bcad-kernel/src/operations.rs`
- [Boolean geometry](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-kernel/src/boolean.rs): `crates/3bcad-kernel/src/boolean.rs`
- [GPU viewport](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-render/src/pipeline.rs): `crates/3bcad-render/src/pipeline.rs`

### Product workflows

- [Assembly workflow](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/assembly.rs): `crates/3bcad-app/src/assembly.rs`
- [Assembly model](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/assembly.rs): `crates/3bcad-core/src/assembly.rs`
- [Engineering drawings](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-core/src/drawing.rs): `crates/3bcad-core/src/drawing.rs`
- [3D Print studio](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-app/src/print.rs): `crates/3bcad-app/src/print.rs`

### File exchange

- [Format exchange](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-io/src/lib.rs): `crates/3bcad-io/src/lib.rs`
- [Slicer bridge](https://github.com/three-bugs-studio/3bcad/blob/main/crates/3bcad-io/src/slicer.rs): `crates/3bcad-io/src/slicer.rs`

### Other components

- **CAD user**

## Connections

- CAD user → Application entry: launches (evidence: `crates/3bcad-app/src/main.rs`)
- Application entry → CAD workspace: creates workspace (evidence: `crates/3bcad-app/src/main.rs`)
- CAD user → Sketch interaction: draws sketches (evidence: `README.md`)
- Sketch interaction → Sketch tools: uses tools
- Sketch tools → Sketch geometry: edits geometry (evidence: `crates/3bcad-sketch/src/tools.rs`)
- Sketch geometry → Constraint solver: solves constraints (evidence: `README.md`)
- CAD user → Part document: edits part (evidence: `README.md`)
- Part document → Feature rebuild: requests rebuild (evidence: `crates/3bcad-core/src/document.rs`)
- Feature rebuild → Persistent geometry names: resolves references (evidence: `crates/3bcad-core/src/rebuild.rs`)
- Feature rebuild → Solid operations: builds features
- Solid operations → Boolean geometry: combines solids (evidence: `crates/3bcad-kernel/src/boolean.rs`)
- CAD workspace → GPU viewport: renders model
- CAD user → Assembly workflow: assembles parts (evidence: `README.md`)
- Assembly workflow → Assembly model: edits assembly
- CAD user → Engineering drawings: creates drawings (evidence: `README.md`)
- CAD user → 3D Print studio: prepares print (evidence: `README.md`)
- File workflow → Format exchange: imports and exports
- 3D Print studio → Slicer bridge: opens slicer (evidence: `README.md`)
- File workflow → Part document: opens and saves (evidence: `README.md`)
- Application entry → UI translations: localizes UI (evidence: `crates/3bcad-app/src/main.rs`)
