# xypwn/scadqr architecture

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

- Interactive diagram: https://gitdiagram.com/xypwn/scadqr
- Repository: https://github.com/xypwn/scadqr
- Video tour (about a minute): https://gitdiagram.com/xypwn/scadqr/video

## Overview

scadqr is an OpenSCAD library that turns text or structured messages into QR-code geometry. Users provide content to `qr()` or `qr_custom()`; message helpers such as Wi-Fi and phone-call functions can produce content for those renderers. Custom rendering supports user-defined modules and finder/alignment patterns. The source tree identifies QR, bit, and data modules, but their implementation details were not sampled, so internal call relationships are omitted.

Main entry points: [`src/qr.scad`](https://github.com/xypwn/scadqr/blob/main/src/qr.scad) (QR renderers), [`src/data.scad`](https://github.com/xypwn/scadqr/blob/main/src/data.scad) (Message helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_messages["Message helpers"]
  node_messages["Message helpers<br/>[data.scad]"]
end

subgraph group_qr["QR generation"]
  node_qr["QR renderers<br/>[qr.scad]"]
end

subgraph group_bits["Bit utilities"]
  node_bits["Bit operations<br/>[bits.scad]"]
end

node_user(("OpenSCAD user"))
node_geometry["QR geometry"]

node_user -->|"creates message"| node_messages
node_messages -->|"passes message"| node_qr
node_user -->|"provides text or customizes"| node_qr
node_qr -->|"renders geometry"| node_geometry

click node_messages "https://github.com/xypwn/scadqr/blob/main/src/data.scad"
click node_qr "https://github.com/xypwn/scadqr/blob/main/src/qr.scad"
click node_bits "https://github.com/xypwn/scadqr/blob/main/src/bits.scad"

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_messages,node_user toneBlue
class node_qr toneAmber
class node_bits toneMint
class node_geometry toneIndigo
```

## Components

### Message helpers

- [Message helpers](https://github.com/xypwn/scadqr/blob/main/src/data.scad): `src/data.scad`

### QR generation

- [QR renderers](https://github.com/xypwn/scadqr/blob/main/src/qr.scad): `src/qr.scad`

### Bit utilities

- [Bit operations](https://github.com/xypwn/scadqr/blob/main/src/bits.scad): `src/bits.scad`

### Other components

- **OpenSCAD user**
- **QR geometry**

## Connections

- OpenSCAD user → Message helpers: creates message
- Message helpers → QR renderers: passes message
- OpenSCAD user → QR renderers: provides text or customizes
- QR renderers → QR geometry: renders geometry
