Files
workinf_Blender_Wasm/docs/status/W-073.md
2026-08-12 04:47:48 -04:00

36 lines
1.7 KiB
Markdown

# W-073 Status
status: in_progress
task: 定义 Blender 三角面简化和 LOD 协议
`web/protocol/simplify.ts` now defines versioned `SimplifyProfile`,
`SimplifyResult` and `LODManifest` contracts. The profile validator keeps the
Blender modifier modes separate:
- `COLLAPSE` requires `ratio` in `(0, 1]` and supports triangle budget,
vertex-group weighting/inversion, triangulate, symmetry axis and tolerance.
- `UNSUBDIV` requires a positive integer `iterations` and rejects collapse or
dissolve-only parameters.
- `DISSOLVE_PLANAR` requires `angleLimit` in `[0, PI]`, with explicit
boundary delimit flags and dissolve-boundary handling.
The parser also enforces non-negative source revisions and error codes for
missing vertex groups, unsupported cross-mode fields, invalid budgets and LOD
manifests whose triangle budgets do not decrease. A browser E2E test covers a
valid collapse profile, a two-level manifest and the missing-vertex-group
failure.
The common profile now carries an explicit `attributePolicy`
(`PRESERVE`/`RECOMPUTE_NORMALS`/`DROP`) and a validated `SkinSimplifyPolicy`
with maximum influences, minimum weight, maximum position error and shape-key
handling. Vertex-group and symmetry-only fields are conditionally optional, so
the TypeScript contract and runtime validator no longer disagree when those
features are disabled.
The protocol is now exercised end-to-end by the native/WASM command path:
`decimateMesh` validates `sourceMeshRevision`, returns a new SceneIR revision,
and the browser-facing smoke checks topology counts, index bounds and attribute
buffer lengths. Native Blender/WASM golden parity for all parameter
combinations remains part of W-079; implementation of the declared skin policy
remains W-076.