Rebrand infra and docs from M1730 to E440; bump version to 1.0
This commit is contained in:
@@ -4,24 +4,30 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## Project Overview
|
||||
|
||||
SVG scale artwork for M1730 analog meters. The scales are designed in Inkscape (v1.4.3) using the **ГОСТ тип А** (GOST type A) font, a Russian technical drafting standard typeface.
|
||||
SVG scale artwork for E440-style round-dial analog meters. The scales are designed in Inkscape (v1.4.3) using **Alte DIN 1451 Mittelschrift**, a German technical drafting standard typeface.
|
||||
|
||||
All canvas dimensions are **157.18373 mm × 26.683672 mm**. The coordinate origin is offset: `transform="translate(-37.352226,-90.454928)"` is applied to `layer1` in all files, so absolute SVG coordinates start around x=37, y=90 rather than 0,0.
|
||||
The canvas is **93.824249 mm × 57.215687 mm**. The coordinate origin is offset: `transform="translate(-60.717741,-107.14126)"` is applied to `layer1` in all files, so absolute SVG coordinates start around x=61, y=107 rather than 0,0.
|
||||
|
||||
## File Roles
|
||||
|
||||
The three SVG files represent layers of the same design, intended to be combined or used separately:
|
||||
|
||||
- **`M1730-Scale_template.svg`** — Inkscape working template. Contains the background rect+cutout path, the zero tick mark, an end tick mark, the "U" axis label, numeric labels `0` and `X` (placeholder for the full-scale value), and a `5mA` range label. Also contains a `<rect id="rect5">` inside `<defs>` used as a text flow shape (`shape-inside:url(#rect5)`) for the title text block (`id="text5"`).
|
||||
- **`M1730-Scale_paths.svg`** — Paths-only version: all tick marks as `<path>` elements, no text nodes (or text converted to paths). Used for cutting/printing workflows where fonts must not be embedded as live text.
|
||||
- **`M1730-Scale_text.svg`** — Text-overlay version: tick mark paths plus live `<text>` elements for numeric labels. The `sodipodi:docname` is `M1730-Scale.svg`, suggesting this is the "final" named file.
|
||||
- **`E440-Scale_template.svg`** — Inkscape working template. Contains the case body path (with mounting ears and rim cutout), the pivot guide circle, tick marks, numeric labels `0`–`50`, the `uA` unit label, and `Text`/`Left` and `Text`/`Right` corner label placeholders.
|
||||
- **`E440-Scale_paths.svg`** — Paths-only version: all tick marks and text as `<path>`/`<line>` elements, no live text. Used for cutting/printing workflows where fonts must not be embedded as live text.
|
||||
- **`E440-Scale_text.svg`** — Text-overlay version: tick mark lines plus live `<text>` elements for numeric/unit/corner labels, font embedded as base64.
|
||||
|
||||
## Key Design Parameters
|
||||
|
||||
- Stroke colors: `#1a1a1a` (dark near-black) for all scale lines and text; fill `#f9f9f9` for the background panel, `#ffffff` for tick mark strokes.
|
||||
- Major tick stroke-width: `0.555`; border stroke-width: `0.184`.
|
||||
- Scale bar (the colored strip below tick marks): `y` range 107.547–113.746 mm absolute, `x` range 58.444–183.644.
|
||||
- Zero tick at absolute x=60.844; full-scale tick at x=180.251.
|
||||
- Stroke colors: `#1a1a1a` (dark near-black) for tick marks, numeric/unit/corner text; fill `#f9f9f9` for the case body; `#000000` for the rim arc stroke; `#b3b3b3` for the pivot guide circle.
|
||||
- Fixed case geometry (identical across every generated scale — only tick/label/text content varies):
|
||||
- Pivot point (local, pre-translate frame): `(107.42845, 162.62819)`
|
||||
- Rim / inner-tick radius: `43.842751` mm
|
||||
- Angular sweep: `±45.667193°` from vertical, clockwise-positive (low value on the left)
|
||||
- Tick radial lengths: major `4.7839203` mm, medium `3.1215858` mm, small `1.8121802` mm
|
||||
- Tick stroke widths: major `0.79658329`, medium `0.37985462`, small `0.27478597`
|
||||
- Label radius: `49.862` mm
|
||||
- Tick tiers: major ticks at each labeled interval boundary; a medium tick appears only when the minor-tick count per interval is odd, at the exact midpoint subdivision; all other subdivisions render as small ticks.
|
||||
- Numeric labels rotate to follow the arc (radial orientation), matching their tick's angle.
|
||||
|
||||
## Web Generator (`web/`)
|
||||
|
||||
@@ -32,23 +38,23 @@ source .venv/bin/activate
|
||||
cd web && python app.py # runs on http://localhost:5000
|
||||
```
|
||||
|
||||
`app.py` has one route (`GET /`) serving the form and one (`POST /generate`) that returns SVG. All SVG geometry is computed in `generate_svg()` using the same coordinate constants as the hand-drawn files. The form exposes: unit label, min/max values, major tick intervals, minor ticks per interval, number of numeric labels, and range label.
|
||||
`app.py` has one route (`GET /`) serving the form and one (`POST /generate`) that returns SVG. All SVG geometry is computed in `generate_svg()` using the same coordinate constants as the hand-drawn files: ticks and labels are positioned "as if angle=0" (straight up from the pivot) and given an SVG `rotate(angle, PIVOT_X, PIVOT_Y)` transform. The form exposes: unit label, min/max values, scale mapping, major tick intervals, minor ticks per interval, number of numeric labels, custom labels, label size, font, output mode, and left/right corner labels (up to 2 lines each).
|
||||
|
||||
The ГОСТ тип А font is loaded at startup from `/usr/local/share/fonts/г/ГОСТ_тип_А.ttf` and embedded as base64 in every generated SVG so output files are self-contained.
|
||||
Fonts are loaded at startup from every `.ttf` in `fonts/` and embedded as base64 in every generated SVG (text output mode) so output files are self-contained. The default font is `alte-din-1451-mittelschrift.regular`.
|
||||
|
||||
## Container & Kubernetes
|
||||
|
||||
```
|
||||
docker build -t m1730-scale:latest .
|
||||
docker build -t e440-scale:latest .
|
||||
```
|
||||
|
||||
`fonts/ГОСТ_тип_А.ttf` must exist in the repo root before building (copy from `/usr/local/share/fonts/г/`). The image runs gunicorn on port 5000.
|
||||
`fonts/` must contain the required TTF files before building.
|
||||
|
||||
```
|
||||
kubectl apply -f k8s/
|
||||
```
|
||||
|
||||
`k8s/ingress.yaml` adds a Traefik `IngressRoute` for `works.baumann.gr/M1730-generator` and a `stripPrefix` middleware. Adjust `certResolver` in the file if your Traefik instance uses a different name.
|
||||
`k8s/ingress.yaml` adds a Traefik `IngressRoute` for `works.baumann.gr/E440-generator` and a `stripPrefix` middleware. Adjust `certResolver` in the file if your Traefik instance uses a different name.
|
||||
|
||||
## Editing SVG files directly
|
||||
|
||||
|
||||
Reference in New Issue
Block a user