diff --git a/docs/gamecult/ridge-backdrop-target.md b/docs/gamecult/ridge-backdrop-target.md index 6baeea5f..f26b8fb7 100644 --- a/docs/gamecult/ridge-backdrop-target.md +++ b/docs/gamecult/ridge-backdrop-target.md @@ -7,6 +7,7 @@ The live noise ridge is nearly invisible on a phone (about 1.35:1 against the da ## Ends - One owner per decision: the baker owns ridge geometry and shading; the runtime owns only the ring's residency, the camera's pose against its heading, blending and compositing. No ridge geometry is computed in the browser. +- The near ground is a skirt under an authored 500 m near clip (the march starts there; nothing nearer is baked as terrain), `r_max` is where the linear slide holds for the nearest solid terrain each card draws in each tile (at or beyond the clip; a tile of skirt only binds nothing), and every bake keeps 150 rows under the horizon so the plane reaches the bottom of every viewport. - Nothing from the scene paints above app content: the scene is one stacking context at the back of the app, and nothing it creates has its own z-index or lives outside it. - Phone cost is bounded: no per-frame script for the ridge, decoded size and fetched size gated in CI. - The ring is the bake and the heading is unbounded: the whole 360 degrees ships as azimuth tiles, the client holds only the arc it is about to need and fetches more as the view turns, and nothing caps the heading: it is unwrapped within a stretch of motion and `ridge/heading.ts` `normalize` brings it into [0, 360) before each one, so no angle or pixel position grows with uptime, while `ridge/ring.ts` is the one place that reasons about the wrap at 0 / 360. diff --git a/public/ridge/index.json b/public/ridge/index.json index ad51909b..9cade941 100644 --- a/public/ridge/index.json +++ b/public/ridge/index.json @@ -2,6 +2,6 @@ "schema": 1, "default": "vienna", "places": { - "vienna": "vienna-2aac8e6fee59" + "vienna": "vienna-5c02a10ec4c7" } } diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t00-colour.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t00-colour.webp deleted file mode 100644 index 13246968..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t00-colour.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t00-geometry.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t00-geometry.webp deleted file mode 100644 index 3d011161..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t00-geometry.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t25-geometry.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t25-geometry.webp deleted file mode 100644 index b2e5def3..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t25-geometry.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t26-colour.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t26-colour.webp deleted file mode 100644 index 3fb4534e..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t26-colour.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t26-geometry.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t26-geometry.webp deleted file mode 100644 index 11686a9d..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t26-geometry.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t27-colour.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t27-colour.webp deleted file mode 100644 index 677043f4..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t27-colour.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t27-geometry.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t27-geometry.webp deleted file mode 100644 index 3cebb65f..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t27-geometry.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t28-colour.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t28-colour.webp deleted file mode 100644 index 7af5977a..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t28-colour.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t28-geometry.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t28-geometry.webp deleted file mode 100644 index 4f2f9c37..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t28-geometry.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t29-colour.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t29-colour.webp deleted file mode 100644 index 800c6122..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t29-colour.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t29-geometry.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t29-geometry.webp deleted file mode 100644 index f999157e..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t29-geometry.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t30-colour.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t30-colour.webp deleted file mode 100644 index 70184748..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t30-colour.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t30-geometry.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t30-geometry.webp deleted file mode 100644 index ce1d97de..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t30-geometry.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t31-colour.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t31-colour.webp deleted file mode 100644 index efdc79b1..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t31-colour.webp and /dev/null differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t31-geometry.webp b/public/ridge/vienna-2aac8e6fee59/card-0-t31-geometry.webp deleted file mode 100644 index 03bb0be0..00000000 Binary files a/public/ridge/vienna-2aac8e6fee59/card-0-t31-geometry.webp and /dev/null differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t00-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t00-colour.webp new file mode 100644 index 00000000..1d5b7350 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t00-colour.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t00-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t00-geometry.webp new file mode 100644 index 00000000..35f38fe6 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t00-geometry.webp differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t01-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t01-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t01-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t01-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t01-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t01-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t01-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t01-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t02-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t02-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t02-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t02-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t02-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t02-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t02-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t02-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t03-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t03-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t03-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t03-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t03-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t03-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t03-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t03-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t04-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t04-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t04-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t04-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t04-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t04-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t04-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t04-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t05-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t05-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t05-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t05-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t05-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t05-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t05-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t05-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t06-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t06-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t06-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t06-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t06-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t06-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t06-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t06-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t07-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t07-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t07-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t07-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t07-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t07-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t07-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t07-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t08-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t08-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t08-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t08-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t08-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t08-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t08-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t08-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t09-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t09-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t09-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t09-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t09-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t09-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t09-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t09-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t10-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t10-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t10-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t10-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t10-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t10-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t10-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t10-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t11-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t11-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t11-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t11-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t11-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t11-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t11-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t11-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t12-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t12-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t12-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t12-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t12-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t12-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t12-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t12-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t13-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t13-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t13-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t13-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t13-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t13-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t13-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t13-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t14-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t14-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t14-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t14-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t14-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t14-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t14-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t14-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t15-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t15-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t15-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t15-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t15-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t15-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t15-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t15-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t16-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t16-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t16-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t16-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t16-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t16-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t16-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t16-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t17-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t17-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t17-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t17-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t17-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t17-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t17-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t17-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t18-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t18-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t18-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t18-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t18-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t18-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t18-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t18-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t19-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t19-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t19-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t19-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t19-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t19-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t19-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t19-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t20-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t20-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t20-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t20-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t20-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t20-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t20-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t20-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t21-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t21-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t21-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t21-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t21-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t21-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t21-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t21-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t22-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t22-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t22-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t22-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t22-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t22-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t22-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t22-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t23-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t23-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t23-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t23-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t23-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t23-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t23-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t23-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t24-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t24-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t24-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t24-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t24-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t24-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t24-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t24-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-0-t25-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t25-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-0-t25-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-0-t25-colour.webp diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t25-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t25-geometry.webp new file mode 100644 index 00000000..4421b873 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t25-geometry.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t26-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t26-colour.webp new file mode 100644 index 00000000..de1883f1 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t26-colour.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t26-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t26-geometry.webp new file mode 100644 index 00000000..a6389c4d Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t26-geometry.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t27-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t27-colour.webp new file mode 100644 index 00000000..8e6f04e5 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t27-colour.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t27-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t27-geometry.webp new file mode 100644 index 00000000..167f4857 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t27-geometry.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t28-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t28-colour.webp new file mode 100644 index 00000000..054438eb Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t28-colour.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t28-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t28-geometry.webp new file mode 100644 index 00000000..a5292fd7 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t28-geometry.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t29-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t29-colour.webp new file mode 100644 index 00000000..da5845aa Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t29-colour.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t29-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t29-geometry.webp new file mode 100644 index 00000000..00cd895c Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t29-geometry.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t30-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t30-colour.webp new file mode 100644 index 00000000..38c21a5f Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t30-colour.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t30-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t30-geometry.webp new file mode 100644 index 00000000..23cb3a26 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t30-geometry.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t31-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t31-colour.webp new file mode 100644 index 00000000..5b6aee47 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t31-colour.webp differ diff --git a/public/ridge/vienna-5c02a10ec4c7/card-0-t31-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-0-t31-geometry.webp new file mode 100644 index 00000000..0e0c9176 Binary files /dev/null and b/public/ridge/vienna-5c02a10ec4c7/card-0-t31-geometry.webp differ diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t00-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t00-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t00-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t00-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t00-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t00-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t00-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t00-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t01-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t01-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t01-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t01-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t01-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t01-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t01-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t01-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t02-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t02-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t02-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t02-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t02-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t02-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t02-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t02-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t03-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t03-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t03-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t03-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t03-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t03-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t03-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t03-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t04-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t04-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t04-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t04-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t04-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t04-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t04-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t04-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t05-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t05-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t05-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t05-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t05-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t05-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t05-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t05-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t06-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t06-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t06-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t06-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t06-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t06-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t06-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t06-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t07-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t07-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t07-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t07-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t07-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t07-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t07-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t07-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t08-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t08-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t08-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t08-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t08-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t08-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t08-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t08-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t09-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t09-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t09-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t09-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t09-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t09-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t09-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t09-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t10-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t10-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t10-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t10-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t10-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t10-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t10-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t10-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t11-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t11-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t11-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t11-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t11-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t11-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t11-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t11-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t12-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t12-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t12-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t12-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t12-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t12-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t12-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t12-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t13-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t13-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t13-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t13-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t13-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t13-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t13-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t13-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t14-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t14-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t14-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t14-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t14-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t14-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t14-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t14-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t15-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t15-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t15-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t15-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t15-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t15-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t15-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t15-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t16-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t16-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t16-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t16-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t16-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t16-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t16-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t16-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t17-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t17-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t17-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t17-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t17-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t17-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t17-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t17-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t18-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t18-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t18-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t18-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t18-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t18-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t18-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t18-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t19-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t19-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t19-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t19-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t19-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t19-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t19-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t19-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t20-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t20-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t20-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t20-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t20-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t20-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t20-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t20-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t21-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t21-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t21-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t21-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t21-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t21-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t21-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t21-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t22-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t22-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t22-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t22-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t22-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t22-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t22-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t22-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t23-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t23-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t23-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t23-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t23-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t23-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t23-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t23-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t24-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t24-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t24-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t24-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t24-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t24-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t24-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t24-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t25-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t25-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t25-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t25-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t25-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t25-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t25-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t25-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t26-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t26-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t26-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t26-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t26-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t26-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t26-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t26-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t27-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t27-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t27-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t27-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t27-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t27-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t27-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t27-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t28-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t28-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t28-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t28-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t28-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t28-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t28-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t28-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t29-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t29-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t29-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t29-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t29-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t29-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t29-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t29-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t30-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t30-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t30-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t30-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t30-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t30-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t30-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t30-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t31-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t31-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t31-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t31-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-1-t31-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-1-t31-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-1-t31-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-1-t31-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t00-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t00-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t00-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t00-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t00-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t00-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t00-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t00-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t01-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t01-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t01-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t01-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t01-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t01-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t01-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t01-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t02-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t02-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t02-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t02-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t02-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t02-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t02-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t02-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t03-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t03-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t03-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t03-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t03-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t03-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t03-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t03-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t04-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t04-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t04-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t04-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t04-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t04-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t04-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t04-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t05-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t05-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t05-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t05-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t05-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t05-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t05-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t05-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t06-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t06-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t06-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t06-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t06-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t06-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t06-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t06-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t07-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t07-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t07-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t07-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t07-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t07-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t07-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t07-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t08-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t08-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t08-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t08-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t08-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t08-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t08-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t08-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t09-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t09-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t09-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t09-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t09-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t09-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t09-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t09-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t10-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t10-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t10-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t10-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t10-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t10-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t10-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t10-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t11-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t11-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t11-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t11-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t11-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t11-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t11-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t11-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t12-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t12-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t12-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t12-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t12-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t12-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t12-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t12-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t13-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t13-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t13-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t13-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t13-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t13-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t13-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t13-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t14-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t14-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t14-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t14-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t14-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t14-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t14-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t14-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t15-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t15-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t15-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t15-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t15-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t15-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t15-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t15-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t16-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t16-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t16-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t16-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t16-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t16-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t16-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t16-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t17-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t17-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t17-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t17-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t17-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t17-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t17-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t17-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t18-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t18-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t18-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t18-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t18-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t18-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t18-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t18-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t19-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t19-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t19-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t19-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t19-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t19-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t19-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t19-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t20-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t20-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t20-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t20-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t20-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t20-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t20-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t20-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t21-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t21-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t21-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t21-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t21-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t21-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t21-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t21-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t22-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t22-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t22-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t22-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t22-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t22-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t22-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t22-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t23-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t23-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t23-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t23-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t23-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t23-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t23-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t23-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t24-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t24-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t24-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t24-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t24-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t24-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t24-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t24-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t25-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t25-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t25-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t25-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t25-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t25-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t25-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t25-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t26-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t26-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t26-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t26-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t26-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t26-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t26-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t26-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t27-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t27-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t27-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t27-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t27-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t27-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t27-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t27-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t28-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t28-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t28-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t28-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t28-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t28-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t28-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t28-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t29-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t29-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t29-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t29-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t29-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t29-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t29-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t29-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t30-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t30-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t30-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t30-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t30-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t30-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t30-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t30-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t31-colour.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t31-colour.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t31-colour.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t31-colour.webp diff --git a/public/ridge/vienna-2aac8e6fee59/card-2-t31-geometry.webp b/public/ridge/vienna-5c02a10ec4c7/card-2-t31-geometry.webp similarity index 100% rename from public/ridge/vienna-2aac8e6fee59/card-2-t31-geometry.webp rename to public/ridge/vienna-5c02a10ec4c7/card-2-t31-geometry.webp diff --git a/public/ridge/vienna-2aac8e6fee59/manifest.json b/public/ridge/vienna-5c02a10ec4c7/manifest.json similarity index 97% rename from public/ridge/vienna-2aac8e6fee59/manifest.json rename to public/ridge/vienna-5c02a10ec4c7/manifest.json index b518a149..098830d8 100644 --- a/public/ridge/vienna-2aac8e6fee59/manifest.json +++ b/public/ridge/vienna-5c02a10ec4c7/manifest.json @@ -1,7 +1,7 @@ { "schema": 3, - "baker_version": 5, - "bake_id": "2aac8e6fee59", + "baker_version": 6, + "bake_id": "5c02a10ec4c7", "place": { "id": "vienna", "name": "Vienna, looking SW to Rax/Schneeberg", @@ -35,8 +35,8 @@ "normal": "rt8" }, "camera": { - "r_max_m": 95.8, - "r_max_forward_m": 198.4 + "r_max_m": 95.9, + "r_max_forward_m": 198.6 }, "cards": [ { @@ -57,14 +57,14 @@ { "top": 337, "h": 263, - "distance_m": 603.4103393554688, + "distance_m": 612.7647094726562, "colour": { "file": "card-0-t00-colour.webp", - "bytes": 842 + "bytes": 878 }, "geometry": { "file": "card-0-t00-geometry.webp", - "bytes": 7318 + "bytes": 7386 } }, { @@ -1082,14 +1082,14 @@ { "top": 229, "h": 371, - "distance_m": 933.5433349609375, + "distance_m": 1073.8558349609375, "colour": { "file": "card-0-t25-colour.webp", "bytes": 808 }, "geometry": { "file": "card-0-t25-geometry.webp", - "bytes": 12278 + "bytes": 12284 } }, { @@ -1123,14 +1123,14 @@ { "top": 250, "h": 350, - "distance_m": 673.9866943359375, + "distance_m": 766.68505859375, "colour": { "file": "card-0-t26-colour.webp", - "bytes": 680 + "bytes": 676 }, "geometry": { "file": "card-0-t26-geometry.webp", - "bytes": 9514 + "bytes": 9612 } }, { @@ -1164,14 +1164,14 @@ { "top": 278, "h": 322, - "distance_m": 533.818603515625, + "distance_m": 715.7683715820312, "colour": { "file": "card-0-t27-colour.webp", - "bytes": 714 + "bytes": 708 }, "geometry": { "file": "card-0-t27-geometry.webp", - "bytes": 6664 + "bytes": 6716 } }, { @@ -1205,14 +1205,14 @@ { "top": 309, "h": 291, - "distance_m": 500.0000305175781, + "distance_m": 851.5679321289062, "colour": { "file": "card-0-t28-colour.webp", - "bytes": 562 + "bytes": 570 }, "geometry": { "file": "card-0-t28-geometry.webp", - "bytes": 3694 + "bytes": 3766 } }, { @@ -1246,14 +1246,14 @@ { "top": 327, "h": 273, - "distance_m": 500.0000305175781, + "distance_m": 591.9729614257812, "colour": { "file": "card-0-t29-colour.webp", - "bytes": 612 + "bytes": 618 }, "geometry": { "file": "card-0-t29-geometry.webp", - "bytes": 3196 + "bytes": 3238 } }, { @@ -1287,14 +1287,14 @@ { "top": 324, "h": 276, - "distance_m": 500.0000305175781, + "distance_m": 592.1824951171875, "colour": { "file": "card-0-t30-colour.webp", - "bytes": 476 + "bytes": 484 }, "geometry": { "file": "card-0-t30-geometry.webp", - "bytes": 3626 + "bytes": 3714 } }, { @@ -1328,14 +1328,14 @@ { "top": 330, "h": 270, - "distance_m": 548.6560668945312, + "distance_m": 597.7586059570312, "colour": { "file": "card-0-t31-colour.webp", - "bytes": 478 + "bytes": 506 }, "geometry": { "file": "card-0-t31-geometry.webp", - "bytes": 4738 + "bytes": 4866 } }, { @@ -1366,7 +1366,7 @@ } ] ], - "bytes": 1198740, + "bytes": 1199370, "attribution": { "credit_line": "Contains modified Copernicus data: DEM \u00a9 DLR e.V. 2010-2014 and \u00a9 Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA; all rights reserved.", "licence": "Copernicus DEM licence: free, full and open access, with the credit line shown", diff --git a/scripts/ridge-bake/README.md b/scripts/ridge-bake/README.md index 7c2c25c3..b403558c 100644 --- a/scripts/ridge-bake/README.md +++ b/scripts/ridge-bake/README.md @@ -31,11 +31,11 @@ Files are `Copernicus_DSM_COG_10_dd_00_ddd_00_DEM.tif`; the list below 1. **March.** `stage0` marches 6400 azimuth columns of rays over the DEM with Earth curvature and refraction (`ridge.elev`), cached by a key of its inputs. 2. **Low-pass.** `prefilter` blurs the sampled heights with a Gaussian of `prefilter_m` metres along each ray and across rays at equal distance (sigma = `prefilter_m` / (distance x column width) columns), then recomputes the angles. Roofs go, hills stay. -3. **View.** `set_view` maps angle to row linearly: the highest skyline angle of the whole ring sits at 4% of the frame height, the lowest at 66%, clamped to 1x to 10x vertical exaggeration (ruling `ridge-ring-vertical-anchors`: every azimuth sits inside one frame). +3. **View.** `set_view` maps angle to row linearly: the highest skyline angle of the whole ring sits at 4% of the frame height, the lowest at 66%, and the horizon keeps `GROUND_ROWS_MIN` = 150 rows under it (the runtime's `groundRowsNeeded`: (1 - 0.85) x 600 / 0.6, so the plane reaches the bottom of every viewport at rest). The scale is the lesser of the two fits, clamped to 0.5x to 10x vertical exaggeration (rulings `ridge-ring-vertical-anchors`, `ridge-ground-rows-below-horizon`: every azimuth sits inside one frame; a place whose whole-ring relief leaves too few ground rows is flattened below 1x); a skyline that cannot hold the rows even at 0.5x is refused naming `sky_deg` and the floor. `export.validate_manifest` refuses a plane with fewer than 150 rows under the horizon and `manifest.ts` refuses it at load. 4. **Seams.** `coverage` counts the visible rows of the opaque view per log-distance bin and column. `seams` finds one seam per authored split per column by dynamic programming (seam carving, forward energy): it sits in a gap between depths, moving it costs 2 per bin plus the visible rows it sweeps (so it never hops across a ridge between two columns and splits it side by side), a seam inside visible terrain is cheap to cross-fade, the authored depth only breaks ties. Seam k stays 0.4 nat beyond seam k-1. The DP runs over the ring three times side by side and keeps the middle lap, so a seam is continuous across the wrap (column 6399 to 0) and a tile boundary is only a crop. -5. **Cards.** `cards` runs per tile, on that tile's columns and the matching normals (it is column-independent: a tile is a crop of per-column results, so no seam appears at a tile boundary). It makes card i from the first visible hit at or beyond seam i-1 (layered depth: a farther card keeps the terrain a nearer ridge hides), alpha 1 minus a smoothstep over seam i in log-distance (the cross-fade), crest rows with fractional coverage, distance and normal interpolated between samples by angle, albedo from a small height and slope material, cropped to the rows where alpha is not zero. The rows of card i > 0 below the angle of its first sample (hit and first sample of the card) are its **wall**: the extruded face of the ridge the card starts at, which keeps that sample's distance, wears the ground material at its height with the face up, and is flagged `wall` (card 0 has none: its rows there are the ground). The alpha-over composite of the cards equals the opaque view; `check_cover` refuses a tile that differs by more than 0.02. +5. **Cards.** `cards` runs per tile, on that tile's columns and the matching normals (it is column-independent: a tile is a crop of per-column results, so no seam appears at a tile boundary). It makes card i from the first visible hit at or beyond seam i-1 (layered depth: a farther card keeps the terrain a nearer ridge hides), alpha 1 minus a smoothstep over seam i in log-distance (the cross-fade), crest rows with fractional coverage, distance and normal interpolated between samples by angle, albedo from a small height and slope material, cropped to the rows where alpha is not zero. The rows of card i > 0 below the angle of its first sample (hit and first sample of the card) are its **wall**: the extruded face of the ridge the card starts at, which keeps that sample's distance, wears the ground material at its height with the face up, and is flagged `wall`. Card 0's wall is the **skirt**: the march starts at the authored near clip `NEAR_CLIP_M` = 500 m and nothing nearer is baked as terrain, so the rows under card 0's first sample are the near ground drawn as the extruded face of the clip, coloured from the sample-0 height blurred round the ring (Gaussian, `SKIRT_BLUR_DEG` = 4 degrees, tuned by eye) so that no colour edge narrower than the blur runs down the rows; the runtime lights it with the wall code like any wall. The alpha-over composite of the cards equals the opaque view; `check_cover` refuses a tile that differs by more than 0.02. 6. **Tiles.** The ring is absolute compass, column 0 = north, column c at azimuth (c + 0.5) / 6400 x 360; `places.json`'s `az_deg` / `look_at` is only the rest azimuth (`view.look_az_deg`). Tile t owns columns [200 t, 200 t + 200) (11.25 degrees) and its files hold [200 t - 2, 200 t + 202): two columns of real neighbour data each side (the client's ink pass and lighting read one texel each way; the client crops it), taken periodically by `ridge.ring_cols`. Per card and tile the file is cropped to the rows where that tile's 8-bit alpha is not zero (`top`, `h`); a card that holds nothing in a tile is `null` there (the client interpolates its distance from the neighbours); a card with no solid pixel in any tile is refused. -7. **Distance and the offset range.** The bake holds no camera (ruling `ridge-camera-full-ring`). `pack` gives each card tile `distance_m` = exp(median ln d) over the tile's solid pixels that are not wall (its interior 200 columns); the client derives each card's slide from that and the viewer's offset r and heading. `camera.r_max_m` is the largest |r| (never above half the nearest card's smallest tile distance) at which, for every tile, card and phi (24 steps of the camera's angle on the circle against its heading; the offset-only rotation mode moves phi round the whole circle), the least-squares line `a + s beta` fitted to the exact view angle `atan2(R sin beta - r sin phi, R cos beta - r cos phi)` over the widest viewport (`HFOV_MAX_DEG` = 72 / 1.1) errs by at most `FIT_PX_MAX` = 24 card px (the continuous error: the line by quadrature over the viewport, the worst error looked for on 513 points, so a handful of samples cannot undercount it); the card sits at the tile's `distance_m` (R = d) and the line is fitted for that same distance, and the resident gate (below) must hold at r_max_m too. `camera.r_max_forward_m` is the same search at phi = 0 alone (same `FIT_PX_MAX`, the same half-distance cap, the same resident gate): the camera pushed forward along its heading, which is where the offset stays when the view direction turns with it (the modes 'still' and 'both'), so it is at least `r_max_m`; the client takes `r_max_m` for the offset-only mode and for a backward offset, `r_max_forward_m` for a forward one in the other modes (`view.ts` `offsetRange`). `FIT_PX_MAX` is provisional, tuned by eye (ruling `ridge-offset-range-fit`). A bake whose `r_max_m` is below `R_MAX_FLOOR_M` = 25 m is refused, naming the card and tile. +7. **Distance and the offset range.** The bake holds no camera (ruling `ridge-camera-full-ring`). `pack` gives each card tile `distance_m` = exp(median ln d) over the tile's solid pixels that are not wall (its interior 200 columns); the client derives each card's slide from that and the viewer's offset r and heading. `camera.r_max_m` is the largest |r| (never above half the nearest terrain's distance) at which, for every tile, card and phi (24 steps of the camera's angle on the circle against its heading; the offset-only rotation mode moves phi round the whole circle), the least-squares line `a + s beta` fitted to the exact view angle `atan2(R sin beta - r sin phi, R cos beta - r cos phi)` over the widest viewport (`HFOV_MAX_DEG` = 72 / 1.1) errs by at most `FIT_PX_MAX` = 24 card px (the continuous error: the line by quadrature over the viewport, the worst error looked for on 513 points, so a handful of samples cannot undercount it); the distance d is that of the NEAREST solid (alpha >= 0.5, not wall) pixel the card draws in the tile's interior columns, which is where the slide errs most (the line is fitted for the tile's `distance_m`, the median, but the bound is held for the nearest terrain: a tile whose terrain spans 600 to 2000 m is bound at 600 m); a tile that draws only skirt rows has no such pixel and binds nothing; and the resident gate (below) must hold at r_max_m too. `camera.r_max_forward_m` is the same search at phi = 0 alone (same `FIT_PX_MAX`, the same half-distance cap, the same resident gate): the camera pushed forward along its heading, which is where the offset stays when the view direction turns with it (the modes 'still' and 'both'), so it is at least `r_max_m`; the client takes `r_max_m` for the offset-only mode and for a backward offset, `r_max_forward_m` for a forward one in the other modes (`view.ts` `offsetRange`). `FIT_PX_MAX` is provisional, tuned by eye (ruling `ridge-offset-range-fit`). A bake whose `r_max_m` is below `R_MAX_FLOOR_M` = 25 m is refused, naming the card and tile. `distance_m` excludes the skirt, so card 0's distances are never nearer than the near clip (`write_bake` refuses one that is), and `r_max_m` and `r_max_forward_m` hold for the nearest solid terrain each card draws in each tile, at or beyond 500 m, skirt-only tiles excluded: not a measurement of the ground nearer than that, which is only the skirt. 8. **Normals.** `normals` takes the along-ray slope and the across-ray slope at equal distance (neighbouring columns, same sample), both times the vertical exaggeration. Files per card `i` and tile `t`: `card--t-colour.webp` (lossy RGB albedo, lossless straight alpha) and `card--t-geometry.webp` (lossless: R, G = (n + 1) / 2 for the normal's along and across components, B = log-distance normalised between `encoding.log_d_min` and `log_d_max`; wall pixels write R = G = 255, a code outside the unit disc that no real normal reaches), each 204 columns wide. The manifest lists the cards nearest first (`near_m`, `far_m`: the median seam depths over the ring) and `tiles[t][i]` = `{ top, h, distance_m, colour, geometry }` or `null`; the runtime paints the cards last to first. The `bake_id` is the sha256 of the files, tile-major, then card, colour then geometry. diff --git a/scripts/ridge-bake/export.py b/scripts/ridge-bake/export.py index 6d3c8c98..68fd8944 100644 --- a/scripts/ridge-bake/export.py +++ b/scripts/ridge-bake/export.py @@ -5,7 +5,7 @@ The runtime reads manifest.json (SCHEMA is its contract) and nothing else about the bake. The ring is the whole 360 degrees (ruling ridge-camera-full-ring), absolute compass, column 0 = north, cut into TILES tiles of TILE_W columns plus an APRON of real neighbour columns each side; the bake holds no camera: it ships each card tile's distance_m and camera.r_max_m, the largest offset the per-card linear slide can take (ruling ridge-offset-range-fit); the client lights the cards itself (ruling ridge-cards-runtime-lit). -The pure parts (budget, bake_id, manifest, index, schema check) import no baker; bake_place imports ridge, which needs RIDGE_TILES and RIDGE_WORK (main sets them from --tiles / --work).""" +The pure parts (budget, bake_id, index, schema check) import no baker; bake_place imports ridge, which needs RIDGE_TILES and RIDGE_WORK (main sets them from --tiles / --work), and so do validate_manifest and write_bake, which read ridge's NEAR_CLIP_M and GROUND_ROWS_MIN.""" import os, sys, json, math, shutil, hashlib, argparse, tempfile from pathlib import Path from zoneinfo import ZoneInfo, ZoneInfoNotFoundError @@ -13,7 +13,7 @@ HERE = Path(__file__).resolve().parent sys.path.insert(0, str(HERE)) import numpy as np, imagecodecs -BAKER_VERSION = 5 +BAKER_VERSION = 6 RING_W = 6400 # the ring's columns (ridge.W, asserted in bake_place): column c is at azimuth (c + 0.5) / RING_W x 360, column 0 = north TILES = 32 # azimuth tiles of the ring, each card cut into TILES files per kind (ruling ridge-camera-full-ring: the client loads the arc near its heading) TILE_W = RING_W // TILES # 200 columns = 11.25 degrees owned by a tile @@ -51,7 +51,7 @@ SCHEMA = {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'title': 'r view=_obj(look_az_deg=_num, ring_w={'const': RING_W}, tile_w={'const': TILE_W}, tiles={'const': TILES}, apron={'const': APRON}, plane_h=_int, px_per_deg_h=_num, px_per_deg_v=_num, exaggeration=_num, horizon_row=_num, sky_row=_num, near_row=_num), curvature=_obj(r_earth_m=_num, k_ref=_num), encoding=_obj(log_d_min=_num, log_d_max=_num, normal={'const': 'rt8'}), - camera=_obj(r_max_m=_num, r_max_forward_m=_num), + camera=dict(_obj(r_max_m=_num, r_max_forward_m=_num), description="r_max_m (every camera angle on its circle) and r_max_forward_m (the camera on its heading) are the offsets up to which the linear slide holds (the fit error at most FIT_PX_MAX card px) for the NEAREST solid terrain (at or beyond the near clip, ridge.NEAR_CLIP_M, 500 m) that each card draws in each tile, not for the tile's median distance_m; a tile that draws only skirt rows (wall) has no such terrain and binds nothing. Nothing nearer than the clip is baked as terrain, so they are no measure of the ground under it."), cards={'type': 'array', 'minItems': 1, 'maxItems': MAX_CARDS, 'items': _obj(near_m=_numnull, far_m=_numnull), 'description': "nearest first; the runtime paints the list last to first. near_m and far_m are the median seam depths over the ring, null at the ends."}, tiles={'type': 'array', 'minItems': TILES, 'maxItems': TILES, 'items': {'type': 'array', 'minItems': 1, 'maxItems': MAX_CARDS, 'items': _objnull(top=_int, h=_int, distance_m=_num, colour=_file, geometry=_file)}, @@ -85,8 +85,10 @@ def validate(x, s, path='$'): elif isinstance(extra, dict): validate(v, extra, f'{path}.{k}') def validate_manifest(m): - """The schema plus what it cannot say: every tile lists one entry per card, every card holds something in some tile, each file is named for its card and tile, bytes is the sum of the files.""" - validate(m, SCHEMA['$defs']['manifest']); k = len(m['cards']) + """The schema plus what it cannot say: the plane keeps ridge.GROUND_ROWS_MIN rows under the horizon, every tile lists one entry per card, every card holds something in some tile, each file is named for its card and tile, bytes is the sum of the files.""" + import ridge + validate(m, SCHEMA['$defs']['manifest']); k = len(m['cards']); v = m['view'] + if v['plane_h'] - v['horizon_row'] < ridge.GROUND_ROWS_MIN - 1e-6: raise ValueError(f"$.view: {v['plane_h'] - v['horizon_row']:.1f} rows under the horizon, below the {ridge.GROUND_ROWS_MIN} the runtime needs (ridge.GROUND_ROWS_MIN)") for t, row in enumerate(m['tiles']): if len(row) != k: raise ValueError(f'$.tiles[{t}]: {len(row)} entries for {k} cards') for i, e in enumerate(row): @@ -152,7 +154,8 @@ def fit_table(dist, r, px_per_deg, phis=None): """(tiles, cards) fit_px of every card tile at offset r; nan where the card is null in that tile.""" return np.array([[np.nan if d is None else fit_px(d, r, px_per_deg, phis) for d in row] for row in dist]) def solve_r_max(dist, bands, px_per_deg, phis=None): - """The largest offset r (m, down to 0.1 m) at which every card tile fits within FIT_PX_MAX over `phis` camera angles (PHI_STEPS: the whole circle, the offset-only rotation mode; 1: phi = 0 alone, the modes where the offset turns with the view) and the resident gate holds: never above half the nearest card's smallest tile distance. Scans r upward from 0 on 128 steps to the first failure, then bisects that step. + """dist: [tiles][cards] the distance of the NEAREST solid terrain each card draws in each tile (None where it draws none): the line of a tile is fitted for one distance but its terrain spans many, and the nearest is where the slide errs most (ruling ridge-offset-range-fit, up to where the linear map holds). + The largest offset r (m, down to 0.1 m) at which every card tile fits within FIT_PX_MAX over `phis` camera angles (PHI_STEPS: the whole circle, the offset-only rotation mode; 1: phi = 0 alone, the modes where the offset turns with the view) and the resident gate holds: never above half the nearest card's smallest tile distance. Scans r upward from 0 on 128 steps to the first failure, then bisects that step. Refuses (naming the card and tile that bind) a bake whose r_max_m is below R_MAX_FLOOR_M.""" near = min((row[0], t) for t, row in enumerate(dist) if row[0] is not None); rmin = near[0]; cap = 0.5 * rmin ok = lambda r: bool(np.nanmax(fit_table(dist, r, px_per_deg, phis)) <= FIT_PX_MAX) and resident_bytes(bands, run_tiles(r, rmin)) <= RESIDENT_BYTES_MAX @@ -200,7 +203,9 @@ def write_bake(out, place, view, meta, packed, opaque, default=None): if c.shape[1] != w: raise ValueError(f'tile {t} card {i} is {c.shape[1]} columns wide, not {w} (tile {TILE_W} + 2 apron {APRON})') if c.shape[0] < 1 or e['top'] < 0 or e['top'] + c.shape[0] > h: raise ValueError(f'tile {t} card {i} leaves the {h} rows of the frame') if opaque[t].shape != (h, w): raise ValueError(f'tile {t}: the opaque view is {opaque[t].shape}, the frame {(h, w)}') - rmin = min(row[0]['distance_m'] for row in tiles if row[0]) + import ridge + rmin = min(row[0]['distance_m'] for row in tiles if row[0]) # distance_m is exp of a float32 log: it lands a few parts in 1e7 off the clip, so the compare keeps 1e-5 of slack + if rmin < ridge.NEAR_CLIP_M * (1 - 1e-5): raise ValueError(f'card 0 stands {rmin:.1f} m away, nearer than the near clip {ridge.NEAR_CLIP_M:g} m: nothing nearer is baked as terrain') if camera['r_max_forward_m'] < camera['r_max_m']: raise ValueError(f"r_max_forward_m {camera['r_max_forward_m']:g} is below r_max_m {camera['r_max_m']:g}: phi = 0 is one of the angles r_max_m holds for") for r in (camera['r_max_m'], camera['r_max_forward_m']): check_budget(k, tile_bytes, bands, r, rmin) for t, (row, drow) in enumerate(zip(tiles, dec)): @@ -231,8 +236,8 @@ def cut_ring(d, a, h, splits_km): """The ring cut of a prefiltered march (set_view done): normals, coverage, the periodic seams on all RING_W columns, then ridge.cards per tile on its TILE_W + 2 APRON columns with the matching normals. Returns dict(cards [TILES][cards] (ridge.cards arrays), splits_km, seams (K, ring) in m, cov (bins, ring), opaque [TILES] (rows, TILE_W + 2 APRON) coverage, edges).""" import ridge - nrm = ridge.normals(d, h); cov = ridge.coverage(d, a); sm = ridge.seams(cov, [k * 1000.0 for k in splits_km], d); op = ridge.opaque(a); cols = lambda x, t: ridge.ring_cols(x, t * TILE_W - APRON, TILE_W + 2 * APRON); tiles = [] - for t in range(TILES): tiles.append(ridge.cards(d, cols(a, t), cols(h, t), cols(sm, t), tuple(cols(x, t) for x in nrm))); print(f'tile {t + 1}/{TILES}', file=sys.stderr, flush=True) + nrm = ridge.normals(d, h); sk = ridge.skirt_height(h); cov = ridge.coverage(d, a); sm = ridge.seams(cov, [k * 1000.0 for k in splits_km], d); op = ridge.opaque(a); cols = lambda x, t: ridge.ring_cols(x, t * TILE_W - APRON, TILE_W + 2 * APRON); tiles = [] + for t in range(TILES): tiles.append(ridge.cards(d, cols(a, t), cols(h, t), cols(sm, t), tuple(cols(x, t) for x in nrm), skirt=cols(sk, t))); print(f'tile {t + 1}/{TILES}', file=sys.stderr, flush=True) return dict(cards=tiles, splits_km=list(splits_km), seams=sm, cov=cov, opaque=[cols(op, t) for t in range(TILES)], edges=ridge.log_edges(d)) def bake_place(pid): @@ -247,26 +252,26 @@ def bake_place(pid): def pack(bake): """The tiles of a bake as bytes plus their manifest facts. Per card tile: distance_m = exp(median ln d) over the solid (alpha >= 0.5) pixels that are not wall of the interior TILE_W columns (a tile with none falls back to its non-wall, then any, lit pixels); - a card with no rows in a tile is null there. Per card: the median seam depths over the ring. camera.r_max_m: solve_r_max over the card tiles' distances and every camera angle on its circle (the offset-only rotation mode), camera.r_max_forward_m: the same at phi = 0 alone (the modes where the offset turns with the view). Refuses a card empty in every tile (naming the splits) and a card with + a card with no rows in a tile is null there. Per card: the median seam depths over the ring. camera.r_max_m: solve_r_max over the NEAREST solid non-wall pixel of each card tile (not its median distance_m; a tile that draws only wall, the skirt, has none and binds nothing) and every camera angle on its circle (the offset-only rotation mode), camera.r_max_forward_m: the same at phi = 0 alone (the modes where the offset turns with the view). Refuses a card empty in every tile (naming the splits) and a card with no solid terrain apart from its wall in any tile. Returns dict(cards, tiles, camera, report) (report is printed, not written).""" sm = bake['seams']; sp = bake['splits_km']; k = len(sp) + 1; ppd = bake['view']['px_per_deg_h']; inner = slice(APRON, APRON + TILE_W); enc = bake['meta']['encoding'] for i in range(k): if all(tile[i]['alpha'].shape[0] == 0 for tile in bake['cards']): raise ValueError(f"card {i} is empty: it lies between the splits {' and '.join(f'{sp[j]:g} km' for j in (i - 1, i) if 0 <= j < len(sp))} (card_split_km {sp}) and holds no terrain nothing nearer hides; move or remove a split") - tiles, dist, bands = [], [], []; any_solid = [False] * k + tiles, dist, near, bands = [], [], [], []; any_solid = [False] * k for tile in bake['cards']: - row, drow, brow = [], [], [] + row, drow, nrow, brow = [], [], [], [] for i, c in enumerate(tile): - if c['alpha'].shape[0] == 0: row.append(None); drow.append(None); continue + if c['alpha'].shape[0] == 0: row.append(None); drow.append(None); nrow.append(None); continue al, wl, ld = c['alpha'][:, inner], c['wall'][:, inner], c['logd'][:, inner]; solid = (al >= 0.5) & ~wl; any_solid[i] |= bool(solid.any()) pool = next((m, l) for m, l in ((solid, ld), ((al > 0) & ~wl, ld), (al > 0, ld), (c['alpha'] > 0, c['logd'])) if m.any()) - dm = float(np.exp(np.median(pool[1][pool[0]]))) + dm = float(np.exp(np.median(pool[1][pool[0]]))); nrow.append(float(np.exp(ld[solid].min())) if solid.any() else None) # the nearest solid terrain the card draws in this tile: None where it draws only wall (the skirt), which binds nothing row.append(dict(top=c['top'], colour=encode_colour(c['albedo'], c['alpha']), geometry=encode_geometry(c['n_r'], c['n_t'], c['logd'], enc, c['wall']), distance_m=dm)); drow.append(dm); brow.append(c['alpha'].shape[0]) - tiles.append(row); dist.append(drow); bands.append(brow) + tiles.append(row); dist.append(drow); near.append(nrow); bands.append(brow) for i in range(k): if not any_solid[i]: raise ValueError(f'card {i} holds no solid terrain apart from its wall rows') - r_max = solve_r_max(dist, bands, ppd); r_fwd = solve_r_max(dist, bands, ppd, phis=1); rmin = min(row[0] for row in dist if row[0] is not None); n = run_tiles(r_fwd, rmin); worst = np.nanmax(fit_table(dist, r_max, ppd), axis=0) + r_max = solve_r_max(near, bands, ppd); r_fwd = solve_r_max(near, bands, ppd, phis=1); rmin = min(row[0] for row in near if row[0] is not None); n = run_tiles(r_fwd, rmin); worst = np.nanmax(fit_table(near, r_max, ppd), axis=0) cards = [dict(near_m=float(np.median(sm[i - 1])) if i else None, far_m=float(np.median(sm[i])) if i < len(sm) else None) for i in range(k)] - return dict(cards=cards, tiles=tiles, camera=dict(r_max_m=r_max, r_max_forward_m=r_fwd), report=dict(fit_px=[float(x) for x in worst], run_tiles=n, resident_bytes=resident_bytes(bands, n), nearest_m=rmin)) + return dict(cards=cards, tiles=tiles, camera=dict(r_max_m=r_max, r_max_forward_m=r_fwd), report=dict(fit_px=[float(x) for x in worst], run_tiles=n, resident_bytes=resident_bytes(bands, n), nearest_m=rmin)) # nearest_m: the nearest solid terrain of the place def lit(c): """albedo x (0.35 + 0.65 max(n.L, 0)) under the fixed sheet light, with the card's alpha: (rgb, alpha). Wall pixels are lit with the face up, as the runtime reads their code.""" diff --git a/scripts/ridge-bake/ridge-bake.schema.json b/scripts/ridge-bake/ridge-bake.schema.json index f6b5fed4..762fabf6 100644 --- a/scripts/ridge-bake/ridge-bake.schema.json +++ b/scripts/ridge-bake/ridge-bake.schema.json @@ -172,7 +172,8 @@ "r_max_forward_m": { "type": "number" } - } + }, + "description": "r_max_m (every camera angle on its circle) and r_max_forward_m (the camera on its heading) are the offsets up to which the linear slide holds (the fit error at most FIT_PX_MAX card px) for the NEAREST solid terrain (at or beyond the near clip, ridge.NEAR_CLIP_M, 500 m) that each card draws in each tile, not for the tile's median distance_m; a tile that draws only skirt rows (wall) has no such terrain and binds nothing. Nothing nearer than the clip is baked as terrain, so they are no measure of the ground under it." }, "cards": { "type": "array", diff --git a/scripts/ridge-bake/ridge.py b/scripts/ridge-bake/ridge.py index 839e378b..73cb4c04 100644 --- a/scripts/ridge-bake/ridge.py +++ b/scripts/ridge-bake/ridge.py @@ -117,8 +117,9 @@ def detail_height(E, N, dist): return cfg['amp_m'] * fade * (s / nrm - 0.3) # ====================================================================== stage 0: march +NEAR_CLIP_M = 500.0 # authored: the march's first sample. Nothing nearer is baked as terrain; the ground under it is card 0's skirt (cards) def schedule(detail): - d = [500.0] + d = [NEAR_CLIP_M] while d[-1] < P['rmax_km'] * 1000: d.append(d[-1] + min(250.0, max(10.0 if detail else 40.0, 0.004 * d[-1]))) return np.array(d) @@ -181,15 +182,21 @@ def normals(d, h): return -sr * nz, -st * nz, nz # ====================================================================== the authored Y mapping +GROUND_ROWS_MIN = 150 # rows every bake keeps under the horizon: (1 - HORIZON_AT) x plane_h / RIDGE_BAND_FRAC of the runtime (view.ts groundRowsNeeded; ridgeAssets.test pins the two together) +E_MIN = 0.5 # the vertical exaggeration may go down to this to keep GROUND_ROWS_MIN (ruling ridge-ground-rows-below-horizon) def set_view(skyline, sky_row=0.04, near_row=0.66): """AUTHORED vertical mapping, linear in elevation angle: row = (TOP_DEG - angle) * PXDEG_V over the whole 600-row frame (cylindrical, horizontal 17.78 px/deg). skyline is the highest angle any sample reaches in each - ring column (W,), straight from the march. Two anchors on the whole ring (ruling ridge-ring-vertical-anchors): the highest skyline angle of the ring sits at `sky_row` (4%) of the frame height, the LOWEST sits at `near_row` (66%); - everything below is body and ground. PXDEG_V = (near_row - sky_row) * 600 / (highest - lowest), clamped to [17.78, 178] px/deg = vertical exaggeration 1x..10x. TOP_DEG = highest + sky_row*600/PXDEG_V; BOTTOM_DEG = TOP_DEG - 600/PXDEG_V.""" + ring column (W,), straight from the march. Three anchors on the whole ring (rulings ridge-ring-vertical-anchors, ridge-ground-rows-below-horizon): the highest skyline angle of the ring sits at `sky_row` (4%) of the frame height, the LOWEST sits at + `near_row` (66%) where the scale allows, and the horizon keeps GROUND_ROWS_MIN rows under it. PXDEG_V = the lesser of (near_row - sky_row) * 600 / (highest - lowest) and (600 - GROUND_ROWS_MIN - sky_row * 600) / highest, clamped to + [E_MIN, 10] x 17.78 px/deg = vertical exaggeration 0.5x..10x; a skyline whose highest angle cannot keep the ground rows even at E_MIN refuses (ValueError naming sky_deg, the scale needed and the floor). + TOP_DEG = highest + sky_row*600/PXDEG_V; BOTTOM_DEG = TOP_DEG - 600/PXDEG_V. Returns the view, with `binds` naming the anchor that set the scale: 'skyline', 'horizon', 'floor' or 'ceiling'.""" global rowang, PXDEG_V, TOP_DEG, BOTTOM_DEG - sk = np.asarray(skyline); sky = float(sk.max()); low = float(sk.min()) - ppd = float(np.clip((near_row - sky_row) * H / max(sky - low, 0.05), HPX_DEG, 10 * HPX_DEG)) + sk = np.asarray(skyline); sky = float(sk.max()); low = float(sk.min()); lo, hi = E_MIN * HPX_DEG, 10 * HPX_DEG + fit = (near_row - sky_row) * H / max(sky - low, 0.05); hold = (H - GROUND_ROWS_MIN - sky_row * H) / sky if sky > 0 else math.inf + if hold < lo: raise ValueError(f"the whole-ring skyline reaches {sky:.2f} degrees: holding {GROUND_ROWS_MIN} rows under the horizon needs {hold:.2f} px/deg, below the floor {lo:.2f} px/deg ({E_MIN:g}x)") + ppd = float(np.clip(min(fit, hold), lo, hi)); binds = 'horizon' if hold < fit and ppd == hold else 'floor' if ppd == lo else 'ceiling' if ppd == hi else 'skyline' PXDEG_V = ppd; TOP_DEG = sky + sky_row * H / ppd; BOTTOM_DEG = TOP_DEG - H / ppd; rowang = TOP_DEG - (np.arange(H) + 0.5) / PXDEG_V - return dict(top_deg=TOP_DEG, bottom_deg=BOTTOM_DEG, px_per_deg=PXDEG_V, exaggeration=PXDEG_V / HPX_DEG, horizon_row=TOP_DEG * PXDEG_V, sky_deg=sky, low_deg=low, sky_row=sky_row, near_row=near_row) + return dict(top_deg=TOP_DEG, bottom_deg=BOTTOM_DEG, px_per_deg=PXDEG_V, exaggeration=PXDEG_V / HPX_DEG, horizon_row=TOP_DEG * PXDEG_V, sky_deg=sky, low_deg=low, sky_row=sky_row, near_row=near_row, binds=binds) # ====================================================================== coverage and seams COV_BINS = 160 # log-distance bins between the first and the last sample @@ -241,13 +248,17 @@ def albedo(h, n_up): t = lambda a, b: np.clip((h - a) / (b - a), 0, 1)[..., None]; c = np.asarray(GRASS) + (np.asarray(FOREST) - GRASS) * t(150, 900); c = c + (np.asarray(ROCK) - c) * t(1300, 2000) c = c + (np.asarray(ROCK) - c) * np.clip((0.93 - n_up) / 0.25, 0, 1)[..., None]; return c + (np.asarray(SNOW) - c) * (t(1900, 2300) * np.clip((n_up - 0.55) / 0.3, 0, 1)[..., None]) -def cards(d, a, h, seams, nrm=None): +SKIRT_BLUR_DEG = 4.0 # Gaussian sigma, degrees of azimuth, of the sample-0 height the skirt's colour is read at (71 columns): no colour edge narrower than this survives down the rows. Authored, tuned by eye +def skirt_height(h): + """(W,) height, metres, of the first sample of the ring march h (K, W) blurred round the ring (periodic, Gaussian, SKIRT_BLUR_DEG): what card 0's skirt takes its material from. Needs the whole ring: a tile's columns would blur against a false edge.""" + return blurw(np.asarray(h)[0], SKIRT_BLUR_DEG * HPX_DEG) +def cards(d, a, h, seams, nrm=None, *, skirt): """K+1 cards, nearest first, from the angles a and heights h (samples, n) of n columns and the (K, n) seams (m). Card i holds per pixel the FIRST VISIBLE hit at or beyond seam i-1 (less XF): layered depth, so a farther card keeps the terrain a nearer ridge hides. Its alpha is that pixel's coverage (a crest row holds the share of its angular span under the card's running maximum) times 1 - smoothstep over seam i +- XF in log-distance of the hit; card 0 owns the rows below the first sample, the last card has no far edge. Alphas are then made nested so the alpha-over composite of all cards is exactly the opaque coverage (a row two cards both hold partly is not counted twice). Distance and normal are interpolated between sample k-1 and k by angle. Each card is cropped to the rows where its 8-bit alpha is not zero. - nrm is normals(d, h) of the same columns (default: computed from h as given, so pass it for columns cut from the ring: the lateral slope reads the neighbouring columns). Rows of a card i > 0 below the angle of its first sample (hit and idx == 0) are the extruded wall of the ridge the card starts at: they keep that sample's distance, their albedo is the ground material at their height with the face up (n_up = 1), - and `wall` flags them (card 0 has no wall: its rows below the first sample are the ground). Each card: dict(top, alpha (h,n), albedo (h,n,3), n_r, n_t, logd (ln metres) (h,n), wall (h,n) bool).""" + nrm is normals(d, h) of the same columns (default: computed from h as given, so pass it for columns cut from the ring: the lateral slope reads the neighbouring columns). Rows of any card below the angle of its first sample (hit and idx == 0) are its wall: they keep that sample's distance, their albedo is the ground material at their height with the face up (n_up = 1), + and `wall` flags them. Card 0's wall is the skirt, the extruded face of the near clip (NEAR_CLIP_M): nothing nearer is baked, so its rows take the material of `skirt` (n,), the sample-0 height blurred round the ring (skirt_height of the whole ring, cut to these columns), not one column's own height. Each card: dict(top, alpha (h,n), albedo (h,n,3), n_r, n_t, logd (ln metres) (h,n), wall (h,n) bool).""" d = np.asarray(d, np.float64); a = np.asarray(a, np.float64); h = np.asarray(h, np.float64); seams = np.asarray(seams, np.float64); nk, n = a.shape; nc = len(seams) + 1 n_r, n_t, n_u = nrm if nrm is not None else normals(d, h); ld = np.broadcast_to(np.log(d)[:, None], (nk, n)); p = 1.0 / PXDEG_V; lo = rowang - 0.5 * p ks0 = [np.searchsorted(d, seams[i - 1] * math.exp(-XF)) for i in range(1, nc)]; ks1 = [np.searchsorted(d, seams[i] * math.exp(XF)) for i in range(nc - 1)] @@ -262,7 +273,7 @@ def cards(d, a, h, seams, nrm=None): t = np.where(idx > 0, np.clip((rowang - prev) / np.maximum(rm[idx] - prev, 1e-9), 0, 1), 1.0); mix = lambda arr: arr[kp, x] + t * (arr[kk, x] - arr[kp, x]) F[i, :, x] = np.where(hit, np.clip((rm[-1] - lo) / p, 0, 1), 0); lh = mix(ld) G[i, :, :, x] = np.where(hit, np.stack([lh, mix(h), mix(n_r), mix(n_t), mix(n_u)]), 0) - if i: Wl[i, :, x] = hit & (idx == 0) # rows below the card's first sample: the extruded wall (card 0's are the ground) + Wl[i, :, x] = hit & (idx == 0) # rows below the card's first sample: the extruded wall (card 0's the skirt) if i < nc - 1: s = np.clip((lh - (math.log(seams[i, x]) - XF)) / (2 * XF), 0, 1); X[i, :, x] = 1 - s * s * (3 - 2 * s) out = []; A = np.zeros((H, n)) for i in range(nc): @@ -270,5 +281,5 @@ def cards(d, a, h, seams, nrm=None): rows = np.flatnonzero(al.max(1) > 0) if not len(rows): out.append(dict(top=0, alpha=np.zeros((0, n), np.float32), albedo=np.zeros((0, n, 3), np.float32), n_r=np.zeros((0, n), np.float32), n_t=np.zeros((0, n), np.float32), logd=np.zeros((0, n), np.float32), wall=np.zeros((0, n), bool))); continue sl = slice(int(rows[0]), int(rows[-1]) + 1); g = G[i, :, sl]; nz = np.sqrt(g[2] ** 2 + g[3] ** 2 + g[4] ** 2) + 1e-12 - out.append(dict(top=int(rows[0]), alpha=al[sl].astype(np.float32), albedo=albedo(g[1], np.where(Wl[i, sl], 1.0, g[4] / nz)).astype(np.float32), n_r=(g[2] / nz).astype(np.float32), n_t=(g[3] / nz).astype(np.float32), logd=g[0].astype(np.float32), wall=Wl[i, sl].copy())) + out.append(dict(top=int(rows[0]), alpha=al[sl].astype(np.float32), albedo=albedo(np.where(Wl[i, sl] & (i == 0), np.asarray(skirt, np.float64)[None, :], g[1]), np.where(Wl[i, sl], 1.0, g[4] / nz)).astype(np.float32), n_r=(g[2] / nz).astype(np.float32), n_t=(g[3] / nz).astype(np.float32), logd=g[0].astype(np.float32), wall=Wl[i, sl].copy())) return out diff --git a/scripts/ridge-bake/tests/mutate.py b/scripts/ridge-bake/tests/mutate.py index 17e2a817..f9bd7212 100644 --- a/scripts/ridge-bake/tests/mutate.py +++ b/scripts/ridge-bake/tests/mutate.py @@ -25,8 +25,23 @@ MUTANTS = { # name -> (text in ridge.py or export.py, replacement) 'coverage: the rows below the first sample are counted twice': ("* PXDEG_V)\n return C", "* PXDEG_V); C[0] += np.clip(np.minimum(a[0], TOP_DEG) - BOTTOM_DEG, 0, None) * PXDEG_V\n return C"), 'cards: the hit is not interpolated between samples': ("t = np.where(idx > 0, np.clip((rowang - prev) / np.maximum(rm[idx] - prev, 1e-9), 0, 1), 1.0)", "t = np.ones_like(rowang)"), 'cards: the blended normal is not renormalised': ("nz = np.sqrt(g[2] ** 2 + g[3] ** 2 + g[4] ** 2) + 1e-12", "nz = 1.0"), - 'wall: no row is flagged (the flag is dropped)': ("if i: Wl[i, :, x] = hit & (idx == 0)", "if i: Wl[i, :, x] = False"), - 'wall: card 0 is flagged too (its ground rows become wall)': ("if i: Wl[i, :, x] = hit & (idx == 0)", "Wl[i, :, x] = hit & (idx == 0)"), + 'wall: no row is flagged (the flag is dropped)': ("Wl[i, :, x] = hit & (idx == 0)", "Wl[i, :, x] = False"), + 'wall: card 0 is exempt (its rows under the near clip are extruded ground, not a skirt)': ("Wl[i, :, x] = hit & (idx == 0)", "if i: Wl[i, :, x] = hit & (idx == 0)"), + 'skirt: the colour is read at the own-column sample-0 height (no blur)': ("np.where(Wl[i, sl] & (i == 0), np.asarray(skirt, np.float64)[None, :], g[1])", "g[1]"), + 'skirt: the blur is a hair (0.01 degrees)': ("SKIRT_BLUR_DEG = 4.0 ", "SKIRT_BLUR_DEG = 0.01 "), + 'skirt: the blur sigma is in columns, not degrees': ("SKIRT_BLUR_DEG * HPX_DEG)", "SKIRT_BLUR_DEG)"), + 'skirt: each tile blurs its own columns (the ring is not blurred whole)': ("skirt=cols(sk, t))", "skirt=ridge.blurw(cols(h, t)[0], ridge.SKIRT_BLUR_DEG * ridge.HPX_DEG))"), + 'r_max: the tile median binds, not the nearest terrain': ("r_max = solve_r_max(near, bands, ppd); r_fwd = solve_r_max(near, bands, ppd, phis=1)", "r_max = solve_r_max(dist, bands, ppd); r_fwd = solve_r_max(dist, bands, ppd, phis=1)"), + 'r_max: a tile of skirt only binds at its wall distance': ("if solid.any() else None)", "if solid.any() else dm)"), + 'r_max: the nearest pixel is the farthest solid one': ("nrow.append(float(np.exp(ld[solid].min()))", "nrow.append(float(np.exp(ld[solid].max()))"), + 'near clip: the writer compares the float32 distance strictly': ("if rmin < ridge.NEAR_CLIP_M * (1 - 1e-5): raise", "if rmin < ridge.NEAR_CLIP_M: raise"), + 'near clip: the march starts nearer than the clip': ("d = [NEAR_CLIP_M]", "d = [100.0]"), + 'near clip: a card 0 inside the clip is accepted by the writer': ("if rmin < ridge.NEAR_CLIP_M * (1 - 1e-5): raise", "if False: raise"), + 'view: the 1x floor is back': ("lo, hi = E_MIN * HPX_DEG, 10 * HPX_DEG", "lo, hi = HPX_DEG, 10 * HPX_DEG"), + 'view: the horizon anchor is dropped (the scale is the skyline fit alone)': ("ppd = float(np.clip(min(fit, hold), lo, hi))", "ppd = float(np.clip(fit, lo, hi))"), + 'view: a skyline that cannot hold the ground rows is not refused': ("if hold < lo: raise", "if False: raise"), + 'view: the ground rows are not asked for (GROUND_ROWS_MIN 0)': ("GROUND_ROWS_MIN = 150 ", "GROUND_ROWS_MIN = 0 "), + 'validate_manifest: a plane short of its ground rows is accepted': ("if v['plane_h'] - v['horizon_row'] < ridge.GROUND_ROWS_MIN - 1e-6: raise", "if False: raise"), 'wall: albedo takes the face normal, not the face up': ("np.where(Wl[i, sl], 1.0, g[4] / nz)", "g[4] / nz"), 'wall: the code is not written to the geometry': ("if wall is not None: m = np.asarray(wall, bool)", "if False: m = np.asarray(wall, bool)"), 'wall: the sheet lights wall rows with their normal': ("wall = c['wall']; n_r, n_t = np.where(wall, 0.0, c['n_r']), np.where(wall, 0.0, c['n_t'])", "n_r, n_t = c['n_r'], c['n_t']"), @@ -47,7 +62,7 @@ MUTANTS = { # name -> (text in ridge.py or export.py, replacement) 'budget: the run length forgets the margin tiles': ("math.ceil(arc / TILE_DEG) + 1 + 4", "math.ceil(arc / TILE_DEG)"), 'r_max: the camera sweeps forward only (phi = 0)': ("PHI_STEPS = 24 ", "PHI_STEPS = 1 "), 'r_max: every card of a tile is fitted at the nearest card distance': ("fit_px(d, r, px_per_deg, phis) for d in row", "fit_px(row[0] if row[0] is not None else d, r, px_per_deg, phis) for d in row"), - 'r_max_forward: the forward offset is searched over the whole circle': ("r_fwd = solve_r_max(dist, bands, ppd, phis=1)", "r_fwd = solve_r_max(dist, bands, ppd)"), + 'r_max_forward: the forward offset is searched over the whole circle': ("r_fwd = solve_r_max(near, bands, ppd, phis=1)", "r_fwd = solve_r_max(near, bands, ppd)"), 'r_max_forward: the resident gate is not checked at the forward offset': ("for r in (camera['r_max_m'], camera['r_max_forward_m']): check_budget", "for r in (camera['r_max_m'],): check_budget"), 'r_max_forward: a forward offset below r_max_m is accepted': ("if camera['r_max_forward_m'] < camera['r_max_m']: raise", "if False: raise"), 'fit: the line is the least squares of 33 uniform samples, as the first gate drew it': ("x, w = np.polynomial.legendre.leggauss(FIT_QUAD)", "x = np.linspace(-1, 1, 33); w = np.full(33, 2 / 33)"), diff --git a/scripts/ridge-bake/tests/test_ridge.py b/scripts/ridge-bake/tests/test_ridge.py index 7cba627e..54ddee9e 100644 --- a/scripts/ridge-bake/tests/test_ridge.py +++ b/scripts/ridge-bake/tests/test_ridge.py @@ -52,7 +52,7 @@ def _bake(hfun, splits_km, sigma=0.0, fixed_m=None): """prefilter, whole-ring set_view, coverage and the periodic seams on the whole ring (or fixed_m, one seam depth in m for every column), then the window columns 0..NW (azimuth 0..72) of them and the cards on those, of synthetic rays: the pieces of the bake a fixture can look at cheaply.""" A, Hh = rays(hfun); ridge.P.update(eye_m=EYE); a, h = ridge.prefilter(D, Hh, sigma); v = ridge.set_view(a.max(0)) nrm = tuple(_w(x) for x in ridge.normals(D, h)); aw, hw = _w(a), _w(h); cov_ring = ridge.coverage(D, a); cov = _w(cov_ring); sm = _w(ridge.seams(cov_ring, [k * 1000.0 for k in splits_km], D)) if fixed_m is None else np.array([np.full(NW, float(v)) for v in fixed_m]) - return dict(cards=ridge.cards(D, aw, hw, sm, nrm), splits_km=list(splits_km), seams=sm, cov=cov, opaque=ridge.opaque(aw), edges=ridge.log_edges(D), a=aw, h=hw, nrm=nrm, v=v) + skirt = _w(ridge.skirt_height(h)); return dict(cards=ridge.cards(D, aw, hw, sm, nrm, skirt=skirt), skirt=skirt, splits_km=list(splits_km), seams=sm, cov=cov, opaque=ridge.opaque(aw), edges=ridge.log_edges(D), a=aw, h=hw, nrm=nrm, v=v) def _canvas(card, key='alpha'): out = np.zeros((H, NW) + card[key].shape[2:], np.float32); out[card['top']:card['top'] + card[key].shape[0]] = card[key]; return out def _row(deg): return int(np.argmin(np.abs(ridge.rowang - deg))) @@ -106,7 +106,7 @@ def test_far_card_keeps_terrain_hidden_behind_a_nearer_ridge(): def test_crossfade_is_complementary(): """A ridge across the seam (seam fixed at 6 km, the ridge's front face at 5.9 km inside the cross-fade): the nearer card is partly transparent over the window, the farther card is opaque on the ridge, and the composite stays at coverage 1 below the crest.""" A, Hh = rays(terrain(block(0, 359.99, 5900, 6100, 900))); ridge.P.update(eye_m=EYE); ridge.set_view(A.max(0)); aw, hw = _w(A), _w(Hh) - cs = ridge.cards(D, aw, hw, np.full((1, NW), 6000.0)); c0, c1 = _canvas(cs[0]), _canvas(cs[1]); crest = int(np.argmax(ridge.opaque(aw)[:, 500] > 0.5)); r = crest + 6 + cs = ridge.cards(D, aw, hw, np.full((1, NW), 6000.0), skirt=_w(ridge.skirt_height(Hh))); c0, c1 = _canvas(cs[0]), _canvas(cs[1]); crest = int(np.argmax(ridge.opaque(aw)[:, 500] > 0.5)); r = crest + 6 assert 0.2 < c0[r, 500] < 0.8, ('the near card does not fade over the window', c0[r, 500]); assert c1[r, 500] > 0.99, 'the far card is not opaque on the ridge' comp = 1 - (1 - c0) * (1 - c1); assert (comp[crest + 3:, :] > 0.999).all(), 'the composite dips below coverage 1 under the crest' def test_normals_of_a_tilted_plane(): @@ -136,7 +136,7 @@ def test_prefilter_flattens_roofs_and_keeps_hills(): assert np.allclose(ridge.prefilter(D, Hh, 0.0)[1], Hh), 'sigma 0 changed the heights' def test_crest_rows_have_fractional_coverage(): """The top row of a card's run has alpha equal to the share of its angular span under the running maximum, and the rows below it are 1 (a lower ridge in columns 0..640 so its crest is not at the frame's top edge).""" - A, Hh = rays(terrain(block(0, 36, 5000, 5600, 500), block(36, 359.99, 5000, 5600, 560))); ridge.P.update(eye_m=EYE); ridge.set_view(A.max(0)); aw, hw = _w(A), _w(Hh); c = ridge.cards(D, aw, hw, np.zeros((0, NW)))[0] + A, Hh = rays(terrain(block(0, 36, 5000, 5600, 500), block(36, 359.99, 5000, 5600, 560))); ridge.P.update(eye_m=EYE); ridge.set_view(A.max(0)); aw, hw = _w(A), _w(Hh); c = ridge.cards(D, aw, hw, np.zeros((0, NW)), skirt=_w(ridge.skirt_height(Hh)))[0] cv = _canvas(c)[:, 300]; r = int(np.argmax(cv > 0)); top = float(aw.max(0)[300]); p = 1.0 / ridge.PXDEG_V; want = (top - (ridge.rowang[r] - 0.5 * p)) / p assert 0.0 < want < 1.0 and abs(cv[r] - want) < 0.01, (cv[r], want, r); assert (cv[r + 1:] > 0.999).all() def test_cards_composite_to_the_opaque_view(): @@ -190,7 +190,7 @@ def test_every_tile_is_cut_at_its_own_seam(): def test_tile_is_a_crop_of_the_columns(): """ridge.cards on a tile's columns (the 200 it owns and the apron) equals the same columns of ridge.cards on a wider run of columns, pixel for pixel, for fixed seams: the tile cut changes no pixel and adds no seam.""" b = _bake(terrain(_receding, block(0, 359.99, 3000, 3600, 350)), [6]); x0 = 500; n = export.TILE_W + 2 * export.APRON; sl = slice(x0, x0 + n) - tile = ridge.cards(D, b['a'][:, sl], b['h'][:, sl], b['seams'][:, sl], tuple(x[:, sl] for x in b['nrm'])) + tile = ridge.cards(D, b['a'][:, sl], b['h'][:, sl], b['seams'][:, sl], tuple(x[:, sl] for x in b['nrm']), skirt=b['skirt'][sl]) for c, w in zip(tile, b['cards']): assert np.array_equal(_canvas(w)[:, sl], _tile_canvas(c)), 'a tile is not a crop of the columns'; seen = _tile_canvas(c) > 0 for key in ('albedo', 'n_r', 'n_t', 'logd', 'wall'): assert np.array_equal(_canvas(w, key)[:, sl][seen], _tile_canvas(c, key)[seen]), ('a tile is not a crop of the columns', key) @@ -213,7 +213,7 @@ def _refuses(out, b, packed, why, **kw): except ValueError: assert not os.path.exists(out), ('a refused bake left files', why) else: assert False, why def _pins(): - assert (export.RING_W, export.TILES, export.TILE_W, export.APRON, export.MAX_CARDS, export.BAKER_VERSION) == (6400, 32, 200, 2, 6, 5), 'the ring layout is pinned' + assert (export.RING_W, export.TILES, export.TILE_W, export.APRON, export.MAX_CARDS, export.BAKER_VERSION) == (6400, 32, 200, 2, 6, 6), 'the ring layout is pinned' assert (export.TILE_BYTES_MAX, export.PLACE_BYTES_MAX, export.RESIDENT_BYTES_MAX, export.FIT_PX_MAX, export.R_MAX_FLOOR_M, export.PHI_STEPS) == (235_000, 7_500_000, 20_000_000, 24.0, 25.0, 24), 'the budgets and the fit bound are pinned' assert abs(export.HFOV_MAX_DEG - 72 / 1.1) < 1e-12 @@ -222,7 +222,7 @@ def test_schema3(): _pins(); d = tempfile.mkdtemp() try: b = _toy(); pk = export.pack(b); dest = _write(d, b, pk); m = json.load(open(dest / 'manifest.json')); export.validate_manifest(m); mk = lambda: json.loads(json.dumps(m)) - assert m['schema'] == 3 and m['baker_version'] == 5 and set(m['view']) >= {'ring_w', 'tile_w', 'tiles', 'apron'} and 'rows_above' not in m['view'] and m['camera'] == dict(r_max_m=pk['camera']['r_max_m'], r_max_forward_m=pk['camera']['r_max_forward_m']) and m['camera']['r_max_forward_m'] >= m['camera']['r_max_m'] and len(m['tiles']) == 32 and 'w' not in m and 'h' not in m + assert m['schema'] == 3 and m['baker_version'] == 6 and set(m['view']) >= {'ring_w', 'tile_w', 'tiles', 'apron'} and 'rows_above' not in m['view'] and m['camera'] == dict(r_max_m=pk['camera']['r_max_m'], r_max_forward_m=pk['camera']['r_max_forward_m']) and m['camera']['r_max_forward_m'] >= m['camera']['r_max_m'] and len(m['tiles']) == 32 and 'w' not in m and 'h' not in m def bad(f, why): x = mk(); f(x) try: export.validate_manifest(x) @@ -407,7 +407,7 @@ def test_pack_distance_and_r_max_in_the_bake(): b = _toy(); cs = [[dict(c) for c in tile] for tile in b['cards']]; c = dict(cs[10][1]); n = c['alpha'].shape[0]; wall = np.zeros_like(c['wall']); wall[:n * 3 // 4] = True; ld = np.where(wall, c['logd'] + 3.0, c['logd']).copy(); ld[:, :2] += 2.0; ld[:, -2:] += 2.0; cs[10][1] = dict(c, wall=wall, logd=ld) pk = export.pack(dict(b, cards=cs)); inner = (slice(None), slice(2, -2)); want = float(np.exp(np.median(ld[inner][~wall[inner]]))); with_wall = float(np.exp(np.median(ld[inner]))); assert abs(with_wall - want) > 0.05 * want, 'the fixture cannot tell wall rows from ground' assert abs(pk['tiles'][10][1]['distance_m'] - want) < 1e-9 * want, ('the distance counted wall rows or the apron', pk['tiles'][10][1]['distance_m'], want); assert set(pk['tiles'][10][1]) == {'top', 'colour', 'geometry', 'distance_m'} and set(pk['cards'][0]) == {'near_m', 'far_m'} - base = export.pack(b); assert base['camera']['r_max_m'] >= 25 and base['camera']['r_max_forward_m'] >= base['camera']['r_max_m'] and abs(base['report']['nearest_m'] - min(e[0]['distance_m'] for e in base['tiles'])) < 1e-9 and len(base['report']['fit_px']) == 3 and max(base['report']['fit_px']) <= export.FIT_PX_MAX + 1e-6 + base = export.pack(b); assert base['camera']['r_max_m'] >= 25 and base['camera']['r_max_forward_m'] >= base['camera']['r_max_m'] and abs(base['report']['nearest_m'] - min(float(np.exp(c[0]['logd'][:, 2:-2].min())) for c in b['cards'])) < 1e-6 and len(base['report']['fit_px']) == 3 and max(base['report']['fit_px']) <= export.FIT_PX_MAX + 1e-6 near = export.pack(_toy(dists=(1500.0, 15000.0, 50000.0))); assert near['camera']['r_max_forward_m'] > near['camera']['r_max_m'] + 5, ('the forward offset was searched over the whole circle', near['camera']) assert abs(base['cards'][0]['far_m'] - 1500.0) < 1e-6 and base['cards'][0]['near_m'] is None and base['cards'][1]['near_m'] == base['cards'][0]['far_m'] def test_the_sheet_draws_the_ring(): @@ -428,9 +428,9 @@ def _vienna_ring(splits, tiles): """Vienna's whole-ring march and seams for the given splits, cards on only the given tiles: (d, seams, {t: cards}, {t: opaque}).""" saved = ridge.P try: - p = ridge.configure(dict(ridge.load_preset('vienna'), card_split_km=splits)); d, _, Hh, _ = ridge.stage0(False); a, h = ridge.prefilter(d, Hh, p['prefilter_m']); ridge.set_view(a.max(0)); nrm = ridge.normals(d, h); sm = ridge.seams(ridge.coverage(d, a), [k * 1000.0 for k in splits], d); op = ridge.opaque(a) + p = ridge.configure(dict(ridge.load_preset('vienna'), card_split_km=splits)); d, _, Hh, _ = ridge.stage0(False); a, h = ridge.prefilter(d, Hh, p['prefilter_m']); ridge.set_view(a.max(0)); nrm = ridge.normals(d, h); sk = ridge.skirt_height(h); sm = ridge.seams(ridge.coverage(d, a), [k * 1000.0 for k in splits], d); op = ridge.opaque(a) cols = lambda x, t: ridge.ring_cols(x, t * export.TILE_W - export.APRON, export.TILE_W + 2 * export.APRON) - return d, sm, {t: ridge.cards(d, cols(a, t), cols(h, t), cols(sm, t), tuple(cols(x, t) for x in nrm)) for t in tiles}, {t: cols(op, t) for t in tiles} + return d, sm, {t: ridge.cards(d, cols(a, t), cols(h, t), cols(sm, t), tuple(cols(x, t) for x in nrm), skirt=cols(sk, t)) for t in tiles}, {t: cols(op, t) for t in tiles} finally: ridge.P = saved def test_vienna_k1_k2_k3(): """Vienna with card_split_km [6], [6, 40] and [6, 20, 40]: 2, 3 and 4 cards, seams ordered in every column of the ring, each composite of a tile (the rest azimuth's, the north's and the last one) equals the opaque view within 0.02; the cross-fade column count is printed.""" @@ -482,33 +482,111 @@ def test_written_cards_decode_to_the_cards_in_memory(): # ---------------------------------------------------------------------------------------- wall rows def _first_sample_angle(b, i): - """Per column, the angle of the first sample card i (> 0) reads: the first sample at or beyond its near seam, less the cross-fade half-width.""" - k0 = np.array([np.searchsorted(D, b['seams'][i - 1][x] * math.exp(-ridge.XF)) for x in range(NW)]); return k0, b['a'][k0, np.arange(NW)] + """Per column, the angle of the first sample card i reads: the first sample at or beyond its near seam, less the cross-fade half-width (card 0: sample 0, the near clip).""" + k0 = np.zeros(NW, int) if i == 0 else np.array([np.searchsorted(D, b['seams'][i - 1][x] * math.exp(-ridge.XF)) for x in range(NW)]); return k0, b['a'][k0, np.arange(NW)] def test_wall_rows_flagged(): - """Card i > 0 flags as wall exactly the rows below the angle of its first sample (the extruded face of the ridge it starts at), card 0 none; the wall carries R = G = 255 in the geometry file and no other pixel has r2 + t2 above 1.02; wall pixels keep that sample's - distance and their albedo is the ground material of the sample's height with the face up (so a steep face is not rock), constant down the column.""" + """Every card, card 0 included, flags as wall exactly the rows below the angle of its first sample (the extruded face of the ridge it starts at; card 0's is the skirt under the near clip); the wall carries R = G = 255 in the geometry file and no other pixel has r2 + t2 above 1.02; wall pixels keep that sample's + distance and their albedo is the ground material of the sample's height with the face up (so a steep face is not rock), constant down the column (card 0: the material of the ring-blurred sample-0 height, ridge.skirt_height).""" steep = 0 for make in (lambda: _bake(WALLED, [20]), lambda: _bake(WIDE3, [20, 55]), lambda: _bake(_receding, [6]), lambda: _bake(_ramp, [20], fixed_m=[20000.0])): # the ramp's seam is fixed: the wall must stand on the slope, below the height where every material is rock or snow - b = make(); assert not b['cards'][0]['wall'].any(), 'card 0 has a wall'; lo = ridge.rowang - 0.5 / ridge.PXDEG_V; seen = 0 + b = make(); lo = ridge.rowang - 0.5 / ridge.PXDEG_V; seen = 0 for i, c in enumerate(b['cards']): - if i == 0: continue k0, a0 = _first_sample_angle(b, i); want = (lo[:, None] < a0[None, :])[c['top']:c['top'] + c['alpha'].shape[0]]; assert (c['wall'] == want).all(), ('wall rows are not the rows below the first sample', i, int((c['wall'] != want).sum())); seen += int(want.sum()) geo = export.decode(export.encode_geometry(c['n_r'], c['n_t'], c['logd'], dict(log_d_min=math.log(D[0]), log_d_max=math.log(D[-1])), c['wall'])); r, t = geo[..., 0] / 255.0 * 2 - 1, geo[..., 1] / 255.0 * 2 - 1; code = (geo[..., 0] == 255) & (geo[..., 1] == 255) assert (code == c['wall']).all() and (r[~code] ** 2 + t[~code] ** 2 <= 1.02).all(), 'the wall code is not on exactly the wall pixels, or a real normal reaches it' for x in np.flatnonzero(c['wall'].any(0)): rows = np.flatnonzero(c['wall'][:, x]); ld = c['logd'][rows, x]; assert np.ptp(ld) < 1e-5 and abs(math.exp(ld[0]) - D[k0[x]]) < 1e-3 * D[k0[x]] + 60, ('a wall keeps its sample distance', x) - want_alb = ridge.albedo(np.array([b['h'][k0[x], x]]), np.array([1.0]))[0]; assert np.abs(c['albedo'][rows, x] - want_alb).max() < 1e-5, ('wall albedo is not the ground material with the face up', x) + want_alb = ridge.albedo(np.array([b['skirt'][x] if i == 0 else b['h'][k0[x], x]]), np.array([1.0]))[0]; assert np.abs(c['albedo'][rows, x] - want_alb).max() < 1e-5, ('wall albedo is not the ground material with the face up', x) assert seen > 1000, 'the fixture has no wall' for i in range(1, len(b['cards'])): c = b['cards'][i]; steep += int((np.sqrt(np.clip(1 - c['n_r'] ** 2 - c['n_t'] ** 2, 0, 1))[c['wall']] < 0.93).sum()) assert steep > 1000, 'no wall pixel has a steep face under it: a wall lit by its own normal would pass' b = _bake(NEARHILL, [20]); c0 = b['cards'][0]; lo = ridge.rowang - 0.5 / ridge.PXDEG_V; below = (lo[:, None] < b['a'][0][None, :])[c0['top']:c0['top'] + c0['alpha'].shape[0]] - assert below.sum() > 1000 and not c0['wall'].any(), ('card 0 has no wall, though rows lie below its first sample', int(below.sum())) + assert below.sum() > 1000 and (c0['wall'] == below).all(), ('card 0 has a skirt: the rows below its first sample are wall', int(below.sum()), int((c0['wall'] != below).sum())) def test_the_sheet_lights_a_wall_with_the_face_up(): """The contact sheet shades a wall pixel as an up-facing one whatever normal the card carries there, and a non-wall pixel by its normal.""" n = 4; c = dict(albedo=np.ones((n, n, 3), np.float32), alpha=np.ones((n, n), np.float32), n_r=np.full((n, n), 0.9, np.float32), n_t=np.zeros((n, n), np.float32), wall=np.zeros((n, n), bool)); c['wall'][:, :2] = True rgb, _ = export.lit(c); L = np.array(export.SHEET_LIGHT) / np.linalg.norm(export.SHEET_LIGHT); up = 0.35 + 0.65 * L[2]; tilted = 0.35 + 0.65 * np.clip(0.9 * L[0] + np.sqrt(1 - 0.81) * L[2], 0, 1) assert np.allclose(rgb[:, :2], up) and np.allclose(rgb[:, 2:], tilted) and abs(up - tilted) > 0.05, (rgb[0, 0], rgb[0, 3]) +# ---------------------------------------------------------------------------------------- the skirt, the near clip, the ground rows +def _skirt_card(blur=True): + """Card 0 of a ring whose first sample (the near clip) stands at 100, 1000 or 2100 m in blocks of 20 columns (grass, forest, rock: the heights step across both material thresholds) at 5 degrees, with terrain rising from there to 30 degrees: the cards' window 0..NW, the card, its skirt rows.""" + K = len(D); a = np.tile(np.linspace(5.0, 30.0, K)[:, None], (1, W)); h = np.full((K, W), 1000.0); h[0] = np.array([100.0, 1000.0, 2100.0])[(np.arange(W) // 20) % 3]; ridge.set_view(a.max(0)); sk = ridge.skirt_height(h) if blur else h[0] + c = ridge.cards(D, _w(a), _w(h), np.zeros((0, NW)), skirt=_w(sk))[0]; return c, h +def test_the_skirt_is_calm_where_the_near_ground_steps(): + """The rows under card 0's first sample (the near clip) are a skirt: all of them carry the wall flag, and where the sample-0 height steps across the grass / forest and forest / rock thresholds every 20 columns, every skirt row more than 16 rows below the first-sample row differs by less than 0.02 between adjacent columns + (the colour is read at the ring-blurred height, ridge.SKIRT_BLUR_DEG); read at the column's own height the same rows jump by far more (the fixture can tell).""" + c, h = _skirt_card(); wall = c['wall']; r0 = int(np.argmax(ridge.rowang < 5.0)); rows = np.arange(c['alpha'].shape[0]) + c['top']; far = (rows >= r0 + 16)[:, None] & wall[:, 1:] & wall[:, :-1] + assert wall.sum() > 100 * NW and far.sum() > 100 * NW, ('the skirt is not there', int(wall.sum())); assert ((rows < r0 - 1)[:, None] & wall).sum() == 0, 'a wall row above the first sample' + jump = lambda c_: np.abs(np.diff(c_['albedo'], axis=1)).max(-1)[far].max(); calm = jump(c); raw = jump(_skirt_card(blur=False)[0]) + assert calm < 0.02, ('the skirt has a colour edge', calm); assert raw > 0.1, ('the unblurred skirt does not jump: the fixture cannot tell', raw) + assert np.allclose(c['logd'][wall], math.log(ridge.NEAR_CLIP_M), atol=1e-4), 'a skirt row is not at the near clip' +def test_card0_distance_ignores_the_skirt(): + """pack gives card 0's tile distance_m as the median over its terrain pixels: the skirt rows (wall, at the near clip) do not enter it, and counting them would move it.""" + c, _ = _skirt_card(); n = export.TILE_W + 2 * export.APRON; sl = slice(300, 300 + n); b = _toy(); cs = [[dict(x) for x in tile] for tile in b['cards']]; nc = {k: (c[k][:, sl] if k != 'top' else c[k]) for k in c} + for tile in cs: tile[0] = dict(nc) + inner = (slice(None), slice(export.APRON, export.APRON + export.TILE_W)); al, wl, ld = nc['alpha'][inner], nc['wall'][inner], nc['logd'][inner]; want = float(np.exp(np.median(ld[(al >= 0.5) & ~wl]))); with_skirt = float(np.exp(np.median(ld[al >= 0.5]))) + assert abs(with_skirt - want) > 0.05 * want and want > ridge.NEAR_CLIP_M, ('the fixture cannot tell the skirt from the terrain', want, with_skirt) + assert abs(export.pack(dict(b, cards=cs))['tiles'][0][0]['distance_m'] - want) < 1e-9 * want, 'card 0 distance counted the skirt' +def _nearest_solid(c): + """The nearest solid (alpha >= 0.5) non-wall pixel of a card tile's interior columns, metres; None where there is none (computed here from the arrays, not by pack).""" + ld, al, wl = (c[k][:, 2:-2] for k in ('logd', 'alpha', 'wall')); m = (al >= 0.5) & ~wl; return float(np.exp(np.float64(ld[m].min()))) if m.any() else None +def test_r_max_holds_for_the_nearest_terrain_of_every_tile_and_skirt_only_tiles_do_not_bind(): + """The offset range is where the linear map holds for the NEAREST solid terrain each card draws in each tile (ruling ridge-offset-range-fit), not its median: a tile whose card 0 spans 600 to 2000 m has its median near 1200 m, and at the r_max the median would give the 600 m pixels err past FIT_PX_MAX. + So the fit at every tile's nearest solid pixel is within the bound at r_max_m (over the circle) and at r_max_forward_m (phi 0), and the bound is reached: a little more offset breaks it at the binding tile. A tile whose card 0 draws only wall (the skirt, at the near clip) has no terrain and binds nothing.""" + b = _toy(); cs = [[dict(c) for c in tile] for tile in b['cards']]; c = dict(cs[7][0]); n = c['alpha'].shape[1] + ld = np.log(np.linspace(600.0, 2000.0, n))[None, :].repeat(c['alpha'].shape[0], 0).astype(np.float32); cs[7][0] = dict(c, logd=ld) + bad = dict(cs[5][0]); cs[5][0] = dict(bad, wall=np.ones_like(bad['wall']), logd=np.full_like(bad['logd'], math.log(500.0))) # tile 5: card 0 is all skirt + pk = export.pack(dict(b, cards=cs)); r, rf = pk['camera']['r_max_m'], pk['camera']['r_max_forward_m']; ppd = ridge.HPX_DEG; worst = worst_f = 0.0; seen = 0 + for t, tile in enumerate(cs): + for i, card in enumerate(tile): + d = _nearest_solid(card) + if d is None: assert (t, i) == (5, 0), ('a tile has no solid terrain but was not made all skirt', t, i); continue + seen += 1; assert export.fit_px(d, r, ppd) <= export.FIT_PX_MAX + 1e-6 and export.fit_px(d, rf, ppd, 1) <= export.FIT_PX_MAX + 1e-6, ('the nearest terrain of a tile is outside the fit bound', t, i, d, r, rf) + worst, worst_f = max(worst, export.fit_px(d, r + 0.5, ppd)), max(worst_f, export.fit_px(d, rf + 0.5, ppd, 1)) + assert seen == 32 * 3 - 1 and worst > export.FIT_PX_MAX and worst_f > export.FIT_PX_MAX, ('the range stops short of the bound of the nearest terrain', worst, worst_f) + assert abs(pk['tiles'][7][0]['distance_m'] - float(np.exp(np.median(np.log(np.linspace(600.0, 2000.0, n)))))) < 1.0, 'the manifest distance is still the median' + assert r < export.solve_r_max([[1200.0 if (t, i) == (7, 0) else None for i in range(3)] for t in range(32)], [[100] * 3 for _ in range(32)], ppd) - 5, 'the range is the median model' + skirt_free = export.pack(_toy()); assert pk['camera']['r_max_m'] < skirt_free['camera']['r_max_m'], 'the 600 m pixels do not bind' + only = export.pack(dict(b, cards=[[dict(cs[t][i]) if (t, i) != (7, 0) else dict(b['cards'][7][0]) for i in range(3)] for t in range(32)])); assert only['camera'] == skirt_free['camera'], ('a skirt-only tile binds r_max', only['camera'], skirt_free['camera']) +def test_the_near_clip_compare_does_not_depend_on_float32_rounding(): + """A card 0 exactly at the near clip is accepted whatever the clip's value: exp of a float32 ln 700 is 699.99994, which a strict compare against a 700 m clip refuses; one 1.5 per mille under the clip is still refused.""" + saved = ridge.NEAR_CLIP_M; d = tempfile.mkdtemp() + try: + for clip in (500.0, 520.0, 700.0): + ridge.NEAR_CLIP_M = clip; b = _toy(dists=(clip, 15000.0, 50000.0), amp=0.0); pk = export.pack(b); assert pk['tiles'][0][0]['distance_m'] != 0 + dest = _write(d + f'/ok{clip:g}', b, pk); assert dest.exists(), ('a card 0 at the near clip was refused', clip) + b = _toy(dists=(698.9, 15000.0, 50000.0), amp=0.0); ridge.NEAR_CLIP_M = 700.0; _refuses(d + '/under', b, export.pack(b), 'a card 0 under the near clip was written') + finally: ridge.NEAR_CLIP_M = saved; shutil.rmtree(d) +def test_set_view_keeps_the_ground_rows_under_the_horizon(): + """A skyline +28 degrees high and +5 low is compressed below 1x so the horizon sits at row 450 or above (GROUND_ROWS_MIN rows under it); one +60 degrees high cannot hold them even at 0.5x and refuses naming sky_deg and the floor; a Vienna-like skyline + (the 10x clamp) and one that fits its anchors above 1x are unchanged to 1e-9; a low skyline never binds the horizon.""" + assert ridge.GROUND_ROWS_MIN == 150 and ridge.E_MIN == 0.5 and ridge.NEAR_CLIP_M == 500.0, 'the authored constants are pinned' + sk = np.full(W, 5.0); sk[100] = 28.0; v = ridge.set_view(sk) + assert v['horizon_row'] <= H - ridge.GROUND_ROWS_MIN + 1e-6 and v['exaggeration'] < 1 and v['binds'] == 'horizon' and abs(v['horizon_row'] - (H - ridge.GROUND_ROWS_MIN)) < 1e-6 and abs(v['px_per_deg'] - (H - 150 - 0.04 * H) / 28.0) < 1e-9, v + sk = np.full(W, 5.0); sk[100] = 60.0 + try: ridge.set_view(sk) + except ValueError as e: assert '60.00' in str(e) and '8.89' in str(e) and '0.5x' in str(e), str(e) + else: assert False, 'a skyline that cannot hold the ground rows was accepted' + sk = np.full(W, 1.7); sk[7] = 2.0; v = ridge.set_view(sk); assert abs(v['px_per_deg'] - 10 * ridge.HPX_DEG) < 1e-9 and abs(v['horizon_row'] - (2.0 * 10 * ridge.HPX_DEG + 0.04 * H)) < 1e-9 and v['binds'] == 'ceiling', v + sk = np.full(W, 1.0); sk[7] = 3.0; sk[9] = -1.0; v = ridge.set_view(sk); assert abs(v['px_per_deg'] - 0.62 * H / 4.0) < 1e-9 and v['binds'] == 'skyline', v + sk = np.full(W, -30.0); sk[7] = 12.0; v = ridge.set_view(sk); assert abs(v['px_per_deg'] - 0.5 * ridge.HPX_DEG) < 1e-9 and v['binds'] == 'floor', v + sk = np.full(W, -9.0); sk[7] = -2.0; v = ridge.set_view(sk); assert v['horizon_row'] < 0.04 * H and v['binds'] != 'horizon', v +def test_the_near_clip_and_the_ground_rows_are_refused_at_the_writer(): + """The march starts at the authored near clip; write_bake refuses a bake whose card 0 stands nearer than it (nothing nearer is baked as terrain), and validate_manifest, which the writer and the committed bakes go through, refuses a plane with fewer than GROUND_ROWS_MIN rows under the horizon and accepts exactly that many.""" + assert D[0] == ridge.NEAR_CLIP_M == ridge.schedule(True)[0] and (np.diff(D) > 0).all(), 'the march does not start at the near clip' + d = tempfile.mkdtemp() + try: + b = _toy(); pk = export.pack(b); near = export.pack(_toy(dists=(300.0, 15000.0, 50000.0))); assert near['report']['nearest_m'] < ridge.NEAR_CLIP_M + try: _write(d + '/near', b, near) + except ValueError as e: assert 'near clip' in str(e), str(e); assert not os.path.exists(d + '/near') + else: assert False, 'a bake whose card 0 stands inside the near clip was written' + _refuses(d + '/short', b, pk, 'a plane with 149 rows under the horizon was written', view=dict(b['view'], horizon_row=451.0)); dest = _write(d + '/ok', b, pk, view=dict(b['view'], horizon_row=450.0)); m = json.load(open(dest / 'manifest.json')); export.validate_manifest(m) + m['view']['horizon_row'] = 450.5 + try: export.validate_manifest(m) + except ValueError as e: assert 'GROUND_ROWS_MIN' in str(e), str(e) + else: assert False, 'validate_manifest accepted a short plane' + finally: shutil.rmtree(d) # ---------------------------------------------------------------------------------------- rules that no other test touched def test_seams_keep_their_separation(): """Two authored targets closer than SEAM_SEP (6 and 7 km, 0.15 nat): the seams still sit at least 0.4 nat apart in every column.""" @@ -529,7 +607,7 @@ def test_cards_interpolate_between_samples_and_renormalise(): that is not renormalised, or a hit that is not interpolated, differs).""" A, Hh = rays(terrain(lambda dk, az: np.where(dk >= 4000, GROUND + 0.5 * (dk - 4000), 0.0) + 0 * az)); ridge.P.update(eye_m=EYE); ridge.set_view(A.max(0)); aw, hw = _w(A), _w(Hh); k = np.arange(len(D))[:, None] nr = np.broadcast_to(np.where(k % 2 == 0, -0.8, 0.8), aw.shape).astype(float); nt = np.broadcast_to(np.where(k % 3 == 0, 0.3, -0.3), aw.shape).astype(float); nu = np.sqrt(1 - nr ** 2 - nt ** 2) * 0 + 0.5 - c = ridge.cards(D, aw, hw, np.zeros((0, NW)), nrm=(nr, nt, nu))[0]; x = 300; sel = np.flatnonzero(c['alpha'][:, x] > 0.999); ld = c['logd'][sel, x].astype(np.float64); L = np.log(D); kk = np.searchsorted(L, ld, 'left'); kp = kk - 1; ok = kp >= 0 + c = ridge.cards(D, aw, hw, np.zeros((0, NW)), nrm=(nr, nt, nu), skirt=_w(ridge.skirt_height(Hh)))[0]; x = 300; sel = np.flatnonzero(c['alpha'][:, x] > 0.999); ld = c['logd'][sel, x].astype(np.float64); L = np.log(D); kk = np.searchsorted(L, ld, 'left'); kp = kk - 1; ok = kp >= 0 t = (ld - L[np.maximum(kp, 0)]) / (L[kk] - L[np.maximum(kp, 0)]); inner = ok & (t > 0.02) & (t < 0.98); assert inner.sum() > 0.3 * len(sel), ('hits sit on samples, not between them', int(inner.sum()), len(sel)) mix = lambda arr: arr[np.maximum(kp, 0), x] + t * (arr[kk, x] - arr[np.maximum(kp, 0), x]); m = np.sqrt(mix(nr) ** 2 + mix(nt) ** 2 + mix(nu) ** 2); er = np.abs(c['n_r'][sel, x] - mix(nr) / m)[inner]; et = np.abs(c['n_t'][sel, x] - mix(nt) / m)[inner] assert er.max() < 1e-3 and et.max() < 1e-3, ('the normal is not the normalised blend of the two samples', er.max(), et.max()) diff --git a/src/app/features/scene/ridge/Ridge.test.ts b/src/app/features/scene/ridge/Ridge.test.ts index 1f462a5e..2018a2e0 100644 --- a/src/app/features/scene/ridge/Ridge.test.ts +++ b/src/app/features/scene/ridge/Ridge.test.ts @@ -1443,7 +1443,10 @@ describe('the ridge cards in the scene', () => { const s = sab / sbb; return (Math.max(...a.map((y, i) => Math.abs(y - (mean + s * b[i])))) * 180) / Math.PI * vienna.view.pxPerDegH; }; - const distances = vienna.tiles.flatMap((row) => row.flatMap((e) => (e ? [e.distanceM] : []))); + // The baker holds r_max for the NEAREST solid terrain each card draws in each tile, not its median distance_m (export.py pack); the manifest carries only the median. + // Vienna's nearest solid pixel is 500.4523 m (the baker's report, in every card 0 tile terrain stands at the 500 m near clip to within a metre), so that is the distance that binds, beside the medians. + const NEAREST_TERRAIN_M = 500.4523; + const distances = [NEAREST_TERRAIN_M, ...vienna.tiles.flatMap((row) => row.flatMap((e) => (e ? [e.distanceM] : [])))]; /** The worst of every card of the bake at the camera angle `phiDeg` and offset `r`. */ const worstPx = (r: number, phiDeg: number): number => Math.max(...distances.map((d) => fitPx(d, r, phiDeg))); /** The same over the six nearest cards and 129 samples (the trapezoid rule is exact to a few thousandths of a pixel there): the nearest cards bind, and a property run asks it thousands of times. */ @@ -1492,7 +1495,7 @@ describe('the ridge cards in the scene', () => { it('measures the fit as the baker does: Vienna sits at the bound at its two offsets, and above it past them', () => { const { rMaxM, rMaxForwardM } = vienna.camera; - expect([rMaxM, rMaxForwardM]).toEqual([95.8, 198.4]); + expect([rMaxM, rMaxForwardM]).toEqual([95.9, 198.6]); const circle = Array.from({ length: 24 }, (_, i) => i * 15); expect(Math.max(...circle.map((phi) => worstPx(rMaxM, phi)))).toBeGreaterThan(FIT_PX_MAX - 0.5); expect(Math.max(...circle.map((phi) => worstPx(rMaxM, phi)))).toBeLessThanOrEqual(FIT_PX_MAX + 0.05); diff --git a/src/app/features/scene/ridge/manifest.test.ts b/src/app/features/scene/ridge/manifest.test.ts index 2ac2e85c..de49fe37 100644 --- a/src/app/features/scene/ridge/manifest.test.ts +++ b/src/app/features/scene/ridge/manifest.test.ts @@ -99,6 +99,14 @@ describe('parseManifest', () => { expect(parseManifest({ ...w, place: { ...w.place, tz: 'Asia/Kathmandu' } }, '/').view.place.tz).toBe('Asia/Kathmandu'); }); + it('refuses a plane that leaves fewer rows under the horizon than the runtime needs to reach the viewport bottom, and takes exactly that many', () => { + const w = wireManifest() as any; + const at = (row: number) => ({ ...w, view: { ...w.view, horizon_row: row } }); + expect(() => parseManifest(at(451), '/')).toThrow(/short plane.*150/); + expect(parseManifest(at(450), '/').view.horizonRow).toBe(450); + expect(parseManifest(at(357), '/').view.horizonRow).toBe(357); + }); + it('never echoes a value it refused', () => { const w = wireManifest() as any; const refusal = (bad: unknown) => { diff --git a/src/app/features/scene/ridge/manifest.ts b/src/app/features/scene/ridge/manifest.ts index a54deb2b..beab1241 100644 --- a/src/app/features/scene/ridge/manifest.ts +++ b/src/app/features/scene/ridge/manifest.ts @@ -2,7 +2,7 @@ // contract) and the page; no daemon state. Main-chunk safe: types, a parser and fetch only. Wire names are snake_case; the parsed manifest is // camelCase and its `view` is the View (`view.ts`) the sky and the cards share. Schema 3: the whole 360 degree ring, K G-buffer cards cut into // azimuth tiles, each tile two files. -import type { View } from './view'; +import { groundRowsNeeded, type View } from './view'; /** As export.py MAX_CARDS: the decode budget holds this many. */ export const MAX_CARDS = 6; @@ -103,6 +103,14 @@ export function parseManifest(raw: unknown, dir: string): RidgeManifest { if (!Number.isInteger(tiles) || tiles < 1) fail('view.tiles', 'not a count'); if (ringW !== tiles * tileW) fail('view.ring_w', 'is not tiles x tile_w'); const planeH = num(v.plane_h, 'view.plane_h'); + const horizonRow = num(v.horizon_row, 'view.horizon_row'); + const ground = groundRowsNeeded(planeH); + if (planeH - horizonRow < ground - 1e-6) { + fail( + 'view.horizon_row', + `short plane: ${(planeH - horizonRow).toFixed(1)} rows under the horizon, the runtime needs ${Math.round(ground)} to reach the viewport bottom (the baker refuses such a bake: rebake the place)` + ); + } if (!Array.isArray(r.cards) || r.cards.length < 1) fail('cards', 'none'); const k = (r.cards as unknown[]).length; if (k > MAX_CARDS) fail('cards', `more than ${MAX_CARDS}`); @@ -169,7 +177,7 @@ export function parseManifest(raw: unknown, dir: string): RidgeManifest { planeH, pxPerDegH: num(v.px_per_deg_h, 'view.px_per_deg_h'), pxPerDegV: num(v.px_per_deg_v, 'view.px_per_deg_v'), - horizonRow: num(v.horizon_row, 'view.horizon_row'), + horizonRow, }, encoding: { logDMin, logDMax }, camera: { rMaxM, rMaxForwardM }, diff --git a/src/app/features/scene/ridge/ridgeAssets.test.ts b/src/app/features/scene/ridge/ridgeAssets.test.ts index 2795285c..4fe5436f 100644 --- a/src/app/features/scene/ridge/ridgeAssets.test.ts +++ b/src/app/features/scene/ridge/ridgeAssets.test.ts @@ -10,12 +10,14 @@ import { join, sep } from 'node:path'; import { describe, expect, it } from 'vitest'; import { MAX_CARDS, parseIndex, parseManifest } from './manifest'; import { runTiles } from './ring'; -import { HFOV_MAX_DEG } from './view'; +import { groundRowsNeeded, HFOV_MAX_DEG } from './view'; /** The same constants as scripts/ridge-bake/export.py. */ export const TILE_BYTES_MAX = 235_000; export const PLACE_BYTES_MAX = 7_500_000; export const RESIDENT_BYTES_MAX = 20_000_000; +/** As ridge.py NEAR_CLIP_M: the march's first sample, so no terrain is nearer. */ +export const NEAR_CLIP_M = 500; interface WireFile { file: string; @@ -31,7 +33,7 @@ interface WireTile { export interface WireManifest { schema: number; bake_id: string; - view: { ring_w: number; tile_w: number; tiles: number; apron: number }; + view: { ring_w: number; tile_w: number; tiles: number; apron: number; plane_h: number; horizon_row: number }; camera: { r_max_m: number; r_max_forward_m: number }; cards: unknown[]; tiles: (WireTile | null)[][]; @@ -198,6 +200,11 @@ describe('the committed ridge assets', () => { expect(residentBytes(raw).n).toBeLessThanOrEqual(raw.view.tiles); }); + it('keeps the ground rows the runtime needs under the horizon and nothing nearer than the near clip: card 0 stands at or beyond 500 m in every tile', () => { + expect(raw.view.plane_h - raw.view.horizon_row).toBeGreaterThanOrEqual(groundRowsNeeded(raw.view.plane_h) - 1e-6); + raw.tiles.forEach((row) => row[0] && expect(row[0].distance_m).toBeGreaterThanOrEqual(NEAR_CLIP_M)); + }); + it('carries the offset bound and a distance for every tile a card holds', () => { expect(raw.camera.r_max_m).toBeGreaterThan(0); expect(raw.camera.r_max_forward_m).toBeGreaterThanOrEqual(raw.camera.r_max_m); @@ -275,7 +282,7 @@ describe('sizeGate', () => { const ring = (tiles: number, perTile: number, h = 100, cards = 1): WireManifest => ({ schema: 3, bake_id: 'x', - view: { ring_w: 6400, tile_w: 6400 / tiles, tiles, apron: 2 }, + view: { ring_w: 6400, tile_w: 6400 / tiles, tiles, apron: 2, plane_h: 600, horizon_row: 357 }, camera: { r_max_m: 50, r_max_forward_m: 50 }, cards: Array.from({ length: cards }, () => ({})), tiles: Array.from({ length: tiles }, () => diff --git a/src/app/features/scene/ridge/view.test.ts b/src/app/features/scene/ridge/view.test.ts index d7ceb382..ae3c7f3c 100644 --- a/src/app/features/scene/ridge/view.test.ts +++ b/src/app/features/scene/ridge/view.test.ts @@ -3,6 +3,7 @@ import { cardArc, cardPose, FALLBACK_VIEW, + groundRowsNeeded, HFOV_MAX_DEG, HORIZON_AT, maxSpeed, @@ -198,24 +199,49 @@ describe('offsetRange', () => { }); it('gives up part of its backward half where the nearest card shrunk by R / (R + r) would lift its foot above the viewport bottom, and all of it past that', () => { - // 1920 x 1080: keep = (1 - HORIZON_AT) 1080 / (scale (planeH - horizonRow)). Put the horizon row so that keep is 0.95, and the nearest card is 1000 m away. - const scale = windowFor(manifest.view, 1920, 1080).plane.scale; - const near = withView({ horizon_row: 600 - (0.15 * 1080) / 0.95 / scale }); - const win = windowFor(near.view, 1920, 1080); + // A phone, 390 x 844, where the plane is only as tall as the band needs: keep = (1 - HORIZON_AT) 844 / (scale (planeH - horizonRow)). Put the horizon row so that keep is 0.95 (158 rows under it, above the 150 the manifest guarantees), and the nearest card is 1000 m away. + const scale = windowFor(manifest.view, 390, 844).plane.scale; + const near = withView({ horizon_row: 600 - (0.15 * 844) / 0.95 / scale }); + const win = windowFor(near.view, 390, 844); const [lo, hi] = offsetRange(near, win, 'both'); expect(hi).toBe(180); expect(lo).toBeCloseTo(-1000 * (1 / 0.95 - 1), 6); // At that offset the card's foot is exactly at the viewport bottom. const s = 1000 / (1000 - lo); - expect(s * win.plane.scale * (near.view.planeH - near.view.horizonRow)).toBeCloseTo(0.15 * 1080, 6); - const none = withView({ horizon_row: 599 }); - expect(offsetRange(none, windowFor(none.view, 1920, 1080), 'both')).toEqual([-0, 180]); + expect(s * win.plane.scale * (near.view.planeH - near.view.horizonRow)).toBeCloseTo(0.15 * 844, 6); + // A plane with exactly the ground rows the manifest guarantees (keep 1): the backward bound is 0 from the same formula, with no case of its own. + const exact = withView({ horizon_row: 600 - groundRowsNeeded(600) }); + const [elo, ehi] = offsetRange(exact, windowFor(exact.view, 390, 844), 'both'); + expect(elo).toBeCloseTo(0, 9); + expect(ehi).toBe(180); + }); + + it('on a desktop viewport, where the width binds the scale and keep is well under 1, the backward offset stops where the nearest card shrunk by R / (R + r) lifts its foot to the bottom edge', () => { + // 1920 x 1080 with the ground rows the manifest guarantees: scale 1.65 (the width term), so keep = 0.15 x 1080 / (1.65 x 150) = 0.65, far under the 0.75 a clamped keep would stop at. The bake's r_max is made large enough that the foot, not r_max, binds. + const wide = parseManifest(wireManifest({ view: { ...(wireManifest().view as object), horizon_row: 450 }, camera: { r_max_m: 600, r_max_forward_m: 700 } }), '/d/'); + const win = windowFor(wide.view, 1920, 1080); + const keep = (0.15 * 1080) / (win.plane.scale * 150); + expect(keep).toBeGreaterThan(0.6); + expect(keep).toBeLessThan(0.7); + const [lo, hi] = offsetRange(wide, win, 'both'); + expect(lo).toBeCloseTo(-1000 * (1 / keep - 1), 6); // about -538 m + expect(-lo).toBeLessThan(600); + expect(hi).toBe(700); + expect(offsetRange(wide, win, 'offset')).toEqual([lo, -lo]); + }); + + it('reads the ground rows from the runtime constants: 150 of 600, so the plane reaches the bottom of every viewport at rest', () => { + expect(groundRowsNeeded(600)).toBeCloseTo(150, 9); + const exact = withView({ horizon_row: 600 - groundRowsNeeded(600) }); + for (const [w, h] of VIEWPORTS) { + expect(windowFor(exact.view, w, h).plane.bottom).toBeLessThanOrEqual(1e-9); + } }); it('gives up the same part of its forward half in the offset-only mode: the camera circles round to phi 180 and the nearest card shrinks as it does for a backward offset', () => { - const scale = windowFor(manifest.view, 1920, 1080).plane.scale; - const near = withView({ horizon_row: 600 - (0.15 * 1080) / 0.95 / scale }); - const win = windowFor(near.view, 1920, 1080); + const scale = windowFor(manifest.view, 390, 844).plane.scale; + const near = withView({ horizon_row: 600 - (0.15 * 844) / 0.95 / scale }); + const win = windowFor(near.view, 390, 844); const [lo, hi] = offsetRange(near, win, 'offset'); expect(hi).toBeCloseTo(1000 * (1 / 0.95 - 1), 6); expect(lo).toBe(-hi); @@ -223,8 +249,10 @@ describe('offsetRange', () => { const R = 1000; const p = cardPose(near, 0, near.view.lookAzDeg, 180, hi, win); expect(Math.abs(p.scale - R / (R + hi))).toBeLessThan(0.02); // the fitted line is within a hair of the tangent the clamp uses - const none = withView({ horizon_row: 599 }); - expect(offsetRange(none, windowFor(none.view, 1920, 1080), 'offset')).toEqual([-0, 0]); + const exact = withView({ horizon_row: 600 - groundRowsNeeded(600) }); + const [elo, ehi] = offsetRange(exact, windowFor(exact.view, 390, 844), 'offset'); + expect(elo).toBeCloseTo(0, 9); + expect(ehi).toBeCloseTo(0, 9); }); }); diff --git a/src/app/features/scene/ridge/view.ts b/src/app/features/scene/ridge/view.ts index 7dbd6429..a750b565 100644 --- a/src/app/features/scene/ridge/view.ts +++ b/src/app/features/scene/ridge/view.ts @@ -77,6 +77,12 @@ export const HFOV_MAX_DEG = 72 / 1.1; * the near plain is cropped. 0.85 (operator, 2026-11-20) shows about 31 degrees of sky above the horizon in a 16:9 cell. Authored, tunable by eye. */ export const HORIZON_AT = 0.85; +/** + * The rows a plane of `planeH` rows must keep under its horizon row so that at the smallest scale a viewport takes (the plane's height is at least `RIDGE_BAND_FRAC` + * of the viewport) it still reaches the viewport bottom: (1 - HORIZON_AT) planeH / RIDGE_BAND_FRAC, 150 of 600 rows. The baker refuses a bake with fewer + * (export.py GROUND_ROWS_MIN) and `parseManifest` refuses one that slipped through, so `offsetRange` need not handle a plane that stops short. + */ +export const groundRowsNeeded = (planeH: number): number => ((1 - HORIZON_AT) * planeH) / RIDGE_BAND_FRAC; export interface Window { camera: Camera; @@ -119,8 +125,9 @@ const onHeading = (mode: RotationMode, phiDeg: number): boolean => * the camera on its heading (modes 'still' and 'both', `phi` 0) a forward offset goes to the bake's `rMaxForwardM`, the largest every card fits at phi 0; * everywhere else (the offset-only mode swings the camera round the whole circle, and a backward offset at phi 0 is the camera at phi 180) the bound is * `rMaxM`, the worst over every phi. The nearest card, shrunk by R / (R + r) about the horizon, would lift its foot above the viewport bottom and show the - * sky under it past the point where `1 / keep - 1` of its distance is the offset: the baker's nearest-card-off-the-bottom refusal as a clamp, applied to - * every position the camera can reach at the offset's sign (backward always, forward too where the circle takes it round to phi 180). + * sky under it past the point where `1 / keep - 1` of its distance is the offset: applied to every position the camera can reach at the offset's sign + * (backward always, forward too where the circle takes it round to phi 180). The manifest guarantees `keep <= 1` (`groundRowsNeeded`: the plane reaches the + * viewport bottom at rest), so the formula needs no case for a plane that stops short; at `keep` 1 it gives 0. */ export function offsetRange( manifest: RidgeManifest, @@ -132,7 +139,7 @@ export function offsetRange( const { planeH, horizonRow } = manifest.view; const below = win.plane.scale * (planeH - horizonRow); const keep = 1 + win.plane.bottom / below; // the smallest scale at which the foot stays under the viewport bottom - const foot = keep >= 1 ? 0 : nearestM(manifest) * (1 / keep - 1); + const foot = Math.max(0, nearestM(manifest) * (1 / keep - 1)); // the max only absorbs the rounding of a keep that is 1 to the last bit const back = Math.min(rMaxM, foot); return onHeading(mode, phiDeg) ? [-back, rMaxForwardM] : [-back, back]; }