README demo for 0.6: a Raspberry Pi 4 case (#504)
Replace the 0.2.1 enclosure recording with a 40 s take of the current desktop UI building a Raspberry Pi 4 case: a sketch dimensioned with the board's parameters, extrude, fillets and shell, an M2.5 standoff patterned on the 58 x 49 mm hole rectangle, port cut-outs, floor vents, a colour, then height 24 -> 32 mm in Parameters. The demo script gains the pi story (now the default). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
00baf1d883
commit
1fd4a2f782
8 files changed
+272
-15
No files matched your search
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# record_ui.sh DISPLAY PORT OUTDIR [STORY] [PLAYBACK_RATE]: record enclosure_ui_mcp.py --story STORY (v2 or v3,
|
||||
# default v3) driving the app on X display DISPLAY (1920x1080, started with --control PORT) to
|
||||
# record_ui.sh DISPLAY PORT OUTDIR [STORY] [PLAYBACK_RATE]: record enclosure_ui_mcp.py --story STORY (v2, v3
|
||||
# or pi, default pi) driving the app on X display DISPLAY (1920x1080, started with --control PORT) to
|
||||
# OUTDIR/enclosure-demo-STORY.mp4 (H.264) and .gif, with captions and a drawn pointer (the app
|
||||
# gets synthetic pointer events, so the screen's own pointer never moves). Needs ffmpeg with
|
||||
# x11grab and libass.
|
||||
@@ -8,14 +8,19 @@
|
||||
# SOLIDCRAFT_DEMO_NAME overrides the filename stem; PAUSE scales UI pauses, CAPTION is the
|
||||
# minimum real-time caption duration, and HOLD keeps the live completed model on screen.
|
||||
# For a readable 4x preview use SOLIDCRAFT_DEMO_CAPTION=4 and SOLIDCRAFT_DEMO_HOLD=8.
|
||||
# SOLIDCRAFT_DEMO_GIF_WIDTH and SOLIDCRAFT_DEMO_GIF_FPS size the README GIF (default 800 px, 10 fps).
|
||||
# The README demo (0.6): SOLIDCRAFT_DEMO_NAME=demo-0.6 SOLIDCRAFT_DEMO_PAUSE=0.4 SOLIDCRAFT_DEMO_CAPTION=7
|
||||
# SOLIDCRAFT_DEMO_HOLD=8 record_ui.sh :74 7974 OUT pi 6
|
||||
set -e
|
||||
DISP=${1:-:0}; PORT=${2:-7878}; OUT=$(cd "${3:-.}" && pwd); STORY=${4:-v3}; RATE=${5:-1}
|
||||
DISP=${1:-:0}; PORT=${2:-7878}; OUT=$(cd "${3:-.}" && pwd); STORY=${4:-pi}; RATE=${5:-1}
|
||||
HERE=$(cd "$(dirname "$0")" && pwd)
|
||||
CLI=${SOLIDCRAFT_CLI:-solidcraft-cli}
|
||||
NAME=${SOLIDCRAFT_DEMO_NAME:-enclosure-demo-$STORY}
|
||||
PAUSE=${SOLIDCRAFT_DEMO_PAUSE:-0.55}
|
||||
CAPTION=${SOLIDCRAFT_DEMO_CAPTION:-1.4}
|
||||
HOLD=${SOLIDCRAFT_DEMO_HOLD:-1}
|
||||
GIF_WIDTH=${SOLIDCRAFT_DEMO_GIF_WIDTH:-800}
|
||||
GIF_FPS=${SOLIDCRAFT_DEMO_GIF_FPS:-10}
|
||||
python3 -c 'import math,sys; r=float(sys.argv[1]); assert math.isfinite(r) and 0<r<=16' "$RATE"
|
||||
# Frame the actual app at capture resolution before the first recorded blank viewport.
|
||||
python3 - "$HERE" "$PORT" <<'PY'
|
||||
@@ -77,6 +82,6 @@ PY
|
||||
ffmpeg -loglevel error -y -i "$OUT/real-time.mp4" -vf "$(cat "$OUT/public.filter")" -an \
|
||||
-c:v libx264 -preset slow -crf 20 -pix_fmt yuv420p -movflags +faststart "$OUT/$NAME.mp4"
|
||||
ffmpeg -loglevel error -y -i "$OUT/$NAME.mp4" \
|
||||
-vf "fps=8,scale=720:-1:flags=lanczos,split[a][b];[a]palettegen=max_colors=80:stats_mode=diff[p];[b][p]paletteuse=dither=bayer:bayer_scale=4" \
|
||||
-vf "fps=$GIF_FPS,scale=$GIF_WIDTH:-1:flags=lanczos,split[a][b];[a]palettegen=max_colors=96:stats_mode=diff[p];[b][p]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" \
|
||||
"$OUT/$NAME.gif"
|
||||
ls -la "$OUT/$NAME.mp4" "$OUT/$NAME.gif"
|
||||
Reference in new issue
Block a user