Techart, Blender, Geometry Node, Procedural, Programming.
top along the x axis, we are scaling along the global x axis. However if the instance was rotated, the local x axis would not be aligned with the global one. We need to first align the two axises. In other words, we need to unrotate the mesh, apply our transformation, then rotate the mesh back to