diff --git a/src/blenderbim/blenderbim/bim/import_ifc.py b/src/blenderbim/blenderbim/bim/import_ifc.py index 08b9f565bf..f21cad9b83 100644 --- a/src/blenderbim/blenderbim/bim/import_ifc.py +++ b/src/blenderbim/blenderbim/bim/import_ifc.py @@ -398,18 +398,18 @@ class IfcImporter: for context in self.contexts: settings = ifcopenshell.geom.settings() - settings.set('mesher-linear-deflection', self.ifc_import_settings.deflection_tolerance) - settings.set('mesher-angular-deflection', self.ifc_import_settings.angular_tolerance) - settings.set('dimensionality', ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) - settings.set('context-ids', [context.id()]) + settings.set("mesher-linear-deflection", self.ifc_import_settings.deflection_tolerance) + settings.set("mesher-angular-deflection", self.ifc_import_settings.angular_tolerance) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) + settings.set("context-ids", [context.id()]) self.context_settings.append(settings) settings = ifcopenshell.geom.settings() - settings.set('mesher-linear-deflection', self.ifc_import_settings.deflection_tolerance) - settings.set('mesher-angular-deflection', self.ifc_import_settings.angular_tolerance) - settings.set('dimensionality', ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) - settings.set('disable-opening-subtractions', True) - settings.set('context-ids', [context.id()]) + settings.set("mesher-linear-deflection", self.ifc_import_settings.deflection_tolerance) + settings.set("mesher-angular-deflection", self.ifc_import_settings.angular_tolerance) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) + settings.set("disable-opening-subtractions", True) + settings.set("context-ids", [context.id()]) self.gross_context_settings.append(settings) def process_element_filter(self) -> None: diff --git a/src/blenderbim/blenderbim/bim/module/boundary/operator.py b/src/blenderbim/blenderbim/bim/module/boundary/operator.py index 24c5e5ec53..fd984b5118 100644 --- a/src/blenderbim/blenderbim/bim/module/boundary/operator.py +++ b/src/blenderbim/blenderbim/bim/module/boundary/operator.py @@ -133,14 +133,11 @@ class Loader: return mesh def load_settings(self): - settings = ifcopenshell.geom.settings() - settings.set(settings.EXCLUDE_SOLIDS_AND_SURFACES, False) - settings.set(settings.USE_BREP_DATA, False) - return settings + return ifcopenshell.geom.settings() def load_fallback_settings(self): settings = ifcopenshell.geom.settings() - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) return settings def load_importer(self): @@ -692,7 +689,7 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator): tree = ifcopenshell.geom.tree() shapes = {} settings = ifcopenshell.geom.settings() - settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True) + settings.set("disable-opening-subtractions", True) iterator = ifcopenshell.geom.iterator(settings, tool.Ifc.get(), multiprocessing.cpu_count(), include=include) if iterator.initialize(): while True: @@ -1030,7 +1027,7 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator): settings = ifcopenshell.geom.settings() if not element.is_a("IfcOpeningElement"): - settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True) + settings.set("disable-opening-subtractions", True) # geometry = ifcopenshell.geom.create_shape(settings, body) shape = ifcopenshell.geom.create_shape(settings, element) m = shape.transformation.matrix diff --git a/src/blenderbim/blenderbim/bim/module/debug/operator.py b/src/blenderbim/blenderbim/bim/module/debug/operator.py index eb342e9402..366dc0fcd6 100644 --- a/src/blenderbim/blenderbim/bim/module/debug/operator.py +++ b/src/blenderbim/blenderbim/bim/module/debug/operator.py @@ -172,7 +172,7 @@ class CreateAllShapes(bpy.types.Operator): total = len(elements) settings = ifcopenshell.geom.settings() settings_2d = ifcopenshell.geom.settings() - settings_2d.set(settings_2d.INCLUDE_CURVES, True) + settings_2d.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) failures = [] excludes = () # For the developer to debug with for i, element in enumerate(elements, 1): @@ -225,7 +225,7 @@ class CreateShapeFromStepId(bpy.types.Operator): element = self.file.by_id(self.step_id or int(context.scene.BIMDebugProperties.step_id)) settings = ifcopenshell.geom.settings() if self.should_include_curves: - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) shape = ifcopenshell.geom.create_shape(settings, element) if shape: ifc_importer = import_ifc.IfcImporter(self.ifc_import_settings) diff --git a/src/blenderbim/blenderbim/bim/module/model/opening.py b/src/blenderbim/blenderbim/bim/module/model/opening.py index e1bd9cf1b7..930c322913 100644 --- a/src/blenderbim/blenderbim/bim/module/model/opening.py +++ b/src/blenderbim/blenderbim/bim/module/model/opening.py @@ -291,7 +291,7 @@ class FilledOpeningGenerator: return tool.Ifc.get().createIfcIndexedPolyCurve(Points=ifc_points, Segments=ifc_segments) settings = ifcopenshell.geom.settings() - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) geometry = ifcopenshell.geom.create_shape(settings, profile) verts = ifcopenshell.util.shape.get_vertices(geometry) # [0, 2] represents X and Z ordinates diff --git a/src/blenderbim/blenderbim/bim/module/qto/calculator.py b/src/blenderbim/blenderbim/bim/module/qto/calculator.py index bb9456cc50..6841cb0c5c 100644 --- a/src/blenderbim/blenderbim/bim/module/qto/calculator.py +++ b/src/blenderbim/blenderbim/bim/module/qto/calculator.py @@ -1162,7 +1162,7 @@ def create_shapely_polygon(obj: bpy.types.Object, polygon: bpy.types.MeshPolygon def get_gross_element_mesh(element: ifcopenshell.entity_instance) -> bpy.types.Mesh: settings = ifcopenshell.geom.settings() - settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True) + settings.set("disable-opening-subtractions", True) return create_mesh_from_shape(element, settings) diff --git a/src/blenderbim/blenderbim/tool/geometry.py b/src/blenderbim/blenderbim/tool/geometry.py index 2a50a5d419..4051830577 100644 --- a/src/blenderbim/blenderbim/tool/geometry.py +++ b/src/blenderbim/blenderbim/tool/geometry.py @@ -514,7 +514,7 @@ class Geometry(blenderbim.core.tool.Geometry): ifc_import_settings = blenderbim.bim.import_ifc.IfcImportSettings.factory(bpy.context, None, logger) element = tool.Ifc.get_entity(obj) settings = ifcopenshell.geom.settings() - settings.set(settings.WELD_VERTICES, True) + settings.set("weld-vertices", True) context = representation.ContextOfItems if element.is_a("IfcTypeProduct"): @@ -522,20 +522,20 @@ class Geometry(blenderbim.core.tool.Geometry): try: shape = ifcopenshell.geom.create_shape(settings, representation) except: - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) shape = ifcopenshell.geom.create_shape(settings, representation) else: if not apply_openings: - settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True) + settings.set("disable-opening-subtractions", True) if context.ContextIdentifier == "Body" and context.TargetView == "MODEL_VIEW": try: shape = ifcopenshell.geom.create_shape(settings, element, representation) except: - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) shape = ifcopenshell.geom.create_shape(settings, element, representation) else: - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) shape = ifcopenshell.geom.create_shape(settings, element, representation) ifc_importer = blenderbim.bim.import_ifc.IfcImporter(ifc_import_settings) @@ -779,7 +779,7 @@ class Geometry(blenderbim.core.tool.Geometry): # Filter out unique meshes to avoid # reloading the same representation multiple times. meshes_to_objects: dict[bpy.types.Mesh, bpy.types.Object] - meshes_to_objects = {(obj:=tool.Ifc.get_object(element)).data: obj for element in elements} + meshes_to_objects = {(obj := tool.Ifc.get_object(element)).data: obj for element in elements} for obj in meshes_to_objects.values(): representation = tool.Ifc.get().by_id(obj.data.BIMMeshProperties.ifc_definition_id) diff --git a/src/blenderbim/blenderbim/tool/profile.py b/src/blenderbim/blenderbim/tool/profile.py index 10e8613694..fded9d2ab3 100644 --- a/src/blenderbim/blenderbim/tool/profile.py +++ b/src/blenderbim/blenderbim/tool/profile.py @@ -36,7 +36,7 @@ class Profile(blenderbim.core.tool.Profile): ) -> None: """generates image based on `profile` using `PIL.ImageDraw`""" settings = ifcopenshell.geom.settings() - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) shape = ifcopenshell.geom.create_shape(settings, profile) verts = shape.verts edges = shape.edges diff --git a/src/blenderbim/blenderbim/tool/spatial.py b/src/blenderbim/blenderbim/tool/spatial.py index d092d8ce76..75e48a77bf 100644 --- a/src/blenderbim/blenderbim/tool/spatial.py +++ b/src/blenderbim/blenderbim/tool/spatial.py @@ -419,7 +419,7 @@ class Spatial(blenderbim.core.tool.Spatial): @classmethod def get_gross_mesh_from_element(cls, visible_element): gross_settings = ifcopenshell.geom.settings() - gross_settings.set(gross_settings.DISABLE_OPENING_SUBTRACTIONS, True) + gross_settings.set("disable-opening-subtractions", True) new_mesh = cls.create_mesh_from_shape(ifcopenshell.geom.create_shape(gross_settings, visible_element)) return new_mesh diff --git a/src/blenderbim/scripts/standalone_blender_import.py b/src/blenderbim/scripts/standalone_blender_import.py index a1b3bfe012..5d65f17d24 100644 --- a/src/blenderbim/scripts/standalone_blender_import.py +++ b/src/blenderbim/scripts/standalone_blender_import.py @@ -16,8 +16,8 @@ class BlenderImporter: self.created_guids = set() self.settings = ifcopenshell.geom.settings() - self.settings.set_deflection_tolerance(self.deflection_tolerance) - self.settings.set_angular_tolerance(self.angular_tolerance) + self.settings.set("mesher-linear-deflection", self.deflection_tolerance) + self.settings.set("mesher-angular-deflection", self.angular_tolerance) self.settings_2d = ifcopenshell.geom.settings() self.settings_2d.set(self.settings_2d.INCLUDE_CURVES, True) @@ -47,7 +47,7 @@ class BlenderImporter: ] ) if self.body_contexts: - self.settings.set_context_ids(self.body_contexts) + self.settings.set("context-ids", self.body_contexts) # Annotation is to accommodate broken Revit files # See https://github.com/Autodesk/revit-ifc/issues/187 self.plan_contexts = [ diff --git a/src/ifc5d/ifc5d/qto.py b/src/ifc5d/ifc5d/qto.py index 8beabe02f4..5f54dc2481 100644 --- a/src/ifc5d/ifc5d/qto.py +++ b/src/ifc5d/ifc5d/qto.py @@ -148,7 +148,7 @@ class IfcOpenShell: formula_functions = {} gross_settings = ifcopenshell.geom.settings() - gross_settings.set(gross_settings.DISABLE_OPENING_SUBTRACTIONS, True) + gross_settings.set("disable-opening-subtractions", True) net_settings = ifcopenshell.geom.settings() gross_qtos = {} diff --git a/src/ifcblender/io_import_scene_ifc/__init__.py b/src/ifcblender/io_import_scene_ifc/__init__.py index 2c3aaf1e26..bc114da232 100644 --- a/src/ifcblender/io_import_scene_ifc/__init__.py +++ b/src/ifcblender/io_import_scene_ifc/__init__.py @@ -86,7 +86,7 @@ def import_ifc(filename, use_names, process_relations, blender_booleans): print(f"Reading {bpy.path.basename(filename)}...") settings = ifcopenshell_geom.settings() - settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, blender_booleans) + settings.set("disable-opening-subtractions", blender_booleans) assert os.path.exists(filename), filename ifc_file = ifcopenshell.open(filename) iterator = ifcopenshell_geom.iterator(settings, ifc_file) diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_profile_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_profile_representation.py index 18dffbc6b3..cb86eef6c5 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_profile_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_profile_representation.py @@ -140,7 +140,7 @@ class Usecase: return (self.settings["profile"].FlangeWidth * 2) - self.settings["profile"].WebThickness else: settings = ifcopenshell.geom.settings() - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) shape = ifcopenshell.geom.create_shape(settings, self.settings["profile"]) x = [shape.verts[i] for i in range(0, len(shape.verts), 3)] return self.convert_si_to_unit(max(x) - min(x)) @@ -169,7 +169,7 @@ class Usecase: return self.settings["profile"].Depth else: settings = ifcopenshell.geom.settings() - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) shape = ifcopenshell.geom.create_shape(settings, self.settings["profile"]) y = [shape.verts[i + 1] for i in range(0, len(shape.verts), 3)] return self.convert_si_to_unit(max(y) - min(y)) diff --git a/src/ifcopenshell-python/ifcopenshell/api/material/edit_profile_usage.py b/src/ifcopenshell-python/ifcopenshell/api/material/edit_profile_usage.py index f584c341ca..78cb712f02 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/material/edit_profile_usage.py +++ b/src/ifcopenshell-python/ifcopenshell/api/material/edit_profile_usage.py @@ -144,7 +144,7 @@ class Usecase: } ) self.settings_2d = ifcopenshell.geom.settings() - self.settings_2d.set(self.settings_2d.INCLUDE_CURVES, True) + self.settings_2d.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) shape = ifcopenshell.geom.create_shape(self.settings_2d, dummy_solid) if self.cardinal_point == 1: diff --git a/src/ifcopenshell-python/ifcopenshell/util/placement.py b/src/ifcopenshell-python/ifcopenshell/util/placement.py index d121048061..d6caa1b657 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/placement.py +++ b/src/ifcopenshell-python/ifcopenshell/util/placement.py @@ -75,7 +75,7 @@ def get_axis2placement(placement: ifcopenshell.entity_instance) -> MatrixType: import ifcopenshell.geom settings = ifcopenshell.geom.settings() - settings.set('convert-back-units', True) + settings.set("convert-back-units", True) shape = ifcopenshell.geom.create_shape(settings, placement) return np.array(shape.matrix).reshape((4, 4), order="F") elif ifc_class == "IfcAxis2Placement2D": diff --git a/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitDoorSwings.py b/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitDoorSwings.py index 42543d0021..b087b4e6b8 100644 --- a/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitDoorSwings.py +++ b/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitDoorSwings.py @@ -186,7 +186,7 @@ class Patcher: # This fixes symptom C. settings = ifcopenshell.geom.settings() - settings.set(settings.INCLUDE_CURVES, True) + settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) unit_scale = ifcopenshell.util.unit.calculate_unit_scale(self.file) for curve in self.file.by_type("IfcIndexedPolyCurve"): if True in [s.is_a("IfcArcIndex") for s in curve.Segments]: diff --git a/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py b/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py index ec7d92a3be..27a03171a6 100644 --- a/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py +++ b/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py @@ -194,7 +194,7 @@ class Patcher: if c.ContextType == "Model" ] ) - self.settings.set_context_ids(self.body_contexts) + self.settings.set("context-ids", self.body_contexts) products = self.elements iterator = ifcopenshell.geom.iterator(self.settings, self.file, multiprocessing.cpu_count(), include=products) diff --git a/src/ifcpatch/ifcpatch/recipes/TessellateElements.py b/src/ifcpatch/ifcpatch/recipes/TessellateElements.py index 48a8c9491d..31c6972116 100644 --- a/src/ifcpatch/ifcpatch/recipes/TessellateElements.py +++ b/src/ifcpatch/ifcpatch/recipes/TessellateElements.py @@ -71,7 +71,7 @@ class Patcher: return settings = ifcopenshell.geom.settings() - settings.set_context_ids([context.id()]) + settings.set("context-ids", [context.id()]) iterator = ifcopenshell.geom.iterator(settings, self.file, multiprocessing.cpu_count(), include=elements) replacements = {} if iterator.initialize():