refactor(viewer): app.js 按职责切成 8 个普通脚本(纯切片,零语义改动)

state / harness / camera / pick / ui / sheets / render / urlparams。
经典脚本的顶层 const/let 落在同一个全局词法作用域,所以切片本身不改变任何行为——
这一步先让"文件边界"与"模块语义"两件事分离:翻 ESM 时若出问题,责任清楚在
import/export,而不是切片切错了行。

切片踩到并修掉的:urlparams.js 被切掉了 IIFE 的收尾 })();(我按 len-2 收边界),
node --check 当场报 Unexpected end of input。

截图基线分级也在这一步收敛:工程图/装配向导视图带 feGaussianBlur 发光滤镜,
同一构建两轮就有 ±1 抖动(先前扫描那两轮碰巧逐字节相同,才漏进"稳定"清单,
于是随机假 FAIL)。把 8 张工程图/向导视图连同 3 张线束 x-ray、boss_p07、
p03_mount_loose 一起转像素容差(存参考像素,阈值 mean<=0.02、单像素<=32,
约实测 20x 余量),其余 92 张仍要求逐字节相同。

关卡:92 张逐字节一致 + 13 张在噪声阈内;数据哈希与 IK exact 段一致。
This commit is contained in:
cbb
2026-10-15 04:45:56 +08:00
parent 531a293688
commit f713355351
26 changed files with 1908 additions and 1816 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

+31 -3
View File
@@ -1,11 +1,11 @@
{
"note": "同一构建两轮实测:mean<=0.0019、单像素最大差 7、无像素差>8。阈值 mean<=0.02 / 单像素<=32 约留 20x 余量;超过即视为真实渲染回归。p03_mount_loose 是 ±1 量化噪声(曾两轮碰巧逐字节相同而漏进稳定清单)。",
"note": "工程图/装配向导视图带 feGaussianBlur 发光滤镜,同一构建两轮的实测抖动是 mean<=0.0019、单像素最大差 7、无像素差>8;boss_p07 / p03_mount_loose 与三张线束 x-ray 同属 ±1~7 的量化/透明排序噪声。阈值 mean<=0.02、单像素<=32 约留 20x 余量,超过即视为真实渲染回归。其余视图仍要求逐字节相同。",
"mean_max": 0.02,
"pixel_max": 32,
"views": {
"m3_sheet_exploded": {
"mean": 7e-05,
"mx": 1
"mean": 0.001,
"mx": 2
},
"boss_p07": {
"mean": 0.0,
@@ -26,6 +26,34 @@
"p03_mount_loose": {
"mean": 0.0,
"mx": 1
},
"m2_sheet_joint": {
"mean": 0.001,
"mx": 2
},
"m1_sheet_front": {
"mean": 0.001,
"mx": 2
},
"m4_sheet_side": {
"mean": 0.001,
"mx": 2
},
"m5_guide_step1": {
"mean": 0.001,
"mx": 2
},
"m6_guide_step5": {
"mean": 0.001,
"mx": 2
},
"m7_sheet_blueprint": {
"mean": 0.001,
"mx": 2
},
"m8_sheet_dark": {
"mean": 0.001,
"mx": 2
}
}
}
-7
View File
@@ -31,13 +31,6 @@ c55a40d4bc4b4e73a672326fa02d573c docs/shots/hollow_p04_top.png
f3b85ea576a6aa99a61953c4ff2a5ff4 docs/shots/hollow_p07_top.png
e169359e86a61f7ab80d4adea0231436 docs/shots/j3_前端压盖_全件.png
83325d3ca1b9e56fd2c70661052fd063 docs/shots/j3_前端压盖_装配.png
30ab6da268de109cd087b93b8b175cf9 docs/shots/m1_sheet_front.png
45050caba87c801ab0c29ac939e51e43 docs/shots/m2_sheet_joint.png
2b1950dda519fac21d5e71d4a9c1f990 docs/shots/m4_sheet_side.png
86098e0fada6f54d9ea3d285b3e0ed6e docs/shots/m5_guide_step1.png
8366cefeca8b935f9fef31bfd2454047 docs/shots/m6_guide_step5.png
40f4663eef6aa61f36e47e1fb1b1ab07 docs/shots/m7_sheet_blueprint.png
2702f107e6152f05a5016b916f38cb89 docs/shots/m8_sheet_dark.png
a6375fdce42c33395cad1586c9d6d8c5 docs/shots/m9_motion.png
c22cef65ca2a74b1332ecaba6b9a484a docs/shots/p03_light_iso.png
ebdeb9a180e95afd38f5a42d12743579 docs/shots/p03_light_join.png