Any way to speed up adding faces and edges?

I am creating an importer. I use entities.add_face and entities.add_edge to import a model, but they are much time-consuming.

54234 faces spend 11 seconds for add_face
85417 edges spend 9 seconds for add_edge

It is a simple model though. For complex models, the time to create faces and edges is too long to be acceptable. How can I speed it up? Thanks.

Did you create an undo operation and switch off the UI during the operation ?

Have you looked at creating a virtual polymesh …

… and afterward adding it within an operation ?

3 Likes

A long time ago, I wrote a plugin that imported/exported data for a few external applications. I also updated it a few years ago.

I always used start_operation/commit_operation, and I tried all sorts of things.

Bottom line, the first 200 faces are added much quicker that adding the same after importing 10k faces.

start_operation/commit_operation is a given, but SU must still be performing some checks, and the checks slow down as the number of entities grows.

Normal users of the plugin were modeling reasonably sized spaces, normally houses of worship.

The ‘special users’ were modeling the largest houses of worship, and also large transportation spaces, like the largest airport terminals, train stations, etc. These models had a lot of faces.

I implemented a rather crazy fiber based progress bar, and it was a waste of time because the faces vs time curve was so nonlinear…

The import code pulled in metadata from the external apps, so I couldn’t use PolygonMesh…