feat(editor): add --info-mesh-stats geometric audit

Reports total surface area, per-triangle area histogram
(min/max/mean/median), edge analysis (boundary / manifold /
non-manifold counts), watertight check, and degenerate
triangle count for a single WOM.

Watertightness here is the topological notion: every edge
must be shared by exactly 2 triangles via shared vertex
indices. This is what collision bakes and physics queries
actually need — visually-closed primitives whose adjacent
faces don't weld vertices will (correctly) report as
non-watertight.

Already caught a real defect in handleTent's door-fan
triangulation: the fan covers the door cutout area with
a stray triangle and leaves a vertex unreferenced.
Edge analysis is gated by triCount <= 2M to keep the
unordered_map bounded for huge baked terrain meshes.
This commit is contained in:
Kelsi 2026-05-09 10:41:58 -07:00
parent 17a53f192f
commit 5e404a9fe6
3 changed files with 148 additions and 1 deletions

View file

@ -613,6 +613,8 @@ void printUsage(const char* argv0) {
std::printf(" Single-mesh detail: bounds, version, batches, bones, textures, attachments in one view\n");
std::printf(" --info-mesh-storage-budget <wom-base> [--json]\n");
std::printf(" Estimated bytes-per-category breakdown for a single WOM (vertices/indices/bones/...)\n");
std::printf(" --info-mesh-stats <wom-base> [--json]\n");
std::printf(" Geometric stats: total surface area, triangle area histogram, edge use, watertight check\n");
std::printf(" --list-project-meshes-detail <projectDir> [--json]\n");
std::printf(" Per-mesh listing across every zone in a project (sorted by triangle count)\n");
std::printf(" --info-project-models-total <projectDir> [--json]\n");