Extremely bad performance with STL scan files

Rhino is notorious for having extremely bad performance with mesh models, notably STL files with plenty of polygons. Is there a way to reduce the often crashes of Rhino by making some optimized settings?

Seems like the Undo stack causes a lot of problems, because Rhino freezes and crashes after several transformations (moving, rotating, scaling) of the same object. Even if I only move the same non-modified STL model (a bit over 30 million polygons) 3-5 times and do nothing else, my Rhino 7 crashes. This happens on both, my laptop and my desktop PC running Windows 10, I also tested on two other machines with 32GB and 64GB, so itā€™s not related to the hardware.
The RAM usage gets super high after each moving of the model and will never go down to the original state. I canā€™t install a gazillion GB of RAM. :upside_down_face:

If I press the Undo button after moving the aforementioned STL model, Rhino freezes, my SSD starts to run at 100% and the RAM usage goes from 5 GB to 100% in seconds. If I have a luck, the program will not crash, but sometimes it does. Most of the time it will not save a back-up emergency file (it did so only twice after more than 50 crashes). It will also not offer me to send a crash report.

My question is: How to prevent these crashes, especially filling the RAM constantly!?

My second question is: Which directory Rhino 7 uses to store extra information when the RAM is filled entirely? I noticed that my SSD is working hard when the RAM is used at 100%. I had 28GB more space on my SSD just a hour ago, now itā€™s occupied by some hidden files written either by Rhino or Windows. I restarted my Windows, but the space is still occupied.

Back in the old days Windows automatically used virtual memory when it ran out of RAM. I canā€™t remember what the virtual memory file is called, and I donā€™t know if todayā€™s Windows still does it - although it is reasonable to assume it does.

When virtual memory is in use all memory accesses are done at ā€œdiskā€ speed (SSD speed these days) instead of RAM speed so naturally things slow down big time. The only solution is to stick to smaller files :smiley: or add more RAM - hopefully not ā€œgazillions of GBā€ but just a stick or two.

Or maybe its actually something else that the McNeelies can provide good insight and suggestions about.

1 Like

If you intend to only move/rotate/scale your STL scan then I suggest you create a block out of it. Moving those doesnā€™t change the geometry whereas moving a regular Rhino object changes the geometry.

1 Like

Aha! and no doubt in the process there is a period where both the original object and the new one exist and so the memory requirement temporarily doubles? - a serious OOPS! if the original is already consuming over half the available RAM.

1 Like

Just to clarify, Iā€™m working with an STL file of a laser scanned front bumper. The main issue is that the scanned model is oriented in some random position, so I try to approximate the correct orientation by making a History-enabled mirrored copy of the bumper with different material, then I move and rotate the original model until both models align to each other. This requires tens of transformations, but Rhino crashes quite often. Not to mention that there is a very long delay after each operation. Even a simple task such like selection or deselection takes over one minute.

Another strange behaviour I found is that the viewport performance is very different depending on the position of the model. The framerate may be good for a while (more than 15-30 frame per second), then I rotate the model slightly by 1 degree or less and suddenly the framerate gets super slow (much less than one frame per second). Then I rotate the model again and the framerate is normal as before. No idea why this is happening.

Thatā€™s because youā€™re running out of VRAM, and then it frees some up, then oh itā€™s out againā€¦

1 Like

That certainly still exists. The only difference is today if you have ā€˜leftoverā€™ RAM it uses it as a disk cache, soā€¦the opposite.

This is how it can be changed.

I just turned off my virtual RAM, because I noticed that Windows 10 occupied 35 GB from my SSD, which, obviously, degrades it quickly. I canā€™t use more than 32 GB RAM total on my PCā€™s motherboard. From my observations this particular STL file requires more than 60 GB of RAM, despite that it takes just 1,3 GB of disk space. Maybe itā€™s time to upgrade to another PC with 64 or 128 GB RAM.

The sad thing about this is that programs like Z-Brush can handle much more complex models with a minimum amount of RAM, but Rhino is not optimized for rendering of 3d meshes.

It does not explain why exactly the same model could lead to poor performance or good performance, depending on its orientation in the 3d space. We talk about very little difference in the orientation, such like 1 degree of rotation or less.

If the issue is in the VRAM, then I can upgrade to a new video card with 12 GB ov VRAM, such like RTX 4070 Super (currently, I have GTX 1660 Ti 6GB). But Iā€™m not certain that this alone will fix the issue I have with the huge memory leak caused by Rhino.

I do the same in Grasshopper.

Not sure if it matters but I usually insert my scan files instead of importing.

Another thing to consider might be the fily format.

A bodyscan with 231254 polygons exported as *.stl is something above 11 MB, the same thing exported as *.ply is only 4 MBā€¦

image

1 Like

Do NOT turn off virtual memory, Windows needs it to work properly. And no itā€™s not true that your motherboard limits you to 32.

My motherboardā€™s maximum capacity is 32 GB of RAM (supports up to 4x 8 GB DDR3 RAM). This is why I intend to buy a new PC with 96 GB DDR5 RAM (2x 48 GB). If this is still not enough, I will upgrade up to 192 GB total RAM.

I will experiment with inserting the model instead of importing it. Not sure whatā€™s the difference.

Also, what you say about the PLY format sounds promising. I will try to convert the STL file to PLY and check if it will be lighter in Rhino. Thanks for the suggestion!

1 Like

Inserting a model will automatically create a block instance of the import.

1 Like

Great! That may save me some hassle. Lets seeā€¦ :slight_smile:

Also, a 10 million polygon mesh will take up equal space in Rhino regardless of original file format.

1 Like

The advantage of inserting is that you donā€™t create a copy of the file saved in the Rhino file. The file size is smaller. The downside might be that you have to load the file everytime you use the Rhino file.

Iā€™m inserting less and less scan files due to layer issues. My new method is to import the file through Grasshopper, using the new Grasshopper Rhino componentsā€¦ Rhino 8 howeverā€¦

1 Like

The meshing process needed to Export selected as a PLY file took several minutes and my Rhino 7 froze for a while, but the good news is that the file size of the PLY is 183 MB compared to 1390 MB as a 3dm file. :slight_smile: Now lets see how it will behave when I insert it as a block instanceā€¦

Just a quick question. Which option should I choose from the following pop-up window?

1 Like

After some clean up of tiny mesh particles, the model consists 28ļ¾  655ļ¾  574 polygons now. This is still too much for my PC, thoughā€¦ It had more than 37 million polygons originally.

Depends what you are going to do with the meshā€¦

I like my files to be just linked.

What software do you use to do the post-processing of the scans?