Higher file size model load issue

I have a stl (200 MB) model file. when i load or import it into sandbox it does not showing basically it trough an error.
please check attached image when i import this file.

1 Like

Are you able to share the .stl file?

It seems it is too big (“out of memory”), but maybe we can do something about it.

Hello,

@Evgeni_Popov, I am facing a somewhat similar issue and it made me wonder.
Is there a upper size limit for .stl files or any file format for that matter ?,
Also Is there a difference if we use ASCII stl vs Binary stl.

Any and all help is appreciated. :blush: :pray:

There’s no upper size limit for the stl file (or any other type of file) itself, but you are limited by the amount of RAM the browser allocates to the javascript engine.

I think the binary file will be smaller than the ASCII file, so it could be better to use the binary file because the file itself will consume less memory when loaded (but the decoding process will use the same amount of RAM than the ASCII file).

I just had a look at the stl loader source code, and it seems there’s no additional memory allocated than the memory needed to create the vertex buffers, so, if you hit an “out of memory” error, we probably can’t do much, it means the generated meshes are too big…

1 Like

Is there any solution for that???
what if? we have higher size file.

If the created meshes are too big to fit in memory, than there’s nothing that can be done, unfortunately.

However, I don’t know if it’s what happens in your case, or if there is some other problems when loading the file. If you can provide the .stl file, we will be able to have a deeper look.

Hi @Evgeni_Popov this is the link of 3D model.
can you please review the model what’s wrong with it how we can solve the issue while loading the model.

Thanks for the file!

Here’s a PR that will fix the problem:

2 Likes

Hi @Evgeni_Popov , i checked this sandbox url Babylon.js Sandbox - View glTF, glb, obj and babylon files

Does it will work if i implemented on code???
will cdn work for that?

because if i run this stl file on actual sandbox url it does not working. https://sandbox.babylonjs.com/

Loading the file from both urls does work for me.

Do you still have a out of memory?

Yes, now it is working using in my code as well where i’m using cdn.
Thanks @Evgeni_Popov :slight_smile:

Hello @Evgeni_Popov , I tried the same. The high file size model is loading on sandbox and my normal HTML Java script code.

But in my case, I’m implementing Babylon with React JS code, getting issue in that. The same browser stuck issue is there for React integration.

I’ve updated the babylon core and loader plugins to latest as -
@babylonjs/core”: “^6.21.1”,
@babylonjs/loaders”: “^6.21.1”

Do I need to do anything else as well?

Please help!

As I answered on Github, the fix has not been released yet, it will be in the next version.

Hello @sebavan , When can we expect the next version for npm to be released?
Can you mention any specific date on this? As it’s an important issue to us and we will have to switch from babylon because of this issue if don’t get the update soon. And we’ll to plan accordingly.

npm release has been done yesterday (it’s done every thursday morning, EU time), so you should be able to get the package with the fix now.