mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Fix #2028. OffsetObjectPlacements can now rotate then move, or vice versa. Warning: new default! Thanks hvn74!
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# IfcPatch - IFC patching utiliy
|
# IfcPatch - IFC patching utiliy
|
||||||
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
|
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
|
||||||
#
|
#
|
||||||
@@ -58,7 +57,13 @@ class Patcher:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
rotation_matrix = self.z_rotation_matrix(math.radians(angle))
|
rotation_matrix = self.z_rotation_matrix(math.radians(angle))
|
||||||
relative_placement.Location.Coordinates = self.multiply_by_matrix(offset_location, rotation_matrix)
|
|
||||||
|
if len(self.args) == 5:
|
||||||
|
# Move then rotate, if you want
|
||||||
|
relative_placement.Location.Coordinates = self.multiply_by_matrix(offset_location, rotation_matrix)
|
||||||
|
else:
|
||||||
|
# Rotate then move, like Solibri
|
||||||
|
pass
|
||||||
|
|
||||||
if placement.RelativePlacement.Axis:
|
if placement.RelativePlacement.Axis:
|
||||||
z_axis = placement.RelativePlacement.Axis.DirectionRatios
|
z_axis = placement.RelativePlacement.Axis.DirectionRatios
|
||||||
|
|||||||
Reference in New Issue
Block a user