From 2e70544bb859b764c3a462ef0bf4d86a4885f8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Wed, 29 Jan 2025 13:57:44 -0300 Subject: [PATCH] Adjust offset in "change_extrusion_x_angle" to maintain position relative to the slab's top face. --- src/bonsai/bonsai/bim/module/model/wall.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index 6b36977eaf..ed22980926 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -262,6 +262,11 @@ class ChangeExtrusionXAngle(bpy.types.Operator, tool.Ifc.Operator): x, y, z = extrusion.ExtrudedDirection.DirectionRatios layer_params = tool.Model.get_material_layer_parameters(element) offset = layer_params["offset"] + + # Change offset to keep the position in relation to the top face of the slab + # The x_angle changes the slab vertical depth, so we have to adapt the offset accordingly + offset -= (extrusion.Depth - perpendicular_depth) * unit_scale + offset_vector = Vector((0.0, 0.0, offset / unit_scale)) if layer_params["direction_sense"] == "NEGATIVE":