Repository navigation
Fix around_player arc + finer dribble line (reference-driven) - #17
Merged
Merged
Conversation
…nce-driven) Tuned against a real coaching drill PDF (3-man Fastbreak): - around_player: arc distances are now player-radius-relative (symbol radius 0.5 + gap: tight~0.85 / normal~1.2 / wide~1.7) so the detour clears the player instead of cutting through the symbol; and the single waypoint becomes a rounded 3-point arc (approach, apex beside the player on the chosen side, exit) that keeps the overall heading — no more kink or brushing through the player. - dribble line: smaller, more regular waves (amplitude 0.4->0.22, wavelength 1.8->1.1) so it reads as a dribble texture along the path, not a big serpentine. Adds a dev screenshot helper (scripts/shoot-fixture.mjs) for reference-driven tuning, and the around-player-arc fixture. Visual baselines updated. 149 tests pass; tsc clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| const server = createServer((req, res) => { | ||
| const urlPath = decodeURIComponent(req.url.split("?")[0]); | ||
| const filePath = join(root, urlPath); | ||
| if (!existsSync(filePath)) { res.writeHead(404); res.end("not found"); return; } |
| const filePath = join(root, urlPath); | ||
| if (!existsSync(filePath)) { res.writeHead(404); res.end("not found"); return; } | ||
| res.writeHead(200, { "Content-Type": MIME[extname(filePath)] ?? "application/octet-stream" }); | ||
| res.end(readFileSync(filePath)); |
Reference-checked against the drill PDFs (Outlet, Pick&Roll, 2-man Fastbreak): 0.22/1.1 read a touch too faint/tight; 0.3/0.9 gives clearer, regular zig-zag crests that match how the reference tools draw dribbles. Visual baselines updated.
CodeQL flagged 'uncontrolled data used in path expression' (High): the dev screenshot server built the file path from the request URL and read it, so a crafted ../ path could escape the served root. Resolve within root and reject any resolved path that falls outside it. Verified: legit paths serve, traversal attempts get 403, rendering still works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the two rendering problems seen on the live Try-it page, tuned against a real coaching drill PDF (3-man Fastbreak) as the reference.
Problem (from screenshots)
around_playerbroken — the cut ran through the player and brushed past with an unnatural flat kink, because the single detour waypoint sat ~0.35–0.9 court units from the obstacle centre while the player symbol radius is 0.5 (sotightlanded inside the symbol).Fix
around_player — clear the player, round the corner:
tight ≈ 0.85,normal ≈ 1.2,wide ≈ 1.7(symbol radius 0.5 + a per-arc gap), so the detour actually clears the player.dribble line — a texture, not a serpentine:
0.4 → 0.22, wavelength1.8 → 1.1: small, regular waves along the path, matching how coaching tools draw dribbles.Before / after
Verified with rendered screenshots: the curl-around-a-screen cut now arcs cleanly around the player (was: straight through it), and the 3v2 dribble reads as a fine dribble (was: giant waves).
Also
scripts/shoot-fixture.mjs— a dev helper to render any fixture to a PNG for reference-driven tuning (screenshots are gitignored).around-player-arcfixture; updates the visual snapshot baselines.tsc --noEmitclean.Leaving the merge to you. The site auto-picks this up once it's released (0.5.0) via the sync-tool-version automation — or bump the pin manually.
🤖 Generated with Claude Code