STL import slow

Technical discussions
Post Reply
Guoliang
Posts: 1
Joined: Wed Aug 07, 2013 4:16 am

STL import slow

Post by Guoliang »

Hello
I import stl file 8 megabyte. The import is slow. How to do faster?
Thank you
Guoliang

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: STL import slow

Post by nickz »

Hi Guoliang

By default KernelCAD does some extra work during stl import. Particularly it checks wether the mesh has unlinked pieces so it can be separated into several objects. Also it calculates per vertex normals. The normals supplied in stl are per face and in not very high density the model looks faceted. These calculations can be very slow with large meshes.

With large dense meshes per face normal is not a big issue so it can be skipped. Also often it is known that there is a single object inside. By default objects are separated always and the software tries to detect whether to do normals calculations depending on the model size.

So these steps can be forced to be skipped this way:

Query ISTLDataContext from IModel or ModelEx and call SetSeparateObjects(false) to skip object separation. Call SetAnalysisType( ESTLAnalysis.eStlAnalysSkip ) (C#) or SetAnalysisType(eStlAnalysSkip ) (C++) to skip the normals calculation

We probably need to revisit the automatic detection of large models, which obviously does not satisfy you. For now I recommend in your code to detect the stl size and call SetAnalysisType( ESTLAnalysis.eStlAnalysSkip ) depending on it. This way you can tune it in for your application.

Regards
Nick

Post Reply