summaryrefslogtreecommitdiff
path: root/src/SomhairlesDream.Shared/Replay.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-21 00:58:15 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-21 00:58:15 +0800
commit7b29dbff7e43e87741476f47df17ad1582b16546 (patch)
tree4c9d0832b4e4edd77e59e9cb0a88abf5e729a9f9 /src/SomhairlesDream.Shared/Replay.fs
parent47add3088d50f12c5f48591f26c53cdb59d8283b (diff)
downloadsomhairles-dream-fsharp-7b29dbff7e43e87741476f47df17ad1582b16546.tar.gz
feat(pipeline): add runnable artifact pipeline increment
[Change Nature] - This commit adds the first runnable increment of the F# artifact pipeline: CLI, server, frontend bundle, stage fixture, and tests. It is feature work, not a bug fix. [New Capability] - CLI `run` executes the three-step Blender fixture through the process bridge and writes GLBs, step logs, events, and a manifest; `verify` validates a manifest without Blender. - Server exposes run start, run-scoped SSE, artifact manifest/file routes, and serves the Fable frontend from its build output. - Frontend starts runs, follows run-scoped SSE progress, and links the artifact manifest on completion. [Implementation] - Shared layer holds domain, run state, replay, and artifact contracts; Modeling holds the pipeline, 120s bridge timeout, and result-file protocol; stage/blender/fixture.py owns geometry in Python (bpy owns geometry, F# owns orchestration). - Fable bundle is regenerated into public/ and copied by the server project; solution includes all projects with warnings-as-errors. - README documents build, Fable, server, interpreter/env, fixture limitations, and current verification status. [Impact] - Verified: 40/40 solution tests pass; Release build 0 warnings/errors; real CLI run with bpy 5.0.1 produced 3 GLBs, 3 logs, and a verify-clean manifest; isolated-port server smoke flow succeeded. - Not yet verified: browser end-to-end behavior and production fidelity. Artifacts and caches are gitignored.
Diffstat (limited to 'src/SomhairlesDream.Shared/Replay.fs')
-rw-r--r--src/SomhairlesDream.Shared/Replay.fs107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/SomhairlesDream.Shared/Replay.fs b/src/SomhairlesDream.Shared/Replay.fs
new file mode 100644
index 0000000..782e632
--- /dev/null
+++ b/src/SomhairlesDream.Shared/Replay.fs
@@ -0,0 +1,107 @@
+namespace SomhairlesDream.Shared
+
+type ReplayFrame =
+ { Version: int
+ Label: string
+ Mesh: MeshSnapshot }
+
+module Replay =
+ let private vertex x y z =
+ { X = x
+ Y = y
+ Z = z }
+
+ let private frame version label vertices faces =
+ { Version = version
+ Label = label
+ Mesh =
+ { Version = version
+ Label = label
+ Vertices = vertices
+ Faces = faces } }
+
+ let frames () =
+ [| frame
+ 1
+ "重建起点"
+ [| vertex -2.0 0.0 -1.0
+ vertex 2.0 0.0 -1.0
+ vertex 2.0 0.0 1.0
+ vertex -2.0 0.0 1.0
+ vertex -1.0 2.0 -0.5
+ vertex 1.0 2.0 -0.5
+ vertex 1.0 2.0 0.5
+ vertex -1.0 2.0 0.5 |]
+ [| [| 0; 1; 2 |]
+ [| 0; 2; 3 |]
+ [| 4; 6; 5 |]
+ [| 4; 7; 6 |]
+ [| 0; 4; 5 |]
+ [| 0; 5; 1 |]
+ [| 1; 5; 6 |]
+ [| 1; 6; 2 |]
+ [| 2; 6; 7 |]
+ [| 2; 7; 3 |]
+ [| 3; 7; 4 |]
+ [| 3; 4; 0 |] |]
+ frame
+ 2
+ "主承力骨架"
+ [| vertex -2.5 0.0 -1.0
+ vertex 2.5 0.0 -1.0
+ vertex 2.5 0.0 1.0
+ vertex -2.5 0.0 1.0
+ vertex -1.5 2.2 -0.7
+ vertex 1.5 2.2 -0.7
+ vertex 1.5 2.2 0.7
+ vertex -1.5 2.2 0.7
+ vertex -0.45 0.0 -0.45
+ vertex 0.45 0.0 -0.45
+ vertex 0.45 3.0 0.45
+ vertex -0.45 3.0 0.45 |]
+ [| [| 0; 1; 2 |]
+ [| 0; 2; 3 |]
+ [| 4; 6; 5 |]
+ [| 4; 7; 6 |]
+ [| 8; 9; 10 |]
+ [| 8; 10; 11 |]
+ [| 0; 4; 8 |]
+ [| 4; 11; 8 |]
+ [| 1; 9; 5 |]
+ [| 1; 5; 2 |]
+ [| 2; 5; 10 |]
+ [| 2; 10; 3 |]
+ [| 3; 10; 7 |]
+ [| 3; 7; 0 |] |]
+ frame
+ 3
+ "舱段重构"
+ [| vertex -3.0 0.0 -1.3
+ vertex 3.0 0.0 -1.3
+ vertex 3.0 0.0 1.3
+ vertex -3.0 0.0 1.3
+ vertex -2.0 2.0 -1.0
+ vertex 2.0 2.0 -1.0
+ vertex 2.0 2.0 1.0
+ vertex -2.0 2.0 1.0
+ vertex -1.0 3.4 -0.65
+ vertex 1.0 3.4 -0.65
+ vertex 1.0 3.4 0.65
+ vertex -1.0 3.4 0.65
+ vertex -3.8 0.6 0.0
+ vertex 3.8 0.6 0.0 |]
+ [| [| 0; 1; 2 |]
+ [| 0; 2; 3 |]
+ [| 4; 6; 5 |]
+ [| 4; 7; 6 |]
+ [| 8; 9; 10 |]
+ [| 8; 10; 11 |]
+ [| 0; 4; 8 |]
+ [| 0; 8; 12 |]
+ [| 1; 13; 5 |]
+ [| 1; 2; 13 |]
+ [| 2; 6; 10 |]
+ [| 2; 10; 13 |]
+ [| 3; 11; 7 |]
+ [| 3; 12; 11 |]
+ [| 3; 0; 12 |] |] |]