# cyprien63/voltforge architecture

> Architecture diagram of the GitHub repository cyprien63/voltforge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cyprien63/voltforge
- Repository: https://github.com/cyprien63/voltforge

## Overview

VoltForge is a desktop circuit-design and electrical-simulation application. The main workflow is to place and connect components on the canvas, build circuit topology, solve DC or transient behavior, and inspect measurements; users can also configure scenarios, save projects, and export diagrams or animations. The map includes documented calculators and major UI capabilities. Some subsystem links rely on README descriptions or SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`ui/main_window.py`](https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py) (Main window), [`ui/canvas.py`](https://github.com/cyprien63/voltforge/blob/main/ui/canvas.py) (Interactive canvas), [`core/simulation.py`](https://github.com/cyprien63/voltforge/blob/main/core/simulation.py) (Simulation engine), [`exporters/gif.py`](https://github.com/cyprien63/voltforge/blob/main/exporters/gif.py) (Scenario GIF export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Design interface"]
  node_window["Main window<br/>[main_window.py]"]
  node_canvas["Interactive canvas<br/>[canvas.py]"]
  node_calculators["Circuit calculators<br/>[main_window.py]"]
end

subgraph group_model["Circuit model"]
  node_circuit["Circuit topology<br/>[circuit.py]"]
  node_components["Component models<br/>[components.py]"]
  node_arrows["Voltage annotations<br/>[voltage_arrow.py]"]
  node_formatting["SI formatting<br/>[formatting.py]"]
end

subgraph group_simulation["Simulation"]
  node_engine["Simulation engine<br/>[simulation.py]"]
  node_scenario["Scenario parser<br/>[scenario.py]"]
  node_solver["MNA solver<br/>[solver.py]"]
  node_measurements["Results and measurements<br/>[main_window.py]"]
end

subgraph group_outputs["Projects and exports"]
  node_project["Project persistence<br/>[main_window.py]"]
  node_static["Static diagram export<br/>[static.py]"]
  node_gif["Scenario GIF export<br/>[gif.py]"]
end

node_user(("Circuit designer"))
node_files["Project or export file"]

node_user -->|"uses"| node_window
node_window -->|"hosts"| node_canvas
node_user -->|"edits circuit"| node_canvas
node_canvas -->|"updates topology"| node_circuit
node_canvas -->|"renders and edits"| node_components
node_canvas -->|"refreshes simulation"| node_engine
node_circuit -->|"resolves terminals"| node_components
node_circuit -->|"loads annotations"| node_arrows
node_window -->|"orchestrates"| node_engine
node_engine -->|"parses scenario"| node_scenario
node_engine -->|"solves circuit"| node_solver
node_solver -->|"reads topology"| node_circuit
node_solver -->|"evaluates branches"| node_components
node_components -->|"formats values"| node_formatting
node_scenario -->|"parses quantities"| node_formatting
node_window -->|"displays results"| node_measurements
node_user -->|"uses"| node_calculators
node_window -->|"manages projects"| node_project
node_project -->|"reads and writes"| node_files
node_window -->|"exports diagram"| node_static
node_static -->|"renders scene"| node_canvas
node_window -->|"exports animation"| node_gif
node_gif -->|"advances scenario"| node_engine
node_gif -->|"captures frames"| node_static
node_static -->|"writes diagram"| node_files
node_gif -->|"writes GIF"| node_files

click node_window "https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py"
click node_canvas "https://github.com/cyprien63/voltforge/blob/main/ui/canvas.py"
click node_calculators "https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py"
click node_circuit "https://github.com/cyprien63/voltforge/blob/main/core/circuit.py"
click node_components "https://github.com/cyprien63/voltforge/blob/main/core/components.py"
click node_arrows "https://github.com/cyprien63/voltforge/blob/main/core/voltage_arrow.py"
click node_formatting "https://github.com/cyprien63/voltforge/blob/main/core/formatting.py"
click node_engine "https://github.com/cyprien63/voltforge/blob/main/core/simulation.py"
click node_scenario "https://github.com/cyprien63/voltforge/blob/main/core/scenario.py"
click node_solver "https://github.com/cyprien63/voltforge/blob/main/core/solver.py"
click node_measurements "https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py"
click node_project "https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py"
click node_static "https://github.com/cyprien63/voltforge/blob/main/exporters/static.py"
click node_gif "https://github.com/cyprien63/voltforge/blob/main/exporters/gif.py"

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_window,node_canvas,node_calculators toneBlue
class node_circuit,node_components,node_arrows,node_formatting toneAmber
class node_engine,node_scenario,node_solver,node_measurements toneMint
class node_project,node_static,node_gif toneRose
class node_user,node_files toneIndigo
```

## Components

### Design interface

- [Main window](https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py): `ui/main_window.py`
- [Interactive canvas](https://github.com/cyprien63/voltforge/blob/main/ui/canvas.py): `ui/canvas.py`
- [Circuit calculators](https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py): `ui/main_window.py`

### Circuit model

- [Circuit topology](https://github.com/cyprien63/voltforge/blob/main/core/circuit.py): `core/circuit.py`
- [Component models](https://github.com/cyprien63/voltforge/blob/main/core/components.py): `core/components.py`
- [Voltage annotations](https://github.com/cyprien63/voltforge/blob/main/core/voltage_arrow.py): `core/voltage_arrow.py`
- [SI formatting](https://github.com/cyprien63/voltforge/blob/main/core/formatting.py): `core/formatting.py`

### Simulation

- [Simulation engine](https://github.com/cyprien63/voltforge/blob/main/core/simulation.py): `core/simulation.py`
- [Scenario parser](https://github.com/cyprien63/voltforge/blob/main/core/scenario.py): `core/scenario.py`
- [MNA solver](https://github.com/cyprien63/voltforge/blob/main/core/solver.py): `core/solver.py`
- [Results and measurements](https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py): `ui/main_window.py`

### Projects and exports

- [Project persistence](https://github.com/cyprien63/voltforge/blob/main/ui/main_window.py): `ui/main_window.py`
- [Static diagram export](https://github.com/cyprien63/voltforge/blob/main/exporters/static.py): `exporters/static.py`
- [Scenario GIF export](https://github.com/cyprien63/voltforge/blob/main/exporters/gif.py): `exporters/gif.py`

### Other components

- **Circuit designer**
- **Project or export file**

## Connections

- Circuit designer → Main window: uses (evidence: `README.md`)
- Main window → Interactive canvas: hosts (evidence: `ui/main_window.py`)
- Circuit designer → Interactive canvas: edits circuit (evidence: `README.md`)
- Interactive canvas → Circuit topology: updates topology (evidence: `ui/canvas.py`)
- Interactive canvas → Component models: renders and edits (evidence: `ui/canvas.py`)
- Interactive canvas → Simulation engine: refreshes simulation (evidence: `ui/canvas.py`)
- Circuit topology → Component models: resolves terminals (evidence: `core/circuit.py`)
- Circuit topology → Voltage annotations: loads annotations (evidence: `core/circuit.py`)
- Main window → Simulation engine: orchestrates (evidence: `ui/main_window.py`)
- Simulation engine → Scenario parser: parses scenario (evidence: `core/simulation.py`)
- Simulation engine → MNA solver: solves circuit (evidence: `core/simulation.py`)
- MNA solver → Circuit topology: reads topology (evidence: `core/solver.py`)
- MNA solver → Component models: evaluates branches (evidence: `core/solver.py`)
- Component models → SI formatting: formats values (evidence: `core/components.py`)
- Scenario parser → SI formatting: parses quantities (evidence: `core/scenario.py`)
- Main window → Results and measurements: displays results (evidence: `ui/main_window.py`)
- Circuit designer → Circuit calculators: uses (evidence: `README.md`)
- Main window → Project persistence: manages projects (evidence: `README.md`)
- Project persistence → Project or export file: reads and writes (evidence: `README.md`)
- Main window → Static diagram export: exports diagram (evidence: `ui/main_window.py`)
- Static diagram export → Interactive canvas: renders scene (evidence: `exporters/static.py`)
- Main window → Scenario GIF export: exports animation (evidence: `ui/main_window.py`)
- Scenario GIF export → Simulation engine: advances scenario (evidence: `exporters/gif.py`)
- Scenario GIF export → Static diagram export: captures frames (evidence: `exporters/gif.py`)
- Static diagram export → Project or export file: writes diagram (evidence: `README.md`)
- Scenario GIF export → Project or export file: writes GIF (evidence: `README.md`)
