Site: isometric blocks in SVG with an outline under the faces; separating-axis draw order

This commit is contained in:
ZacharyZhang-NY committed 2026-10-08 23:07:10 -04:00
1 parent 01397eb1e5
commit 623554fa77
5 files changed
+150 -83

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# ElyDoc: type into the brief, bold a word, zoom in.
source "$(dirname "$0")/lib.sh"
us_input
launch ely-doc "$demo/Field Guide Brief.docx"
wait_log "lok: first tile drawn" 60
wait_log "doc: 3 headings"
front
sleep 3
snap doc-before
# The page's left edge, past the outline column.
page=$(first_bright doc-before 600 252 225)
x=$((win_x + page))
y=$win_y
read -r zx zy < <(where "title=zoom-in")
record_start doc
pause 1.0
mouse click $((x + 720)) $((y + 392))
pause 0.5
typed " Every route also gets a printable offline map."
pause 0.8
mouse double $((x + 243)) $((y + 351))
pause 0.5
keys 'keystroke "b" using command down'
pause 1.0
mouse click "$zx" "$zy"
pause 0.6
mouse move $((x + 760)) $((y + 640)) 0.7
pause 2.0
record_stop doc
+28 -2
View File
@@ -74,7 +74,14 @@ wait_ax() {
# Center of the first AX element whose line has $1, as "x y".
where() {
"$bin/ax-values" "$app_pid" | grep -F -- "$1" | grep -oE 'at=[0-9]+,[0-9]+' | head -n 1 | sed 's/at=//; s/,/ /'
local i at
for i in $(seq 20); do
at=$("$bin/ax-values" "$app_pid" | grep -F -- "$1" | grep -oE 'at=[0-9]+,[0-9]+' | head -n 1 | sed 's/at=//; s/,/ /' || true)
[ -n "$at" ] && { echo "$at"; return 0; }
sleep 0.25
done
echo "no AX element: $1" >&2
return 1
}
front() {
@@ -114,13 +121,32 @@ function run(argv) {
JS
}
# Saves the window as $1.png in the check folder.
snap() {
local id
id=$("$root/tests/scripts/shot.sh" --id "$app_pid")
screencapture -x -o -l"$id" "$check/$1.png"
}
# First x (points, window-relative) on row $2 brighter than $3.
first_bright() {
python3 - "$check/$1.png" "$2" "$3" "${4:-0}" <<'PY'
import sys
from PIL import Image
im = Image.open(sys.argv[1]).convert("L")
scale = im.size[0] / 1600
y, level, start = int(float(sys.argv[2]) * scale), int(sys.argv[3]), int(float(sys.argv[4]) * scale)
print(next(round(x / scale) for x in range(start, im.size[0]) if im.getpixel((x, y)) >= level))
PY
}
# Starts capturing the window region of the main screen.
record_start() {
local x y w h
read -r x y w h < <(frame)
[ "$w" = "$win_w" ] && [ "$h" = "$win_h" ] || echo "note: window is ${w}x${h}, not ${win_w}x${win_h}" >&2
rm -f "$out/rec/$1.mov"
ffmpeg -hide_banner -loglevel error -f avfoundation -capture_cursor 1 -framerate 60 -i "0:none" \
ffmpeg -hide_banner -loglevel error -f avfoundation -capture_cursor 1 -framerate 60 -pixel_format nv12 -i "0:none" \
-vf "crop=$((w * 2)):$((h * 2)):$((x * 2)):$((y * 2))" -c:v h264_videotoolbox -b:v 80M -r 60 \
"$out/rec/$1.mov" </dev/null &
cap_pid=$!