From a3b6a6ea39abccea23aed8521f834f32e1db209c Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 15 Jun 2024 23:50:37 +1000 Subject: [PATCH] Black geom/main.py --- .../scripts/standalone_blender_import.py | 2 +- .../ifcopenshell/geom/main.py | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/blenderbim/scripts/standalone_blender_import.py b/src/blenderbim/scripts/standalone_blender_import.py index 5d65f17d24..0f1984e645 100644 --- a/src/blenderbim/scripts/standalone_blender_import.py +++ b/src/blenderbim/scripts/standalone_blender_import.py @@ -19,7 +19,7 @@ class BlenderImporter: 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) + self.settings_2d.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS) self.process_element_filter() self.process_context_filter() diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index 7653da5c7a..855e66524f 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -99,7 +99,7 @@ SETTING = Literal[ class missing_setting: def __repr__(self): - return '-' + return "-" class settings_mixin: @@ -124,10 +124,7 @@ class settings_mixin: return missing_setting() fmt_pair = lambda x: "%s = %r" % (self.rname(x), safe_get(x)) - return "%s(%s)" % ( - type(self).__name__, - ", ".join(map(fmt_pair, self.setting_names())) - ) + return "%s(%s)" % (type(self).__name__, ", ".join(map(fmt_pair, self.setting_names()))) @staticmethod def name(k: str) -> SETTING: @@ -184,18 +181,20 @@ class settings_mixin: class serializer_settings(settings_mixin, ifcopenshell_wrapper.SerializerSettings): pass + class settings(settings_mixin, ifcopenshell_wrapper.Settings): pass + class iterator(ifcopenshell_wrapper.Iterator): def __init__( self, settings: settings, file_or_filename: Union[file, str], num_threads: int = 1, - include: Optional[Union[list[entity_instance],list[str]]] = None, - exclude: Optional[Union[list[entity_instance],list[str]]] = None, - geometry_library: str = "opencascade" + include: Optional[Union[list[entity_instance], list[str]]] = None, + exclude: Optional[Union[list[entity_instance], list[str]]] = None, + geometry_library: str = "opencascade", ): self.settings = settings if isinstance(file_or_filename, file): @@ -318,9 +317,7 @@ class tree(ifcopenshell_wrapper.tree): return ifcopenshell_wrapper.tree.clash_clearance_many(*args) -def create_shape( - settings: settings, inst: entity_instance, repr: Optional[entity_instance] = None -) -> ShapeElementType: +def create_shape(settings: settings, inst: entity_instance, repr: Optional[entity_instance] = None) -> ShapeElementType: """ Return a geometric representation from STEP-based IFCREPRESENTATIONSHAPE or