I have a group glued to ground and a face inclined to a certain degree. I’m looking into rotate group according to face normal (vector) so bottom face of group become perpendicular to inclined face but I’m missing angle parameter or something other… Can you please help me? Thank you!
Thank for your help @eneroth3 but unfortunately this doesn’t solve problem. After transformation group seems well inclined but it is moved to a location different of point. How can I correct this? I tried group.transform!(Geom::Transformation.translation(group_point)) with no luck…
There are some oddities in the API here that could be worth explaining.
transform! honors an objects original position (also a transformation) and moves it from there.
transform= sets the transformation of the object, totally overriding what transformation it already had.
The name move!suggest a relationship to transform! but it is actually much more like transformation= that it just sets a transformation, overriding what was already there. Its difference from transformation= is that it isn’t added to the undo stack, which is useful for animations.
group.move!(Geom::Transformation.translation(ORIGIN)) is geometrically identical to group.transformation = IDENITY as Transformation.translation(ORIGIN) returns an identity transformation. It represents either no movement or the object being aligned with the parent axes, depending on how you apply it.
Since transformation= ignores any existing value when writing the transformation, you could use it only once and skip the previous step of “resetting” the position.