facett-model3d — crate card
Reverse-engineered (from source — verify, don't trust the name)
- One-line pitch: A reusable 3D-model viewer Facet: load an embedded glTF/.glb mesh, slowly spin it (deterministic), CPU-light it, and tint a named sub-mesh by a status scalar.
- Does:
Model3Dloads a glTF/.glb mesh (from_glb/load_glb) and draws it through facett's existing CPU painter path (project → back-face cull → painter's-algorithm depth sort → Lambert shade against each glTF group's base colour) — no three-d/rend3/wgpu pass, so it renders identically native + wasm and stays headless-snapshot-testable. Auto-rotate is injected-clock deterministic (FC-7, like RabbitLogo3D). Its one domain feature: a status tint — a named group (default"eyes") shaded green→yellow→red by astatus ∈ [0,1]scalar viafacett_core::render::decor::gradient_by_scalar. Bundled fixtures: a proceduralskull()(baked by thegen_skullbin) and a geometry-only CC0avocado(). - Key deps:
facett-core(Facet, CPU render/decor),egui,serde_json,gltf1 (pure-Rust glTF reader, wasm-OK, no GPU pass). Dev:eframe,egui_kittest. Bins/examples:gen_skull,skull_demo,view_glb. - Shape: lib + a gen bin, ~900 lines. Modules: lib (355), mesh (198), glb (122), skull (89), tests. Embeds
assets/skull.glb+assets/avocado.glb. - Observed role in the workspace: A demo-friendly status console (a spinning skull whose eyes redden as things degrade); drops into a FacetDeck like the other 3D panes.
Fill in (one line each — only the human knows these)
- Primary consumer(s):
- Why it exists (vs the obvious alternative):
- Hard constraint (airgap / no-C-deps / no-FFI / pure-Rust / etc.):
- Release cadence & independence (rides a parent? own repo someday?):
- Status (production / prototype / experimental / stubbed):
- Must-NOT-change invariant:
- Biggest known gap or TODO:
- Anything a newcomer would get wrong about it: