Extract Transformation Matrix from Objects.Geometry.Brep

Hi
I have an Objects.Other.BlockInstance object that consists of Objects.Geometry.Brep objects. What I want to do, is to extract a Transformation Matrix from each Objects.Geometry.Brep object (I have a reference object for each Objects.Geometry.Brep with identity Transformation Matrix - the original object that was used to compose the Objects.Other.BlockInstance). Is that possible?
Thanks for help!

1 Like

Hi @Aleksandr_Bulankin , our Objects.Other.BlockInstance object has a transform property of class Objects.Other.Transform. This class contains a Matrix4x4 typed matrix property, which will give you the transform matrix used to transform any geometry found within the BlockDefinition property of your BlockInstance.

Hope this helps!

Thanks for you reply Claire! As far as I understand Objects.Other.Transform is a transformation for the BlockInstance itself, not for it’s children (Objects.Geometry.Brep objects). I am trying to find a way to get a Transform for each of the children, since it is a different transformation for each of them. Is my understanding wrong?

Do you mean the Brep objects are dynamically attached to the Instance, or are they nested instances? If you could link a sample commit with the Instance object that would help, so I can take a look at your data structure :slight_smile:

1 Like

They are nested objects. Actually your reply gave me an idea how to handle that issue - wrap each of them in BlockInstance. Thank you!

1 Like

Great! We just put up some documentation on instances, definitions, and transforms by the way if you’d find that helpful :point_right:Objects Kit | Speckle Docs

1 Like

That looks perfect! Thank you for doing that :slightly_smiling_face: