cityjson / Up3date

A Blender add-on to import, edit and export 3D city models encoded in CityJSON v.1.0 format preserving geometries, attributes and semantics
MIT License
66 stars 12 forks source link

Duplicate vertices checker makes export really slow #14

Closed LaurensJN closed 3 years ago

LaurensJN commented 3 years ago

Using a model with 94.000 vertices, the exporter takes 74 seconds when the exporter checks for duplicate vertices. Without checking, it takes only 1.4 second. That's 70x faster. For bigger models the checker will probably be even worse.

What probably makes it slow is that it checks (1) each coordinate individually if it's already in a list; (2) it does not use any rounding. Another method should be considered that can make it faster, maybe similar to the CJIO remove_duplicate_vertices method (see here). That method also uses some rounding that would make it faster. On the model that is exported without checking for duplicate vertices I tried the CJIO method (with 12 decimals) and it was <1s.

LaurensJN commented 3 years ago

I will try to propose a new method