black formatting

This commit is contained in:
falken10
2025-06-27 08:28:22 +02:00
committed by Bruno Perdigão
parent b90f146a68
commit a31aa6053e
4 changed files with 23 additions and 25 deletions
@@ -3435,6 +3435,7 @@ class UnassignRepresentationLayer(bpy.types.Operator, tool.Ifc.Operator):
ifcopenshell.api.layer.unassign_layer(ifc_file, [representation], layer) ifcopenshell.api.layer.unassign_layer(ifc_file, [representation], layer)
return {"FINISHED"} return {"FINISHED"}
class CreateInstance(bpy.types.Operator, tool.Ifc.Operator): class CreateInstance(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.create_instance" bl_idname = "bim.create_instance"
bl_label = "IFC Create Instance" bl_label = "IFC Create Instance"
@@ -3468,4 +3469,3 @@ class CreateInstance(bpy.types.Operator, tool.Ifc.Operator):
bpy.ops.bim.hotkey(hotkey="S_A") bpy.ops.bim.hotkey(hotkey="S_A")
return {"FINISHED"} return {"FINISHED"}
@@ -1261,7 +1261,6 @@ class BoundingBoxDecorator:
def draw_bounding_box_wire_cube(self, context): def draw_bounding_box_wire_cube(self, context):
self.line_shader = gpu.shader.from_builtin("POLYLINE_UNIFORM_COLOR") self.line_shader = gpu.shader.from_builtin("POLYLINE_UNIFORM_COLOR")
self.line_shader.bind() self.line_shader.bind()
self.line_shader.uniform_float("viewportSize", (context.region.width, context.region.height)) self.line_shader.uniform_float("viewportSize", (context.region.width, context.region.height))
@@ -1363,17 +1362,21 @@ class BoundingBoxDecorator:
"left": co1.x - min_spacing, "left": co1.x - min_spacing,
"right": co1.x + dim1[0] + min_spacing, "right": co1.x + dim1[0] + min_spacing,
"top": co1.y + dim1[1] + min_spacing, "top": co1.y + dim1[1] + min_spacing,
"bottom": co1.y - min_spacing "bottom": co1.y - min_spacing,
} }
bounds2 = { bounds2 = {
"left": co2.x - min_spacing, "left": co2.x - min_spacing,
"right": co2.x + dim2[0] + min_spacing, "right": co2.x + dim2[0] + min_spacing,
"top": co2.y + dim2[1] + min_spacing, "top": co2.y + dim2[1] + min_spacing,
"bottom": co2.y - min_spacing "bottom": co2.y - min_spacing,
} }
if (bounds1["left"] < bounds2["right"] and bounds1["right"] > bounds2["left"] and if (
bounds1["bottom"] < bounds2["top"] and bounds1["top"] > bounds2["bottom"]): bounds1["left"] < bounds2["right"]
and bounds1["right"] > bounds2["left"]
and bounds1["bottom"] < bounds2["top"]
and bounds1["top"] > bounds2["bottom"]
):
x_overlap = min(bounds1["right"], bounds2["right"]) - max(bounds1["left"], bounds2["left"]) x_overlap = min(bounds1["right"], bounds2["right"]) - max(bounds1["left"], bounds2["left"])
y_overlap = min(bounds1["top"], bounds2["top"]) - max(bounds1["bottom"], bounds2["bottom"]) y_overlap = min(bounds1["top"], bounds2["top"]) - max(bounds1["bottom"], bounds2["bottom"])
+1 -6
View File
@@ -147,7 +147,6 @@ def update_measure_xyz(self: "BIMModelProperties", context: bpy.types.Context) -
self.prev_show_gizmo_object_translate = False self.prev_show_gizmo_object_translate = False
def update_cut_decorator(self: "BIMModelProperties", context: bpy.types.Context) -> None: def update_cut_decorator(self: "BIMModelProperties", context: bpy.types.Context) -> None:
if self.show_cut_decorator: if self.show_cut_decorator:
CutDecorator.install(bpy.context) CutDecorator.install(bpy.context)
@@ -286,11 +285,7 @@ class BIMModelProperties(PropertyGroup):
prev_transform_orientation_slot_type: bpy.props.StringProperty(name="Previous Gizmo Orientation Type") prev_transform_orientation_slot_type: bpy.props.StringProperty(name="Previous Gizmo Orientation Type")
prev_show_gizmo_object_translate: bpy.props.BoolProperty(name="Previous Gizmo Translate") prev_show_gizmo_object_translate: bpy.props.BoolProperty(name="Previous Gizmo Translate")
show_bounding_box: bpy.props.BoolProperty( show_bounding_box: bpy.props.BoolProperty(name="Measure XYZ Dimensions", default=False, update=update_measure_xyz)
name="Measure XYZ Dimensions",
default=False,
update=update_measure_xyz
)
show_cut_decorator: bpy.props.BoolProperty( show_cut_decorator: bpy.props.BoolProperty(
name="Show Cut Decorator", name="Show Cut Decorator",
default=True, default=True,