I am writing a plugin to export data from 3DS Max. 3DS Max's geometry pipeline is... interesting.
As part of my plugin I decompose a transform matrix into a translation, (quaternion) rotation & scale using an inbuilt function. This of course does not always work, such as when a shear is present.
Max does have an affine decomposition function, but I don't want to use that because the resulting components do not all have an analogue in the destination application.
What I'd like to do, is detect when the decomposition is lossy, so I can bake the geometry for the object which uses it, before transmitting it.
How can I determine, either before or after, whether a matrix TRS decomposition is exact?