From 29aa377c434a589ebb402a6aebb216429c5119e3 Mon Sep 17 00:00:00 2001 From: PatrikBak Date: Sat, 16 May 2026 03:56:26 +0200 Subject: [PATCH] Extend figure infra: yellow palette, Font tiers, EquilateralTriangle helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a sixth hue family (LightYellow/Yellow/DarkYellow) to round out the 6-family palette in _common.asy, plus a Font1..Font5 size tier matching Radius1..Radius5 for use as labelPen on AngleMark / RightAngleMark in narrow sectors or dense figures. Adds an EquilateralTriangle(A, B) helper returning the apex on the CCW side of A→B. Export-Asy.ps1 now also skips files matching -shared.asy in addition to the underscore prefix, so per-figure-family shared modules sort next to their siblings instead of clustering under _common. --- data/handouts/Images/_Export-Asy.ps1 | 7 +++++-- data/handouts/Images/_common.asy | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/data/handouts/Images/_Export-Asy.ps1 b/data/handouts/Images/_Export-Asy.ps1 index b8392df6..82ff286d 100644 --- a/data/handouts/Images/_Export-Asy.ps1 +++ b/data/handouts/Images/_Export-Asy.ps1 @@ -124,8 +124,11 @@ foreach ($p in $Path) { } } -# Skip files whose name starts with '_' (convention for shared modules like _common.asy) -$asyFiles = @($asyFiles | Where-Object { -not $_.Name.StartsWith('_') }) +# Skip shared modules: '_' prefix (handout-wide, e.g. _common.asy) and '-shared' suffix +# (per-figure-family, e.g. angles-square-equilateral-shared.asy — sorts next to its siblings). +$asyFiles = @($asyFiles | Where-Object { + -not $_.Name.StartsWith('_') -and -not $_.BaseName.EndsWith('-shared') +}) if ($asyFiles.Count -eq 0) { Write-Error "No .asy files found for path: $Path" diff --git a/data/handouts/Images/_common.asy b/data/handouts/Images/_common.asy index a1afaf11..960a5a08 100644 --- a/data/handouts/Images/_common.asy +++ b/data/handouts/Images/_common.asy @@ -31,6 +31,10 @@ pen LightPink = rgb(1, 0.75, 0.85); pen Pink = rgb(1, 0.5, 0.75); pen DarkPink = rgb(0.75, 0.25, 0.5); +pen LightYellow = rgb(1, 1, 0.5); +pen Yellow = rgb(0.5, 0.5, 0); +pen DarkYellow = rgb(0.25, 0.25, 0); + // // Line-width tiers. NormalWidth is the default for edges and circles. // @@ -60,6 +64,18 @@ real Radius3 = 20; real Radius4 = 25; real Radius5 = 30; +// +// Font-size tiers for figure text, paralleling Radius1..Radius5. Font3 matches +// the 13pt default set by defaultpen; pick lower for dense figures or narrow +// angle sectors, higher for emphasis. Pass as `labelPen` to AngleMark / +// RightAngleMark, or directly to label(). +// +pen Font1 = fontsize(8pt); +pen Font2 = fontsize(10pt); +pen Font3 = fontsize(13pt); +pen Font4 = fontsize(16pt); +pen Font5 = fontsize(20pt); + // // Default vertex dot radius // @@ -156,6 +172,18 @@ pair ReflectAcross( return 2 * Foot(P, A, B) - P; } +// +// Returns the apex C of the equilateral triangle ABC, placed "above" AB — +// i.e. on the left of the directed segment A → B (CCW rotation by 60°). +// For the apex on the other side, pass the points in reverse order. +// +pair EquilateralTriangle( + pair A, + pair B) +{ + return A + rotate(60) * (B - A); +} + // // Fills the angle sector ∠XYZ with vertex Y, sweeping CCW from ray YX to ray YZ. // Pass a `Light*` pen for `color` so the filled sector reads softly. When `lab`