mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-26 17:30:45 +01:00
Mesh::from_parts computed normals and tangents before validate(). An index past the last vertex reads as the origin in the MikkTSpace callbacks, but the all-degenerate guard compares positions.get() and counts a missing vertex as different. So two positions with indices [0, 1, 2] passed the guard while MikkTSpace saw every triangle as degenerate and underflowed at generated.rs:1100: a panic in debug, an out-of-bounds walk in release. compute_tangents now also skips MikkTSpace (using the per-triangle fallback, which reads with get()) when an index is out of range, and from_parts refuses such indices before building the mesh, with the same error validate() gives.