From d58f30a42aee9b686383c08743166991d005dacf Mon Sep 17 00:00:00 2001 From: "vercel-gh-bot-2[bot]" <282331341+vercel-gh-bot-2[bot]@users.noreply.github.com> Date: Thu, 6 Aug 2026 12:31:51 +0000 Subject: [PATCH] chore(docs): remove orphaned shader checks Co-authored-by: ruiconti <1834568+ruiconti@users.noreply.github.com> --- apps/docs/scripts/check-eve-mobile-motion.ts | 51 ------- apps/docs/scripts/check-eve-paint-mapping.ts | 137 ------------------- 2 files changed, 188 deletions(-) delete mode 100644 apps/docs/scripts/check-eve-mobile-motion.ts delete mode 100644 apps/docs/scripts/check-eve-paint-mapping.ts diff --git a/apps/docs/scripts/check-eve-mobile-motion.ts b/apps/docs/scripts/check-eve-mobile-motion.ts deleted file mode 100644 index c2b533d0b..000000000 --- a/apps/docs/scripts/check-eve-mobile-motion.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { strict as assert } from "node:assert"; -import { - MOBILE_AUTO_ROTATE_SPEED, - evePointerInteractionMode, - mobileAutoEnvYaw, -} from "../app/[lang]/(home)/components/eve-logo-shader/mobile-motion"; - -const coarse = evePointerInteractionMode(true); -assert.equal(coarse.paintEnabled, false, "coarse pointer must disable paint"); -assert.equal(coarse.autoRotateEnvYaw, true, "coarse pointer must enable auto env yaw"); - -const fine = evePointerInteractionMode(false); -assert.equal(fine.paintEnabled, true, "fine pointer must keep paint enabled"); -assert.equal(fine.autoRotateEnvYaw, false, "fine pointer must keep pointer-driven env yaw"); - -assertAlmost(mobileAutoEnvYaw(0), 0, "yaw at t=0"); -assertAlmost(mobileAutoEnvYaw(10), 1.5, "yaw at t=10s"); -assertAlmost(mobileAutoEnvYaw(21), 3.15, "yaw at t=21s"); -assertAlmost( - mobileAutoEnvYaw(3600), - MOBILE_AUTO_ROTATE_SPEED * 3600, - "yaw after 1h remains unwrapped", -); -assert(mobileAutoEnvYaw(3600) > Math.PI * 2, "auto yaw must be monotonic and unwrapped"); - -console.log( - JSON.stringify( - { - ok: true, - speedRadPerSecond: MOBILE_AUTO_ROTATE_SPEED, - coarse, - fine, - yawSamples: { - t0: round(mobileAutoEnvYaw(0)), - t10: round(mobileAutoEnvYaw(10)), - t21: round(mobileAutoEnvYaw(21)), - t3600: round(mobileAutoEnvYaw(3600)), - }, - }, - null, - 2, - ), -); - -function assertAlmost(actual: number, expected: number, label: string) { - assert(Math.abs(actual - expected) < 1e-9, `${label}: expected ${expected}, received ${actual}`); -} - -function round(value: number) { - return Number(value.toFixed(6)); -} diff --git a/apps/docs/scripts/check-eve-paint-mapping.ts b/apps/docs/scripts/check-eve-paint-mapping.ts deleted file mode 100644 index 5bea6dbd3..000000000 --- a/apps/docs/scripts/check-eve-paint-mapping.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { strict as assert } from "node:assert"; -import { - DEFAULT_CAMERA_FOV, - BLOOM_RADIUS, - cameraRadiusForFov, - DEFAULT_IMPRINT_DEVICE_PIXEL_RATIO, - DEFAULT_IMPRINT_GRID_SCALE_MULTIPLIER, - mapClientPointToPaintCell, - type Bounds, - type RenderControls, -} from "../app/[lang]/(home)/components/eve-logo-shader/render"; - -const bounds: Bounds = { - min: [-0.039000000804662704, -0.01188180036842823, -0.0020000000949949026], - max: [0.03870119899511337, 0.012500000186264515, 0.0020000000949949026], -}; -const controls: Pick = { - yaw: 0, - pitch: 0, - radius: cameraRadiusForFov(DEFAULT_CAMERA_FOV), - fov: DEFAULT_CAMERA_FOV, -}; -const rect = { left: 10, top: 20, width: 563.5, height: 190 }; -const devicePixelRatio = DEFAULT_IMPRINT_DEVICE_PIXEL_RATIO; -const canvasWidth = Math.floor(rect.width * devicePixelRatio); -const canvasHeight = Math.floor(rect.height * devicePixelRatio); -const logicalWidth = canvasWidth - BLOOM_RADIUS * 2; -const logicalHeight = canvasHeight - BLOOM_RADIUS * 2; -const gridScaleMultiplier = DEFAULT_IMPRINT_GRID_SCALE_MULTIPLIER; - -const center = mapClientPointToPaintCell({ - clientX: rect.left + rect.width / 2, - clientY: rect.top + rect.height / 2, - rect, - canvasWidth, - canvasHeight, - logicalWidth, - logicalHeight, - controls, - meshBounds: bounds, - gridScaleMultiplier, - devicePixelRatio, -}); -assert(center); -assert.equal(center.insideLogicalBounds, true); -assert.deepEqual(center.originCell, [-21, -7]); -assertAlmost(center.physical[0], 563.5, "center physical x"); -assertAlmost(center.physical[1], 190, "center physical y"); -assertAlmost(center.logical[0], 547.5, "center logical x"); -assertAlmost(center.logical[1], 174, "center logical y"); -assertAlmost(center.model[0], 0, "center model x"); -assertAlmost(center.model[1], 0, "center model y"); -assertAlmost(center.brushCell[0], 21, "center cell x"); -assertAlmost(center.brushCell[1], 7, "center cell y"); - -const dpr1SameBuffer = mapClientPointToPaintCell({ - clientX: rect.left + rect.width / 2, - clientY: rect.top + rect.height / 2, - rect, - canvasWidth, - canvasHeight, - logicalWidth, - logicalHeight, - controls, - meshBounds: bounds, - gridScaleMultiplier, - devicePixelRatio: 1, -}); -assert(dpr1SameBuffer); -assert.equal(dpr1SameBuffer.insideLogicalBounds, true); -assertAlmost(dpr1SameBuffer.gridScale, center.gridScale * 2, "dpr1 same-buffer grid scale doubles"); -assertAlmost( - dpr1SameBuffer.brushCell[0] - dpr1SameBuffer.originCell[0], - (center.brushCell[0] - center.originCell[0]) * 2, - "dpr1 same-buffer center lattice coordinate doubles", -); - -const leftEdgeClientX = rect.left + (BLOOM_RADIUS * rect.width) / canvasWidth; -const leftOfOrigin = mapClientPointToPaintCell({ - clientX: leftEdgeClientX, - clientY: rect.top + rect.height / 2, - rect, - canvasWidth, - canvasHeight, - logicalWidth, - logicalHeight, - controls, - meshBounds: bounds, - gridScaleMultiplier, - devicePixelRatio, -}); -assert(leftOfOrigin); -assert.equal(leftOfOrigin.insideLogicalBounds, true); -assert.deepEqual(leftOfOrigin.originCell, [-21, -7]); -assert(leftOfOrigin.model[0] < 0, "left case is in negative model X"); -assert(leftOfOrigin.brushCell[0] < 0, "originCell offset preserves negative/out-of-grid cell X"); -assertAlmost(leftOfOrigin.logical[0], 0, "left logical x"); -assertAlmost(leftOfOrigin.brushCell[0], -3.2953125, "left cell x"); -assertAlmost(leftOfOrigin.brushCell[1], 7, "left cell y"); - -console.log( - JSON.stringify( - { - ok: true, - center: summarize(center), - leftOfOrigin: summarize(leftOfOrigin), - dpr1SameBuffer: summarize(dpr1SameBuffer), - }, - null, - 2, - ), -); - -function summarize(mapping: NonNullable>) { - return { - physical: roundPair(mapping.physical), - logical: roundPair(mapping.logical), - model: roundPair(mapping.model), - brushCell: roundPair(mapping.brushCell), - originCell: mapping.originCell, - gridScale: round(mapping.gridScale), - pxPerModelUnit: round(mapping.pxPerModelUnit), - insideLogicalBounds: mapping.insideLogicalBounds, - }; -} - -function roundPair(pair: readonly [number, number]) { - return [round(pair[0]), round(pair[1])] as const; -} - -function round(value: number) { - return Number(value.toFixed(6)); -} - -function assertAlmost(actual: number, expected: number, label: string) { - assert(Math.abs(actual - expected) < 1e-6, `${label}: expected ${expected}, received ${actual}`); -}