I don't have any code right now, I will once I have access to it though, which should be in a couple of days.
The general procedure works like this though.
Before anything else, I store the initial orientation by making an axes type Transformation. Something like this if memory serves well :
xaxis_ = cInst.transformation.xaxis yaxis_ = cInst.transformation.yaxis zaxis_ = cInst.transformation.zaxis @transform = Geom;;Transformation.axes(Geom;;Point3d.new(0,0,0),Geom;;Vector3d.new(xaxis_.x,xaxis_.y,xaxis_.z),Geom;;Vector3d.new(yaxis_.x,yaxis_.y,yaxis_.z),Geom;;Vector3d.new(zaxis_.x,zaxis_.y,zaxis_.z))The translations to move to and from the origin are created using the center of the bounds of the component.
The origin to object axes are also calculated with an axes type Transformation. I use the inverse to return from global to local.
The rotation part of the external transformation is created from an array, with indices 3, 7, 11, 12, 13, 14 set to 0 and index 15 set to 1. Said array comes from extracting numbers from a string. I thought there might be some bug or some accuracy loss here, but it's a double to float conversion on mostly small numbers, and checking the orthogonality of the rotation component gives no error before the 12th digit.
The translation part (which is global, not relative to the component, btw) is used to make a vector used to make a Transformation. I've had the skewing even when this was 0, though.
And then it goes like this :
-Store initial transformation.
When transformation is received :
-move to origin
-switch from object to origin axes
-Compensate the initial transformation if there is one.
-Apply rotation
-apply the inverse of the initial transformation
-go to object axes
-Apply translation (global)
-Move back from the origin
Granted, it's not the best workflow. However, given the accuracy I seem to have on the sole matrix that isn't created within SU, I don't understand how the skewing happens, particularly when multiplying all these external matrices together yields an error that is so tiny.