Generating a heightmap from an array of meshes

It might be possible to improve things a bit.

pre allocate vertices/indices and use the same code for adding face. No reallocation so maybe no OOM.
Thing is, it’s not available in ammo.js/ammo.idl at main · kripken/ammo.js · GitHub
So, you have to do a local build of ammo, test it, if it’s fine, do a pr on ammo repo, push the build to babylon.js, do a pr in babylon.
It’s not that hard. I can help you.