82 lines
3.1 KiB
Markdown
82 lines
3.1 KiB
Markdown
# M1730-Scale
|
||
|
||
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.
|
||
|
||
| File | Purpose |
|
||
|---|---|
|
||
| `M1730-Scale_template.svg` | Master Inkscape file. Contains background path, tick marks, unit label, numeric labels, and range label. Edit this one. |
|
||
| `M1730-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. |
|
||
| `M1730-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 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 GOST font embedded as base64
|
||
|
||
### Run locally
|
||
|
||
```bash
|
||
source .venv/bin/activate
|
||
cd web && python app.py # http://localhost:5000
|
||
```
|
||
|
||
The font must be installed at `/usr/local/share/fonts/г/ГОСТ_тип_А.ttf`.
|
||
|
||
### Form parameters
|
||
|
||
| Field | Description |
|
||
|---|---|
|
||
| Unit | Symbol shown in the left panel (e.g. `U`, `mA`, `%`) |
|
||
| Range label | Text inside the coloured bar on the right (e.g. `5mA`) |
|
||
| Min / Max | Numeric range of the scale |
|
||
| Major intervals | Number of major tick intervals |
|
||
| Minor per interval | Minor ticks between each pair of major ticks |
|
||
| Labels | Number of numeric labels; Labels − 1 should divide evenly into Major intervals |
|
||
|
||
## Container
|
||
|
||
```bash
|
||
# Copy the font first (not redistributed via the registry)
|
||
cp /usr/local/share/fonts/г/ГОСТ_тип_А.ttf fonts/
|
||
|
||
docker build -t m1730-scale:latest .
|
||
docker run -p 5000:5000 m1730-scale:latest
|
||
```
|
||
|
||
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`.
|
||
|
||
```bash
|
||
# 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](LICENSE).
|