# kriptolix/poliedros architecture

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

- Interactive diagram: https://gitdiagram.com/kriptolix/poliedros
- Repository: https://github.com/kriptolix/poliedros

## Overview

Poliedros is a GTK desktop dice roller. Users enter a quick-roll selection or an expression, invoke a roll, and receive a total and roll log; optional 3D animation and sound accompany supported rolls. The parser validates and structures expressions, and the roller evaluates dice pools and functions. The README also documents advanced operations such as keep, count, reroll, explode, and multiroll. Evidence is limited to the README and the sampled source excerpts; unsampled feature wiring is not assumed.

Main entry points: [`src/application.py`](https://github.com/kriptolix/poliedros/blob/master/src/application.py) (Application controller), [`src/gtk/widgets/rollarea.py`](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/rollarea.py) (Roll entry area), [`src/gtk/widgets/gldicearea.py`](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/gldicearea.py) (3D dice view), [`src/gtk/widgets/mainwindow.py`](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/mainwindow.py) (Main window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_app["Application controller<br/>[application.py]"]
  node_window["Main window<br/>[mainwindow.py]"]
  node_rollarea["Roll entry area<br/>[rollarea.py]"]
  node_dicearea["Quick dice controls<br/>[dicearea.py]"]
  node_advanced["Advanced mode<br/>[advancedmode.py]"]
  node_infoarea["Usage information<br/>[infoarea.py]"]
  node_usageinfo["Usage dialog<br/>[usageinfo.py]"]
end

subgraph group_expression["Roll language"]
  node_parser["Expression parser<br/>[parser.py]"]
end

subgraph group_execution["Roll execution"]
  node_roller["Dice and function evaluator<br/>[roller.py]"]
end

subgraph group_presentation["Results and rendering"]
  node_history["Roll history<br/>[sidebar.py]"]
  node_historyentry["History entry and reroll<br/>[logentry.py]"]
  node_glarea["3D dice view<br/>[gldicearea.py]"]
  node_pydice3d["3D simulation and renderer"]
end

node_player(("Player"))

node_player -->|"starts app"| node_app
node_app -->|"creates window"| node_window
node_window -->|"hosts entry"| node_rollarea
node_rollarea -->|"uses controls"| node_dicearea
node_player -->|"enters roll"| node_rollarea
node_rollarea -.->|"requests roll"| node_app
node_app -->|"parses expression"| node_parser
node_app -->|"evaluates parsed roll"| node_roller
node_app -->|"updates total"| node_rollarea
node_app -->|"adds roll record"| node_history
node_history -->|"creates entry"| node_historyentry
node_historyentry -->|"reruns expression"| node_app
node_app -->|"starts animation"| node_glarea
node_rollarea -->|"embeds view"| node_glarea
node_glarea -->|"simulates and renders"| node_pydice3d
node_player -->|"builds advanced rolls"| node_advanced
node_player -->|"requests help"| node_infoarea
node_infoarea -->|"opens dialog"| node_usageinfo

click node_app "https://github.com/kriptolix/poliedros/blob/master/src/application.py"
click node_window "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/mainwindow.py"
click node_rollarea "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/rollarea.py"
click node_dicearea "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/dicearea.py"
click node_advanced "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/advancedmode.py"
click node_parser "https://github.com/kriptolix/poliedros/blob/master/src/parser.py"
click node_roller "https://github.com/kriptolix/poliedros/blob/master/src/roller.py"
click node_history "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/sidebar.py"
click node_historyentry "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/logentry.py"
click node_glarea "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/gldicearea.py"
click node_infoarea "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/infoarea.py"
click node_usageinfo "https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/usageinfo.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_app,node_window,node_rollarea,node_dicearea,node_advanced,node_infoarea,node_usageinfo toneBlue
class node_parser toneAmber
class node_roller toneMint
class node_history,node_historyentry,node_glarea,node_pydice3d toneRose
class node_player toneIndigo
```

## Components

### Desktop interface

- [Application controller](https://github.com/kriptolix/poliedros/blob/master/src/application.py): `src/application.py`
- [Main window](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/mainwindow.py): `src/gtk/widgets/mainwindow.py`
- [Roll entry area](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/rollarea.py): `src/gtk/widgets/rollarea.py`
- [Quick dice controls](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/dicearea.py): `src/gtk/widgets/dicearea.py`
- [Advanced mode](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/advancedmode.py): `src/gtk/widgets/advancedmode.py`
- [Usage information](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/infoarea.py): `src/gtk/widgets/infoarea.py`
- [Usage dialog](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/usageinfo.py): `src/gtk/widgets/usageinfo.py`

### Roll language

- [Expression parser](https://github.com/kriptolix/poliedros/blob/master/src/parser.py): `src/parser.py`

### Roll execution

- [Dice and function evaluator](https://github.com/kriptolix/poliedros/blob/master/src/roller.py): `src/roller.py`

### Results and rendering

- [Roll history](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/sidebar.py): `src/gtk/widgets/sidebar.py`
- [History entry and reroll](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/logentry.py): `src/gtk/widgets/logentry.py`
- [3D dice view](https://github.com/kriptolix/poliedros/blob/master/src/gtk/widgets/gldicearea.py): `src/gtk/widgets/gldicearea.py`
- **3D simulation and renderer**

### Other components

- **Player**

## Connections

- Player → Application controller: starts app (evidence: `README.md`)
- Application controller → Main window: creates window (evidence: `src/application.py`)
- Main window → Roll entry area: hosts entry (evidence: `src/gtk/widgets/mainwindow.py`)
- Roll entry area → Quick dice controls: uses controls (evidence: `src/gtk/widgets/rollarea.py`)
- Player → Roll entry area: enters roll (evidence: `README.md`)
- Roll entry area → Application controller: requests roll
- Application controller → Expression parser: parses expression (evidence: `src/application.py`)
- Application controller → Dice and function evaluator: evaluates parsed roll (evidence: `src/application.py`)
- Application controller → Roll entry area: updates total (evidence: `src/application.py`)
- Application controller → Roll history: adds roll record (evidence: `src/application.py`)
- Roll history → History entry and reroll: creates entry (evidence: `src/gtk/widgets/sidebar.py`)
- History entry and reroll → Application controller: reruns expression (evidence: `src/gtk/widgets/logentry.py`)
- Application controller → 3D dice view: starts animation (evidence: `src/application.py`)
- Roll entry area → 3D dice view: embeds view (evidence: `src/gtk/widgets/rollarea.py`)
- 3D dice view → 3D simulation and renderer: simulates and renders (evidence: `src/gtk/widgets/gldicearea.py`)
- Player → Advanced mode: builds advanced rolls (evidence: `README.md`)
- Player → Usage information: requests help (evidence: `src/gtk/widgets/infoarea.py`)
- Usage information → Usage dialog: opens dialog (evidence: `src/gtk/widgets/infoarea.py`)
