# inconvergent/differential-line architecture

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

- Interactive diagram: https://gitdiagram.com/inconvergent/differential-line
- Repository: https://github.com/inconvergent/differential-line

## Overview

Differential Line is a procedural line-growth simulator and visualization tool. Its main workflow initializes a line, repeatedly moves its vertices and inserts points—often prioritizing sharply curved segments—then renders or exports the evolving shape. The README also describes alternate starting shapes and 3D-like outlines; the main scripts provide animation, detail, and line-oriented variants. The Cython engine and segment implementation are present in the tree but were not sampled, so their internal responsibilities and relationships are shown only at the level supported by the README or visible calls.

Main entry points: [`src/differentialLine.pyx`](https://github.com/inconvergent/differential-line/blob/master/src/differentialLine.pyx) (Line simulation), [`modules/growth.py`](https://github.com/inconvergent/differential-line/blob/master/modules/growth.py) (Point insertion), [`modules/show.py`](https://github.com/inconvergent/differential-line/blob/master/modules/show.py) (Shape rendering), [`main_ani.py`](https://github.com/inconvergent/differential-line/blob/master/main_ani.py) (Animation driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_drivers["Simulation drivers"]
  node_main_ani["Animation driver<br/>[main_ani.py]"]
  node_main["Batch driver<br/>[main.py]"]
  node_main_detail["Detail animation<br/>[main_detail_ani.py]"]
  node_main_line["Line variant<br/>[main_line.py]"]
  node_main_line_ani["Line animation<br/>[main_line_ani.py]"]
end

subgraph group_algorithm["Growth algorithm"]
  node_growth["Point insertion<br/>[growth.py]"]
end

subgraph group_presentation["Rendering and export"]
  node_show["Shape rendering<br/>[show.py]"]
  node_helpers["Stats and export<br/>[helpers.py]"]
end

subgraph group_engine["Geometry engine"]
  node_differential_line["Line simulation"]
  node_segments["Segment geometry<br/>[segments.pyx]"]
end

node_user(("User"))
node_iutils_render["iutils renderer"]
node_iutils_obj["iutils OBJ export"]
node_image["Rendered image"]
node_obj["OBJ geometry"]

node_user -->|"runs"| node_main_ani
node_main_ani -->|"initializes and updates"| node_differential_line
node_main_ani -->|"selects insertions"| node_growth
node_growth -->|"splits edges"| node_differential_line
node_main_ani -->|"renders coordinates"| node_show
node_show -->|"draws with"| node_iutils_render
node_iutils_render -.->|"writes image"| node_image
node_main_ani -->|"exports geometry"| node_helpers
node_helpers -->|"exports OBJ"| node_iutils_obj
node_iutils_obj -->|"writes geometry"| node_obj
node_user -->|"runs"| node_main
node_main -->|"initializes and updates"| node_differential_line
node_main -->|"selects insertions"| node_growth
node_main -->|"renders coordinates"| node_show
node_main -->|"exports geometry"| node_helpers
node_user -.->|"runs"| node_main_detail
node_main_detail -->|"initializes and updates"| node_differential_line
node_main_detail -->|"selects insertions"| node_growth
node_main_detail -->|"renders detail"| node_show
node_user -.->|"runs"| node_main_line
node_main_line -->|"initializes and updates"| node_differential_line
node_main_line -->|"selects insertions"| node_growth
node_main_line -->|"renders coordinates"| node_show
node_user -.->|"runs"| node_main_line_ani
node_main_line_ani -->|"initializes and updates"| node_differential_line
node_main_line_ani -->|"selects insertions"| node_growth
node_main_line_ani -->|"renders coordinates"| node_show
node_differential_line -.->|"uses geometry"| node_segments

click node_main_ani "https://github.com/inconvergent/differential-line/blob/master/main_ani.py"
click node_main "https://github.com/inconvergent/differential-line/blob/master/main.py"
click node_main_detail "https://github.com/inconvergent/differential-line/blob/master/main_detail_ani.py"
click node_main_line "https://github.com/inconvergent/differential-line/blob/master/main_line.py"
click node_main_line_ani "https://github.com/inconvergent/differential-line/blob/master/main_line_ani.py"
click node_growth "https://github.com/inconvergent/differential-line/blob/master/modules/growth.py"
click node_differential_line "https://github.com/inconvergent/differential-line/blob/master/src/differentialLine.pyx"
click node_segments "https://github.com/inconvergent/differential-line/blob/master/src/segments.pyx"
click node_show "https://github.com/inconvergent/differential-line/blob/master/modules/show.py"
click node_helpers "https://github.com/inconvergent/differential-line/blob/master/modules/helpers.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_main_ani,node_main,node_main_detail,node_main_line,node_main_line_ani,node_user toneBlue
class node_growth toneAmber
class node_show,node_helpers toneMint
class node_differential_line,node_segments toneRose
class node_iutils_render,node_iutils_obj,node_image,node_obj toneIndigo
```

## Components

### Simulation drivers

- [Animation driver](https://github.com/inconvergent/differential-line/blob/master/main_ani.py): `main_ani.py`
- [Batch driver](https://github.com/inconvergent/differential-line/blob/master/main.py): `main.py`
- [Detail animation](https://github.com/inconvergent/differential-line/blob/master/main_detail_ani.py): `main_detail_ani.py`
- [Line variant](https://github.com/inconvergent/differential-line/blob/master/main_line.py): `main_line.py`
- [Line animation](https://github.com/inconvergent/differential-line/blob/master/main_line_ani.py): `main_line_ani.py`

### Growth algorithm

- [Point insertion](https://github.com/inconvergent/differential-line/blob/master/modules/growth.py): `modules/growth.py`

### Rendering and export

- [Shape rendering](https://github.com/inconvergent/differential-line/blob/master/modules/show.py): `modules/show.py`
- [Stats and export](https://github.com/inconvergent/differential-line/blob/master/modules/helpers.py): `modules/helpers.py`

### Geometry engine

- [Line simulation](https://github.com/inconvergent/differential-line/blob/master/src/differentialLine.pyx): `src/differentialLine.pyx`
- [Segment geometry](https://github.com/inconvergent/differential-line/blob/master/src/segments.pyx): `src/segments.pyx`

### Other components

- **User**
- **iutils renderer**
- **iutils OBJ export**
- **Rendered image**
- **OBJ geometry**

## Connections

- User → Animation driver: runs (evidence: `README.md`)
- Animation driver → Line simulation: initializes and updates (evidence: `main_ani.py`)
- Animation driver → Point insertion: selects insertions (evidence: `main_ani.py`)
- Point insertion → Line simulation: splits edges (evidence: `modules/growth.py`)
- Animation driver → Shape rendering: renders coordinates (evidence: `main_ani.py`)
- Shape rendering → iutils renderer: draws with (evidence: `modules/show.py`)
- iutils renderer → Rendered image: writes image
- Animation driver → Stats and export: exports geometry (evidence: `main_ani.py`)
- Stats and export → iutils OBJ export: exports OBJ (evidence: `modules/helpers.py`)
- iutils OBJ export → OBJ geometry: writes geometry
- User → Batch driver: runs (evidence: `README.md`)
- Batch driver → Line simulation: initializes and updates (evidence: `main.py`)
- Batch driver → Point insertion: selects insertions (evidence: `main.py`)
- Batch driver → Shape rendering: renders coordinates (evidence: `main.py`)
- Batch driver → Stats and export: exports geometry (evidence: `main.py`)
- User → Detail animation: runs
- Detail animation → Line simulation: initializes and updates (evidence: `main_detail_ani.py`)
- Detail animation → Point insertion: selects insertions (evidence: `main_detail_ani.py`)
- Detail animation → Shape rendering: renders detail (evidence: `main_detail_ani.py`)
- User → Line variant: runs
- Line variant → Line simulation: initializes and updates (evidence: `main_line.py`)
- Line variant → Point insertion: selects insertions (evidence: `main_line.py`)
- Line variant → Shape rendering: renders coordinates (evidence: `main_line.py`)
- User → Line animation: runs
- Line animation → Line simulation: initializes and updates (evidence: `main_line_ani.py`)
- Line animation → Point insertion: selects insertions (evidence: `main_line_ani.py`)
- Line animation → Shape rendering: renders coordinates (evidence: `main_line_ani.py`)
- Line simulation → Segment geometry: uses geometry
