how to edit object rotation of an object in ifcopenshell
Hi,
I was looking to change the rotation of an object in ifcopenshell
.
I have seen post in which the placement.get_local_placement(ifcelement.ObjectPlacement)
is decomposed to location, rotation and scale with mathutils
Now, what kind of matrix transformation do I do for the rotation of the object. Is it done through ifcopenshell.api.geometry.edit_object_placement
?
Any pointers or code references would help. Thanks
Tagged:
Comments
edit_object_placement
is the correct API function to use. It expects a 4x4 matrix. This is a standard 4x4 matrix used throughout computer graphics: https://en.wikipedia.org/wiki/Transformation_matrixYou can see the 4x4 matrix also documented here: https://blenderbim.org/docs-python/ifcopenshell-python/geometry_processing.html
Thanks Moult
Hi @Moult,
I have tried a test on object rotation and its working perfectly. below is my code and the screenshot from BB.
I was wondering if this is the correct way of doing the rotation. I have made a 3x3 matrix and then converted into a 4x4 by adding additional col and row and I dont think this is the right approach :(. Is this 4x4 matrix a quaternion?
Also, I observed that I was loosing the existing translation or rotation and that I have to mention all the existing translations and rotations again. How do I only apply the new rotation to the object with existing rotation/translation?