1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! Shared chrome / look constants [SPEC 10.5] — the drawing chrome set, the
//! look tunables, and the cross-file baked fallbacks, in one home so the
//! whole look is tuned from this module.
// ── The dimension / leader anatomy [SPEC 15.6/15.7] — baked sheet constants,
// never scaled by the view.
pub const DIM_OFFSET: f64 = 18.0;
pub const DIM_PITCH: f64 = 16.0;
pub const EXT_GAP: f64 = 3.0;
pub const EXT_OVERSHOOT: f64 = 3.0;
/// The drafting-slender arrow, 3 : 1 [SPEC 15.6] — length × half-width, at
/// stroke-width 1; both scale with the dim's `stroke-width` (drafting strokes
/// stay 1–2, so the heads read at ISO 129's arrow-≈-text-height weight).
pub const ARROW_LEN: f64 = 12.0;
pub const ARROW_HALF: f64 = 2.0;
pub const NOTE_OFFSET: f64 = 14.0;
pub const NOTE_LANDING: f64 = 8.0;
/// Stacked deviations draw at this fraction of the dimension font [SPEC 15.6].
pub const TOL_STACK: f64 = 0.7;
/// The GD&T datum triangle's side [SPEC 15.7] — a chunkier symbol than an
/// arrow, with a floor so it never vanishes on thin leaders.
pub const DATUM_SIZE: f64 = 11.0;
// ── Break and centerline chrome [SPEC 15.5].
/// The sheet-space daylight a break leaves between the pieces.
pub const BREAK_GAP: f64 = 12.0;
/// Centre marks, auto centerlines, and break lines overhang the geometry they
/// mark by this sheet-space constant — never scaled.
pub const CENTER_MARK_OVERHANG: f64 = 4.0;
// ── The cutting-plane anatomy [SPEC 15.8] — baked sheet constants.
/// The chain line runs past the geometry by this on each end — a plane-line
/// overshoot, a different concept from the centre-mark overhang.
pub const PLANE_OVERHANG: f64 = 6.0;
/// The thick end stroke's length and (geometry) weight.
pub const PLANE_THICK_END: f64 = 10.0;
pub const PLANE_THICK_WIDTH: f64 = 2.0;
/// The viewing arrow's shaft, from the line end out along the sight line.
pub const PLANE_ARROW_SHAFT: f64 = 13.0;
/// The section letter, just past each arrow.
pub const PLANE_LETTER_GAP: f64 = 7.0;
pub const PLANE_LETTER_SIZE: f64 = 12.0;
// ── ISO metric 60° thread depths per side, as fractions of the pitch
// [SPEC 15.3/15.4]: external `h3 = d − 1.2269 × P` (major to root), internal
// `H1 = 0.54125 × P` (drill to major).
pub const THREAD_DEPTH: f64 = 0.61343;
pub const THREAD_DEPTH_INTERNAL: f64 = 0.54125;
// ── The drafting hatch tile [SPEC 10.3].
/// Default pitch, sheet-space px.
pub const HATCH_PITCH: f64 = 6.0;
/// The texture's fixed line width — a texture, not a stroke.
pub const HATCH_LINE_WIDTH: f64 = 0.75;
// ── A drawing scope's links [SPEC 15.1, 10.5]: geometry keeps stroke 2, the
// annotation wires thin to 1 and their text reads at the caption size.
pub const DRAWING_LINK_STROKE_WIDTH: f64 = 1.0;
pub const DRAWING_LINK_FONT_SIZE: f64 = 12.0;
// ── Cross-file baked defaults [SPEC 10.5].
/// The baked `clearance` — cascaded onto every link by the link bundle, so
/// per-site fallbacks are unreachable; they still agree here.
pub const DEFAULT_CLEARANCE: f64 = 16.0;
/// The baked root `font-size` (body text).
pub const ROOT_FONT_SIZE: f64 = 15.0;
/// The default ISO 5457 sheet — A4 portrait, mm [SPEC 15.8].
pub const A4: = ;
// ── Look tunables.
/// Multi-line leading: lines stack at `font-size × 1.2` [SPEC 5] —
/// measurement (layout) and emission (render) must agree.
pub const TEXT_LEADING: f64 = 1.2;
/// The wavy stroke's shape [SPEC 7], world units, tuned against the default
/// clearance: the wavelength reads as a clear wiggle and the amplitude stays
/// well under a corner's fillet radius, so the wave never touches itself on
/// the inside of a turn (the label cut widens its mask by the amplitude).
pub const WAVY_WAVELENGTH: f64 = 12.0;
pub const WAVY_AMPLITUDE: f64 = 1.4;
/// The note dog-ear [SPEC 8]: fold size as a height fraction, capped.
pub const NOTE_FOLD_FRAC: f64 = 0.34;
pub const NOTE_FOLD_MAX: f64 = 15.0;
/// ISO 5457 sheet furniture, mm: the frame margin, and the wider filing edge
/// on the left [SPEC 15.8].
pub const SHEET_MARGIN: f64 = 10.0;
pub const SHEET_FILING: f64 = 20.0;
/// The absurd-rendered-extent hint threshold [SPEC 20]: a drawing wider or
/// taller than this many px almost certainly authored a magnitude into
/// `scale:` — the hint names the ratio fix.
pub const ABSURD_EXTENT_PX: f64 = 10_000.0;