Baumann Works logo
Baumann Works Tools, code, and hardware
Baumann Works

M1730-Scale

Mar 2026 ·Active ·source

M1730-Scale

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

SVG scale artwork and web generator for M1730 analog panel meters. Scales are typeset in ГОСТ тип А (GOST type A), the Russian technical drafting standard typeface.

Repository layout

M1730-Scale_template.svg   Inkscape working file (background, tick marks, labels)
M1730-Scale_paths.svg      Paths-only export — text converted to outlines
M1730-Scale_text.svg       Live-text export — embedded font, editable labels
fonts/                     ГОСТ тип А TTF (required for Docker build)
web/                       Flask web generator
k8s/                       Kubernetes manifests
Dockerfile                 Container build

SVG files

All canvases are 157.18 × 26.68 mm. The coordinate origin is offset: layer 1 carries transform="translate(-37.352226,-90.454928)", so absolute SVG coordinates begin around x=37, y=90.

FilePurpose
M1730-Scale_template.svgMaster Inkscape file. Contains background path, tick marks, unit label, numeric labels, and range label. Edit this one.
M1730-Scale_paths.svgAll text converted to outlines. Use for cutting plotters, laser engravers, or any workflow where fonts must not be embedded as live text.
M1730-Scale_text.svgLive <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 scale SVGs from a form. Supports two output modes switchable in the UI:

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

FieldDescription
UnitSymbol shown in the left panel (e.g. U, mA, %). Supports inline markup — see below
Range labelText inside the coloured bar on the right (e.g. 5mA)
MappingLinear, (square root), or Log. Major ticks are always evenly spaced physically; the mapping controls their values and how minor ticks are placed within each interval. See below.
Min / MaxNumeric range of the scale
Major intervalsNumber of major tick intervals
Minor per intervalMinor ticks between each pair of major ticks
LabelsNumber of numeric labels; Labels − 1 should divide evenly into Major intervals
Custom labelsOptional comma-separated labels that override the calculated numbers; their count sets the number of labels. Leave blank to auto-calculate
Label size (mm)Font size of the numeric labels, in millimetres (default 9)
Midpoint tick labelsOptional labels at the medium-length mid ticks (only shown when Minor per interval is odd)
Tick length & thicknessConfigurable Major / Middle / Minor tick length and thickness
FontPer-element font selection (Default, Number labels, Main unit, Range label)
Colour barOptional coloured segments drawn in the strip below the ticks, positioned by value and mapping

Calculated numbers are rendered in fixed-point notation at 4 significant figures — never scientific (e.g. 10000, not 1e+04).

Scale mappings

MappingMajor tick valuesMinor tick placementConstraints
LinearEvenly spacedUniformNone
Quadratic (0, 1, 4, 9 … × max) — compresses low valuesCrowded toward the low end of each intervalMin ≥ 0
LogGeometric (min × r⁰, r¹, r² …) — each interval spans the same ratioCrowded toward the high end of each intervalMin and Max > 0
1/xHarmonic (values decrease left → right, e.g. ∞, 10, 5, 2, 1) — compresses high valuesUniform (in position space, i.e. proportional to 1/v)Min and Max > 0; Max may be ∞

The √ mapping is typical for AC RMS current and power meters, where needle deflection is proportional to the square of the measured quantity. The 1/x mapping is used for ohms/resistance scales, where values decrease from left (high resistance / ∞) to right (low resistance).

Unit markup

The Unit field accepts a lightweight shorthand (no LaTeX engine — everything is drawn as glyph paths and auto-sized to fit the panel):

MarkupResult
cm^2superscript (^{...} for multiple characters)
H_2Osubscript (_{...} for multiple characters)
{1/2}stacked fraction with a horizontal rule; a bare / stays inline
[AC], [DC], [ACDC]dotted instrument symbols (sine / dashed-line)

Constructs nest: {m/s^2} is a fraction with a superscript in the denominator, x^{1/2} a superscripted fraction. Custom numeric labels and the range label accept the same markup. A label containing markup is always emitted as paths, even in text-output mode, since it is a composite of glyphs and a rule.

Glyphs missing from the selected font (e.g. Ω) are drawn automatically from a fallback font (FreeSans, FreeSerif, FreeMono), so special characters always render.

Container

docker build -t m1730-scale:latest .
docker run -p 5000:5000 m1730-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/m1730-generator.

Kubernetes

Manifests in k8s/ deploy to the works namespace with a Traefik v2 IngressRoute at works.baumann.gr/M1730-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.

← Rotary Dial E440-Scale →