Inverse in transformation

hi, what is inverse method in transformation? why inverse method make
entity move to [0,0,0] coordinate in below code?

enty= Sketchup.active_model.entities.first
@trr = enty.transformation
enty.transform! @trr.inverse

The transformation includes rotation, scaling, and translation (offset). Its inverse reverses all three. So yes, it will move the object back to the origin. You could use ThomThom’s Transformation inspector to see how the original and inverse transformations are related.


The transform! method applies the argument to the entity’s transformation to update it. Multiplying a transformation by its inverse results in the identity transformation. It is like multiplying a number by its reciprocal results in 1. Changing the entity’s transformation to identity results in the following:

  • The entity is descaled (all scale factors at 1.0);

  • It is de-rotated, with its internal axes parallel to the world axes, like it was just after it was grouped; and

  • Its origin is set coordinates 0,0,0.