# umurotti/3d-visualizer architecture

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

- Interactive diagram: https://gitdiagram.com/umurotti/3d-visualizer
- Repository: https://github.com/umurotti/3d-visualizer

## Overview

This is a Flask-backed 3D visualizer: a Python caller submits meshes, point clouds, camera frustums, and axes; the server holds the current scene; a browser polls that state and renders it with Three.js. Browser controls support orbiting and visibility toggles, while scene rendering covers meshes, point clouds, frustums, and coordinate axes. The graph reflects the sampled client, server, and browser code plus README capabilities; the HTML template and some wiring were not sampled, so only documented or directly visible relationships are shown.

Main entry points: [`static/js/scene.js`](https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js) (Scene Setup), [`static/js/api.js`](https://github.com/umurotti/3d-visualizer/blob/main/static/js/api.js) (Scene Polling), [`app.py`](https://github.com/umurotti/3d-visualizer/blob/main/app.py) (HTTP API), [`static/js/main.js`](https://github.com/umurotti/3d-visualizer/blob/main/static/js/main.js) (Browser Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_python["Python API"]
  node_client["Online Viewer Client<br/>[viewer_client.py]"]
end

subgraph group_server["Flask Service"]
  node_http["HTTP API<br/>[app.py]"]
  node_state[("Scene State<br/>[app.py]")]
end

subgraph group_browser["Browser Viewer"]
  node_page["Viewer Page<br/>[viewer.html]"]
  node_entry["Browser Startup<br/>[main.js]"]
  node_poller["Scene Polling<br/>[api.js]"]
  node_controls["Orbit Controls<br/>[controls.js]"]
end

subgraph group_render["3D Rendering"]
  node_scene["Scene Setup<br/>[scene.js]"]
  node_geometry["Mesh Rendering<br/>[scene.js]"]
  node_clouds["Point Rendering<br/>[scene.js]"]
  node_frustums["Frustum Rendering<br/>[scene.js]"]
  node_axes["Coordinate Axes<br/>[scene.js]"]
  node_labels["Labels<br/>[utils.js]"]
end

node_caller(("Python Caller"))

node_caller -->|"uses"| node_client
node_client -->|"posts scene updates"| node_http
node_http -->|"updates scene state"| node_state
node_http -->|"reads scene state"| node_state
node_http -->|"serves page"| node_page
node_page -.->|"loads viewer"| node_entry
node_entry -->|"initializes and animates"| node_scene
node_entry -->|"sets up controls"| node_controls
node_entry -->|"starts polling"| node_poller
node_poller -->|"fetches scene"| node_http
node_poller -->|"sets meshes"| node_geometry
node_poller -->|"sets point clouds"| node_clouds
node_poller -->|"updates frustums"| node_frustums
node_poller -->|"updates axes"| node_axes
node_controls -->|"controls camera"| node_scene
node_scene -->|"creates labels"| node_labels
node_geometry -->|"adds objects"| node_scene
node_clouds -->|"adds objects"| node_scene
node_frustums -->|"adds lines"| node_scene
node_axes -->|"adds helpers"| node_scene

click node_client "https://github.com/umurotti/3d-visualizer/blob/main/viewer_client.py"
click node_http "https://github.com/umurotti/3d-visualizer/blob/main/app.py"
click node_state "https://github.com/umurotti/3d-visualizer/blob/main/app.py"
click node_page "https://github.com/umurotti/3d-visualizer/blob/main/templates/viewer.html"
click node_entry "https://github.com/umurotti/3d-visualizer/blob/main/static/js/main.js"
click node_poller "https://github.com/umurotti/3d-visualizer/blob/main/static/js/api.js"
click node_controls "https://github.com/umurotti/3d-visualizer/blob/main/static/js/controls.js"
click node_scene "https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js"
click node_geometry "https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js"
click node_clouds "https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js"
click node_frustums "https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js"
click node_axes "https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js"
click node_labels "https://github.com/umurotti/3d-visualizer/blob/main/static/js/utils.js"

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_client toneBlue
class node_http,node_state toneAmber
class node_page,node_entry,node_poller,node_controls toneMint
class node_scene,node_geometry,node_clouds,node_frustums,node_axes,node_labels toneRose
class node_caller toneIndigo
```

## Components

### Python API

- [Online Viewer Client](https://github.com/umurotti/3d-visualizer/blob/main/viewer_client.py): `viewer_client.py`

### Flask Service

- [HTTP API](https://github.com/umurotti/3d-visualizer/blob/main/app.py): `app.py`
- [Scene State](https://github.com/umurotti/3d-visualizer/blob/main/app.py): `app.py`

### Browser Viewer

- [Viewer Page](https://github.com/umurotti/3d-visualizer/blob/main/templates/viewer.html): `templates/viewer.html`
- [Browser Startup](https://github.com/umurotti/3d-visualizer/blob/main/static/js/main.js): `static/js/main.js`
- [Scene Polling](https://github.com/umurotti/3d-visualizer/blob/main/static/js/api.js): `static/js/api.js`
- [Orbit Controls](https://github.com/umurotti/3d-visualizer/blob/main/static/js/controls.js): `static/js/controls.js`

### 3D Rendering

- [Scene Setup](https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js): `static/js/scene.js`
- [Mesh Rendering](https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js): `static/js/scene.js`
- [Point Rendering](https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js): `static/js/scene.js`
- [Frustum Rendering](https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js): `static/js/scene.js`
- [Coordinate Axes](https://github.com/umurotti/3d-visualizer/blob/main/static/js/scene.js): `static/js/scene.js`
- [Labels](https://github.com/umurotti/3d-visualizer/blob/main/static/js/utils.js): `static/js/utils.js`

### Other components

- **Python Caller**

## Connections

- Python Caller → Online Viewer Client: uses (evidence: `README.md`)
- Online Viewer Client → HTTP API: posts scene updates (evidence: `viewer_client.py`)
- HTTP API → Scene State: updates scene state (evidence: `app.py`)
- HTTP API → Scene State: reads scene state (evidence: `app.py`)
- HTTP API → Viewer Page: serves page (evidence: `app.py`)
- Viewer Page → Browser Startup: loads viewer (evidence: `README.md`)
- Browser Startup → Scene Setup: initializes and animates (evidence: `static/js/main.js`)
- Browser Startup → Orbit Controls: sets up controls (evidence: `static/js/main.js`)
- Browser Startup → Scene Polling: starts polling (evidence: `static/js/main.js`)
- Scene Polling → HTTP API: fetches scene (evidence: `static/js/api.js`)
- Scene Polling → Mesh Rendering: sets meshes (evidence: `static/js/api.js`)
- Scene Polling → Point Rendering: sets point clouds (evidence: `static/js/api.js`)
- Scene Polling → Frustum Rendering: updates frustums (evidence: `static/js/api.js`)
- Scene Polling → Coordinate Axes: updates axes (evidence: `static/js/api.js`)
- Orbit Controls → Scene Setup: controls camera (evidence: `static/js/main.js`)
- Scene Setup → Labels: creates labels (evidence: `static/js/scene.js`)
- Mesh Rendering → Scene Setup: adds objects (evidence: `static/js/scene.js`)
- Point Rendering → Scene Setup: adds objects (evidence: `static/js/scene.js`)
- Frustum Rendering → Scene Setup: adds lines (evidence: `static/js/scene.js`)
- Coordinate Axes → Scene Setup: adds helpers (evidence: `static/js/scene.js`)
