Use latest syntax for setting geometry settings #5299

Also fixed:
- old include_curves use
- missing use of 'include_curves' in ifcopenshell.draw
This commit is contained in:
Andrej730
2024-09-05 10:53:52 +05:00
parent fcf41bf00c
commit ea6df7f617
6 changed files with 15 additions and 12 deletions
+2 -1
View File
@@ -88,7 +88,8 @@ def main(
)
# this is required for serialization
geom_settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
dimensionality = W.CURVES_SURFACES_AND_SOLIDS if settings.include_curves else W.SURFACES_AND_SOLIDS
geom_settings.set("dimensionality", dimensionality)
geom_settings.set("iterator-output", ifcopenshell.ifcopenshell_wrapper.NATIVE)
geom_settings.set("apply-default-materials", True)
@@ -22,6 +22,7 @@ import time
import operator
import functools
import multiprocessing
import ifcopenshell.ifcopenshell_wrapper as W
try:
from OCC.Core import AIS
@@ -522,8 +523,8 @@ class application(QtWidgets.QApplication):
if setting is None:
setting = settings()
setting.set(setting.INCLUDE_CURVES, True)
setting.set(setting.USE_PYTHON_OPENCASCADE, True)
setting.set("dimensionality", W.CURVES_SURFACES_AND_SOLIDS)
setting.set("use-python-opencascade", True)
self.signals = geometry_creation_signals()
thread = self.thread = geometry_creation_thread(self.signals, setting, f)
@@ -365,7 +365,7 @@ def create_shape(
"""
Return a geometric representation from STEP-based IFCREPRESENTATIONSHAPE
or
Return an OpenCASCADE BRep if settings.USE_PYTHON_OPENCASCADE == True
Return an OpenCASCADE BRep if 'use-python-opencascade' is True
Note that in Python, you must store a reference to the element returned by this function to prevent garbage
collection when you access its children. See #1124.
@@ -391,7 +391,7 @@ def create_shape(
.. code:: python
settings = ifcopenshell.geom.settings()
settings.set(settings.USE_PYTHON_OPENCASCADE, True)
settings.set("use-python-opencascade", True)
ifc_file = ifcopenshell.open(file_path)
products = ifc_file.by_type("IfcProduct")