3D model: BabylonJs Sandbox 500MB stl file issue not showing the model

I’m currently facing an issue with loading a 500MB STL file in Babylon.js. I previously asked a similar question about a 200MB file, and that issue was resolved. However, now I’m encountering problems with the larger file. I’ve tried loading it in the sandbox, but it’s not showing any response. Could you please provide guidance on how to resolve this issue?

here is the file link:

a 570mb stl is massive holy crap XD.

The sandbox only supports glb, gltf, obj formats, I think you need to do a conversion to the stl format first.

it support stl file also. I tried 200 mb file before.

is there any suggestion to solve this issue???

Have you tried maybe breaking it into chunks? It might be a network issue? Where are you serving the file from?

I’m facing the same issue. Cannot break model into chunks and have few heavy models similar to this size.
The models are not loading to sandbox as well.

@sebavan and @Evgeni_Popov Any help is really appreciated.

do you have any error in the console?

Can’t you just convert this stl to a less heavy format? Honestly, 500mb is just a hell of a lot. Even if it makes it through, I’m wondering who will want to wait until it’s fullly loaded. Then, I guess the other thing is/could be how many nodes/meshes are in this model?


Getting no error. Earlier the browser was freezing but after the update it’s not freezing but the model is still not loading.

We have lots of stl models with higher size and cannot convert every model to other format of less size.

what update was that?

I would expect your browser to freeze and possibly run out of memory, but it depends on many different factors. I would also expect a single frame to take a long time to render (if the mesh is so complex).

Does your model load in any other viewer? Such as Microsoft 3D viewer, or Khronos glTF viewer: glTF Sample Viewer (khronos.org)

@RaananW After Babylon platform updated it’s loader plugin, browser freeze issue got resolved. But still the model is not loaded. The limit of the size of the loading model is increased a bit but not as per our requirement.

And @carolhmj , yes the models are loading fin in these 3D viewers.

… what update? version? when did it happen?

i’m a bit at a loss. I thought those were STL files? the 2nd viewer is a glTF viewer.

It would be good if you could share one model so we can test this. it shouldn’t be an issue (apart of high CPU/GPU usage) to render large models. if the hardware supports it, it should work as expected.

Yeah, we really need a model to be able to dig into this further.

I tried with the asset linked to in the first post, and it seems V8 has a string limit when calling TextDecoder.decode(), probably the same than for StringDecoder: StringDecoder undocumented size limit · Issue #35676 · nodejs/node · GitHub

The size of the ArrayBuffer is 598091636 for the asset, and when calling TextDecoder.decode(), the result is an empty string without any error…

Firefox has a greater limit and the asset does work in the Sandbox there.

Microsoft 3D Viewer is a native app, so it does not have the same limitations than a browser, and the Khronos glTF viewer can’t open stl files.

I tried with the first two links I got from Google when searching for “stl viewer” (https://www.viewstl.com/ and https://3dviewer.net/), and both can’t display the model.

Having said that, I don’t really know how to fix it on our side… Maybe we could try to split the input buffer when it is too big, but it would probably mean some non straightforward changes to the stl loader…

[EDIT] One thing that should work, looking at the code, is to convert the stl file to binary, as currently it’s a text file.

1 Like

How about TextDecoderStream?

if it is possible to process STL in chunks, then yes. I don’t know STL well enough to tell you whether or not it is possible, but TBH - i am not sure it is.
Otherwise we are still with the same string limit.

I am not sure how to generate a binary STL, but if it is possible to do that programmatically, then @Evgeni_Popov suggestion would be the best path for you.

Thanks every one for your responses. @Evgeni_Popov can you please share any code snippet to convert the file into binary to achieve this.