Skip to content

v1.4.5 — Large schematics no longer overflow the stack

Choose a tag to compare

@Nano112 Nano112 released this 09 Jun 23:21
· 5 commits to master since this release

Fixes large schematics failing to load with RangeError: Maximum call stack size exceeded.

Fix

  • BlockMeshBuilder merged geometry attributes via array.push(...Array.from(typedArray)), which spreads every float as a function argument. Past the JS engine's argument limit — a function of vertex count — that call throws Maximum call stack size exceeded, so big schematics failed during mesh building. (Not URL-specific; purely a size threshold.)
  • Replaced with mergeBufferGeometries: one preallocated typed array per attribute, filled with bulk .set() copies, and 16/32-bit indices chosen by vertex count. It's overflow-proof and faster — no number[] boxing, no Array.from intermediates, no GC churn from a growing array.
  • Adds unit tests, including the large-merge regression and the 32-bit-index path.