-
-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help understanding shape matrix values #1440
Comments
The transformation matrix is a standard transformation matrix, simply that it is shown as a list instead of a matrix that you might be more familiar with. You can see the mapping here: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/blenderbim/blenderbim/bim/import_ifc.py#L807 When you follow that mapping...
... maps to this:
If you want to convert to its components, such as the Euler rotation angles you seem to be after, you can use Blender's mathutils Matrix to do this easily since you are already experimenting in Blender.
Your code for tags looks fine, assuming Tag is unique, which it doesn't have to be. Perhaps you can elaborate more about what you're doing. By the way, this is not really a bug, so you may be better suited to post this over a https://community.osarch.org/ - that way others can help chip in :) |
Thanks a lot for the help, it's way clearer now ! |
Is there any python library to do the transformation matrix data extractions (scale, rotation, position) ? Actually I'm using Blender only to visualize a BIM file, but I'm working outside of it with only python |
Hi all,
I'm actually trying to read an IFC file with ifcopenshell in order to extract rotation, scale, and location of all walls. My problem here is that I'm absolutely not understanding the matrix values returned by the shapes objects. For example, for a wall with :
rotation (x,y,z) : 0, 0, 180
scale : 1, 1, 1
location ; 8.3, -17.5, 0
When I print shape.transformation.matrix.data I get :
(-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0, 8.382999999999972, -17.5915, 0.0)
So, the 3 last digits are the location, I'm assuming that the 3 previous from that are maybe the scale, because for all my walls it's the same value (I don't really understand why it's 0, 0, 1 for a 1, 1, 1 scale though), and after some research the 6 first digits seems to be related to rotation and orientation but I don't understand in which way.
Example of a second wall :
rotation (x,y,z) : 0, 0, -90
scale : 1, 1, 1
location ; 8.5, -0.4, 0
-> (0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 8.5915, -0.4170000000000275, 0.0)
And one last thing, I'm using BlenderBIM to visualilze the file and I'm using the element's tag to find the walls but I can't seem to find all of them using this technique so I don't know if I4m doing it right.
My code :
The text was updated successfully, but these errors were encountered: