Files
3d-tools/docs/ARCHITECTURE.md
T
zemion f838480278
Verify / verify (push) Canceled after 0s
Release 3D Tools 0.2.0
2026-09-02 09:56:02 +02:00

23 lines
1.5 KiB
Markdown

# Architecture
The core/model.ts module converts every supported source into one inert model
containing finite position/normal arrays, triangle indices and descriptive scene
metadata. Imports run in a disposable module worker with progress, cancellation
and revision-scoped results. Parser-specific bounds are enforced before
allocation and again on normalized geometry. Normal repair, transforms,
statistics and exporters consume only that model.
For glTF/GLB, the selected/default scene is traversed as a validated acyclic
hierarchy. Column-major matrices and TRS/quaternion transforms are composed,
inverse-transpose normal transforms and mirrored winding are applied, and every
mesh instance is flattened into the bounded model. Consequently preview,
bounds, surface statistics, OBJ, STL and PLY all describe the same selected scene.
Selected metallic/roughness material factors and declared texture slots remain
inert inspection metadata; texture payloads are not decoded. Per-axis transforms
use inverse-transpose normal handling, while bounded repair can discard only
geometrically degenerate faces before recalculating normals.
The preview expands at most 200,000 triangles into a dedicated WebGL buffer. It uses fixed application-owned shaders and never compiles source-file content. Full statistics and exports still use the complete bounded model. glTF data URIs are decoded locally; non-data URIs are rejected.
All Vite assets use relative paths for nested portal mounting. Release packaging fixes ZIP ordering, timestamps and permissions.