I've been bashing my head for the past couple of weeks trying to find algorithms that would help me accomplish, on first look very easy task. So, I got this one object currently made out of 5 cuboids (2 sides, 1 top, 1 bottom, 1 back), this is just for an example, later on there will be whole range of different set ups. I have included three pictures of this object(as said this is just for an example). Now, the thing is when the user scales the whole object this is what should happen:
X scale: top and bottom cuboids should get scaled by a scale factor, sides should get moved so they are positioned just like they were before(in this case at both ends of top and bottom cuboids), back should get scaled so it fits like before(if I simply scale it by a scale factor it will leave gaps on each side).
Y scale: sides should get scaled by a scale factor, top and bottom cuboid should get moved, and back should also get scaled.
Z scale: sides, top and bottom cuboids should get scaled, back should get moved.
Here is an image of the example object (a thick walled box, with one face missing, where each wall is made by a cuboid):
Front of the object:
Hope you can help,