Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions data/handouts/Images/_Export-Asy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 28 additions & 0 deletions data/handouts/Images/_common.asy
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down Expand Up @@ -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
//
Expand Down Expand Up @@ -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`
Expand Down
Loading