From 4cf896f564c0b7bf4d3fcd7eb7273c9c075bdff4 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 11 Jan 2023 17:05:02 +1100 Subject: [PATCH] Fix bug where half space booleans didn't show in the right spot due to units --- src/blenderbim/blenderbim/bim/module/model/opening.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/model/opening.py b/src/blenderbim/blenderbim/bim/module/model/opening.py index 0de676848a..ff2c3c4276 100644 --- a/src/blenderbim/blenderbim/bim/module/model/opening.py +++ b/src/blenderbim/blenderbim/bim/module/model/opening.py @@ -442,6 +442,7 @@ class ShowBooleans(Operator, tool.Ifc.Operator, AddObjectHelper): or not obj.data.BIMMeshProperties.ifc_definition_id ): return {"FINISHED"} + unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) representation = tool.Ifc.get().by_id(obj.data.BIMMeshProperties.ifc_definition_id) booleans = [] for item in representation.Items: @@ -458,6 +459,9 @@ class ShowBooleans(Operator, tool.Ifc.Operator, AddObjectHelper): boolean_obj = self.create_half_space_solid() position = boolean.BaseSurface.Position position = Matrix(ifcopenshell.util.placement.get_axis2placement(position).tolist()) + position[0][3] *= unit_scale + position[1][3] *= unit_scale + position[2][3] *= unit_scale boolean_obj.matrix_world = obj.matrix_world @ position else: settings = ifcopenshell.geom.settings()