You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loading geometry of large IFC models takes a lot of time.
There is a magic function in ifcopenshell : ifcopenshell.geom.iterator that takes care of the brep creation and serialisation and is super fast.
import multiprocessing
import ifcopenshell
from compas_occ.brep import BRep
from compas_ifc.model import Model
model = Model(input_ifc_model)
settings = ifcopenshell.geom.settings()
settings.set(settings.USE_PYTHON_OPENCASCADE, True)
def yield_from_iterator(it):
while True:
yield it.get()
if not it.next():
break
it = ifcopenshell.geom.iterator(settings, model.reader._file, multiprocessing.cpu_count())
it.initialize()
for serialized_element in yield_from_iterator(it):
data = serialized_element.data
geometry = BRep.from_shape(serialized_element.geometry)
The text was updated successfully, but these errors were encountered:
Feature Request
Loading geometry of large IFC models takes a lot of time.
There is a magic function in ifcopenshell :
ifcopenshell.geom.iterator
that takes care of the brep creation and serialisation and is super fast.see on this page or below a code example :
https://wiki.osarch.org/index.php?title=IfcOpenShell_code_examples
The text was updated successfully, but these errors were encountered: