# alooistasty/rotating-donut architecture

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

- Interactive diagram: https://gitdiagram.com/alooistasty/rotating-donut
- Repository: https://github.com/alooistasty/rotating-donut

## Overview

This is a small standalone C++ terminal animation: the program samples a torus, transforms and projects its points, resolves visible lit characters into a frame, and repeatedly prints frames while advancing rotation angles. The implementation is inline in main.cpp rather than divided into runtime modules; the nodes describe its meaningful stages, not separate classes. Relationships are supported by the README workflow and the main.cpp excerpt.

Main entry points: [`main.cpp`](https://github.com/alooistasty/rotating-donut/blob/main/main.cpp) (Frame loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Terminal user"))
node_loop["Frame loop<br/>[main.cpp]"]
node_torus["Torus sampling<br/>[main.cpp]"]
node_projection["Rotation and projection<br/>[main.cpp]"]
node_shading["Depth and lighting<br/>[main.cpp]"]
node_frame["ASCII frame<br/>[main.cpp]"]
node_terminal["Terminal output<br/>[main.cpp]"]

node_user -->|"runs"| node_loop
node_loop -->|"samples points"| node_torus
node_loop -->|"transforms and projects"| node_projection
node_loop -->|"tests depth and lights"| node_shading
node_loop -->|"writes characters"| node_frame
node_loop -->|"prints frame"| node_terminal
node_loop -->|"advances angles"| node_loop

click node_loop "https://github.com/alooistasty/rotating-donut/blob/main/main.cpp"
click node_torus "https://github.com/alooistasty/rotating-donut/blob/main/main.cpp"
click node_projection "https://github.com/alooistasty/rotating-donut/blob/main/main.cpp"
click node_shading "https://github.com/alooistasty/rotating-donut/blob/main/main.cpp"
click node_frame "https://github.com/alooistasty/rotating-donut/blob/main/main.cpp"
click node_terminal "https://github.com/alooistasty/rotating-donut/blob/main/main.cpp"

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_user toneBlue
class node_loop,node_torus,node_projection,node_shading,node_frame,node_terminal toneTeal
```

## Components

### Other components

- **Terminal user**
- [Frame loop](https://github.com/alooistasty/rotating-donut/blob/main/main.cpp): `main.cpp`
- [Torus sampling](https://github.com/alooistasty/rotating-donut/blob/main/main.cpp): `main.cpp`
- [Rotation and projection](https://github.com/alooistasty/rotating-donut/blob/main/main.cpp): `main.cpp`
- [Depth and lighting](https://github.com/alooistasty/rotating-donut/blob/main/main.cpp): `main.cpp`
- [ASCII frame](https://github.com/alooistasty/rotating-donut/blob/main/main.cpp): `main.cpp`
- [Terminal output](https://github.com/alooistasty/rotating-donut/blob/main/main.cpp): `main.cpp`

## Connections

- Terminal user → Frame loop: runs (evidence: `README.md`)
- Frame loop → Torus sampling: samples points (evidence: `main.cpp`)
- Frame loop → Rotation and projection: transforms and projects (evidence: `main.cpp`)
- Frame loop → Depth and lighting: tests depth and lights (evidence: `main.cpp`)
- Frame loop → ASCII frame: writes characters (evidence: `main.cpp`)
- Frame loop → Terminal output: prints frame (evidence: `main.cpp`)
- Frame loop → Frame loop: advances angles (evidence: `main.cpp`)
