No description
  • Python 59.1%
  • HTML 40.6%
  • Dockerfile 0.3%
Find a file
Adrian A. Baumann 3a8422ac24 Update README.md
Yet again...

Signed-off-by: Adrian A. Baumann <ade@adebaumann.com>
2026-08-09 10:01:24 +00:00
docs/superpowers Add implementation plan for E440 arc-dial scale generator 2026-07-28 23:24:43 +02:00
fonts Documentation updated 2026-08-07 14:00:55 +02:00
k8s Code review suggestions worked in 2026-08-03 01:40:09 +02:00
web Add optional labels for midpoint ticks 2026-08-07 14:14:42 +02:00
.dockerignore Add web SVG generator, container, and Kubernetes manifests 2026-07-12 00:29:55 +02:00
.gitignore Ignore .superpowers/ scratch workspace 2026-07-28 23:35:25 +02:00
CLAUDE.md Documentation updated 2026-08-07 14:00:55 +02:00
Dockerfile Code review suggestions worked in 2026-08-03 01:40:09 +02:00
E440-Scale_paths.svg Fix final-review findings: unit-label baseline, sqrt minor-tick math, dead code, edge cases 2026-07-29 00:48:54 +02:00
E440-Scale_template.svg Replace M1730 deliverable SVGs with generated E440 template/paths/text files 2026-07-29 00:06:37 +02:00
E440-Scale_text.svg Fix final-review findings: unit-label baseline, sqrt minor-tick math, dead code, edge cases 2026-07-29 00:48:54 +02:00
LICENSE Fix final-review findings: unit-label baseline, sqrt minor-tick math, dead code, edge cases 2026-07-29 00:48:54 +02:00
README.md Update README.md 2026-08-09 10:01:24 +00:00

E440-Scale

This code is deprecated. It's functionality has been integrated in Scale Generator

SVG scale artwork and web generator for E440-style round-dial analog panel meters. Scales are typeset in Alte DIN 1451 Mittelschrift.

Repository layout

E440-Scale_template.svg   Inkscape working file (case body, tick marks, labels)
E440-Scale_paths.svg      Paths-only export — text converted to outlines
E440-Scale_text.svg       Live-text export — embedded font, editable labels
fonts/                     TTF fonts (required for Docker build)
web/                       Flask web generator
k8s/                       Kubernetes manifests
Dockerfile                 Container build

SVG files

The canvas is 93.824249 × 57.215687 mm. The coordinate origin is offset: layer 1 carries transform="translate(-60.717741,-107.14126)", so absolute SVG coordinates begin around x=61, y=107.

The dial's case geometry — body outline, mounting ears, pivot point (local 107.42845, 162.62819), rim radius (43.842751 mm), and angular sweep (±45.667° from vertical) — is fixed across every generated scale. Only the tick marks, numeric labels, unit label, and corner text vary.

File Purpose
E440-Scale_template.svg Master Inkscape file. Edit this one.
E440-Scale_paths.svg All text converted to outlines. Use for cutting plotters, laser engravers, or any workflow where fonts must not be embedded as live text.
E440-Scale_text.svg Live <text> nodes with the font embedded as base64. Smaller file; requires an SVG viewer that supports embedded fonts.

Open files in Inkscape (developed with v1.4.3). There is no build step — edit the SVG directly or use the web generator.

Web generator

A Flask app that generates arc-dial scale SVGs from a form. Supports two output modes switchable in the UI:

  • Paths — glyphs rendered as outlines via fontTools; opens cleanly in Inkscape, Illustrator, and cutting software
  • Text — live <text> elements with the selected font embedded as base64

Run locally

source .venv/bin/activate
cd web && python app.py      # http://localhost:5000

Fonts are loaded at startup from the fonts/ directory in the repo root.

Form parameters

Field Description
Unit Symbol shown centered above the arc (e.g. uA, V, %). Supports inline markup — see below
<<<<<<< Updated upstream
Left label / Right label Up to 2 lines each, placed in the bottom-left/bottom-right corners of the dial. Support the same math markup as the unit label
Mapping Linear, (square root), Log, or 1/x (reciprocal). Major ticks are always evenly spaced angularly; the mapping controls their values and how minor ticks are placed within each interval.
Min / Max Numeric range of the scale. For reciprocal scales Max may be ∞ (tick the "Max is ∞" box)

======= | Left label / Right label | Up to 2 lines each, placed in the bottom-left/bottom-right corners of the dial. Support the same inline markup as the unit label | | Mapping | Linear, (square root), Log, or 1/x (reciprocal). Major ticks are always evenly spaced angularly; the mapping controls their values and how minor ticks are placed within each interval. | | Min / Max | Numeric range of the scale. Max may be set to ∞ (infinite) for the 1/x mapping |

Stashed changes | Major intervals | Number of major tick intervals | | Minor per interval | Minor ticks between each pair of major ticks. When odd, the exact midpoint subdivision is drawn as a taller "medium" tick, matching the reference dial's 3-tier tick scheme | | Labels | Number of numeric labels; Labels 1 should divide evenly into Major intervals | | Custom labels | Optional comma-separated labels that override the calculated numbers | | Label size (mm) | Font size of the numeric labels, in millimetres (default 5.1126) | | Font | Font used for all text, chosen from every .ttf in fonts/ (default Alte DIN 1451 Mittelschrift) | | Tick size | Collapsible section — overrides the length and thickness of major, medium, and small ticks (defaults match the hand-drawn files) |

Fonts — numeric labels, the unit label, and the left/right corner labels each have their own font dropdown (default Alte DIN 1451 Mittelschrift). Unit and corner label sizes are independently adjustable; the unit label auto-sizes to fit above the arc unless you set an explicit size.

Ticks — the length and stroke width of each of the three tick tiers (major, medium, small) are configurable in millimetres.

Colour segments — draw one or more concentric coloured arc bands from value a to value b (e.g. red/green/yellow zone markings). Each segment can carry its own colour and stroke width; a global thickness and radial offset set the defaults. Colours must be hex values such as #ff0000.

Scale mappings

Mapping Major tick values Minor tick placement Constraints
Linear Evenly spaced Uniform None
Quadratic (0, 1, 4, 9 … × max) — compresses low values Crowded toward the high end of each interval Min ≥ 0
Log Geometric (min × r⁰, r¹, r² …) — each interval spans the same ratio Crowded toward the high end of each interval Min and Max > 0
1/x Harmonic (values decrease left → right, e.g. ∞, 10, 5, 2, 1) — compresses high values Uniform (in angle space, i.e. proportional to 1/v) Min and Max > 0; Max may be ∞

Inline text markup

<<<<<<< Updated upstream The Unit, left-label, and right-label fields accept a lightweight shorthand (no LaTeX engine — everything is drawn as glyph paths and auto-sized to fit above the arc):

The Unit and corner-label fields accept a lightweight shorthand (no LaTeX engine — everything is drawn as glyph paths; the unit label auto-sizes to fit above the arc):

Stashed changes

Markup Result
cm^2 superscript (^{...} for multiple characters)
H_2O subscript (_{...} for multiple characters)
{1/2} stacked fraction with a horizontal rule; a bare / stays inline
<<<<<<< Updated upstream
[ac] [dc] [acdc] drawn AC waveform, DC dashed line, or combined symbol

Constructs nest: {m/s^2} is a fraction with a superscript in the denominator, x^{1/2} a superscripted fraction, [ac]V an AC voltage symbol.

Missing glyphs fall back across the bundled fonts (e.g. and Ω). Deeply nested markup is rejected as an error.

Testing

The app ships an unittest suite; run it from the web/ directory with the repo-root venv active:

source .venv/bin/activate
cd web && python -m unittest discover -s tests -v

======= | [AC], [DC], [ACDC] | vector symbols for AC, DC, and combined AC/DC (case-insensitive) |

Constructs nest: {m/s^2} is a fraction with a superscript in the denominator, x^{1/2} a superscripted fraction. The same markup applies to the left/right corner labels, which are rendered as glyph paths.

Stashed changes

Container

docker build -t e440-scale:latest .
docker run -p 5000:5000 e440-scale:latest

Fonts are loaded from fonts/ in the repo root; they are bundled into the image at build time.

The production image is at git.baumann.gr/adebaumann/e440-generator.

Kubernetes

Manifests in k8s/ deploy to the works namespace with a Traefik v2 IngressRoute at works.baumann.gr/E440-generator.

# Managed by ArgoCD — push to git to deploy
git push

Resources: namespace, deployment (1 replica, gunicorn), ClusterIP service, Traefik IngressRoute + stripPrefix middleware.

License

GPL-3.0 — see LICENSE.