Size the distance rings by what the frame reaches, and keep their labels off the star names

From the review of #19. The rings are distances from the Sun, but their step was taken from
`effectiveDistance`, which under the plan view means the extent of the frame rather than how far
the camera is from the Sun. Centred on a star 200 pc out and flipped to 2D, the grid became rings
of 2 to 20 pc: not one of them on screen. The step now comes from where the view is centred plus
how far the camera is orbiting it, which is the same distance under either projection.

The set was also rebuilt while the grid was hidden, and every rebuild disposes the rings and
builds every vertex again; it now happens only while the grid is drawn.

The ring labels went straight to the overlay: never culled to the frame, and free to land on a
star's name. They now have to be on screen and clear of the names already placed, by half the
separation two names keep — they are a ladder up one ray a twentieth of the screen apart, and
holding them apart from each other would take "Survey edge" off the map.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jxMkwA2rbicdGxHosecYi
This commit is contained in:
2026-09-18 13:24:16 +02:00
co-authored by Claude Opus 5
parent b4017fcafc
commit 5dec528cee
3 changed files with 141 additions and 12 deletions
+4 -3
View File
@@ -17,9 +17,10 @@ export function roundLengthAtMost(value: number): number | null {
/**
* Rings at a round step of about `reach / count`, out to `reach` or just past it, plus `callout`
* wherever it falls among them: the grid's own radii are round, and the one radius that means
* something in its own right is marked whether the step lands on it or not. Rounding the step
* down makes for `count` to `2.5 × count` rings, never fewer than it takes to cover `reach`.
* where it falls between the first ring and the last: the grid's own radii are round, and the one
* radius that means something in its own right is marked whether the step lands on it or not. A
* frame that does not reach it has no ring for it. Rounding the step down makes for `count` to
* `ceil(2.5 × count)` rings, and the callout can add one: 5 to 14 for a count of 5.
*/
export function distanceRings(reach: number, count: number, callout: number): number[] {
const step = roundLengthAtMost(reach / count);