From 34303c2cfe7db3dd7e8c01b57fe611ef4777a0c8 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 28 Jan 2026 23:28:14 +1100 Subject: [PATCH] Revert "fix to https://github.com/IfcOpenShell/IfcOpenShell/commit/7f87f1fb89fb001320223a4d85e6267f342bf13c: have rotation around the object's origin, not the world origin" This reverts commit 249e68f16395b5b273466930dd21ffefc0ac512a. --- src/bonsai/bonsai/bim/module/model/wall.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index 5276e64692..01a2d84b7f 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -578,21 +578,9 @@ class ChangeExtrusionXAngle(bpy.types.Operator, tool.Ifc.Operator): dot_product = expected_new_world_direction.dot(current_world_direction) angle = acos(min(max(dot_product, -1), 1)) - # Rotate around object's own origin - # Decompose the matrix to get translation, rotation, scale - translation, rotation, scale = obj.matrix_world.decompose() - - # Create rotation matrix and convert to quaternion + # Create and apply rotation matrix rotation_matrix = Matrix.Rotation(angle, 4, rotation_axis) - rotation_quat = rotation_matrix.to_quaternion() - - # Apply rotation to existing rotation (quaternion multiplication) - new_rotation = rotation_quat @ rotation - - # Reconstruct matrix_world with same translation, new rotation, same scale - obj.matrix_world = ( - Matrix.Translation(translation) @ new_rotation.to_matrix().to_4x4() @ Matrix.Scale(1, 4) - ) + obj.matrix_world = rotation_matrix @ obj.matrix_world bpy.context.view_layer.update() bonsai.core.geometry.switch_representation(