Optimisation for not iterating through things with no representations

Iterator initialise can take a few seconds on large models even though you're just doing a few elements which have no representations.
This commit is contained in:
Dion Moult
2024-09-24 14:43:25 +10:00
parent 2151035afd
commit ff5c402750
+5
View File
@@ -723,6 +723,11 @@ class IfcImporter:
results = set()
if not products:
return results
# For efficiency (iterator.initialize takes time), return early if there are no representations
if not any(product.Representation for product in products):
return results
if tool.Loader.settings.should_use_cpu_multiprocessing:
iterator = ifcopenshell.geom.iterator(
settings,