Calculating volume - apply transformation of a parent to a child

Hi! I want to get a volume of a child group inside of a parent group. The parent group is scaled. How to get the volume of the child group taking in to account parent’s transformation? I know that it can be easily done for areas, like this: scaled_child_area=child.area(parent_transformation). But I don’t see any similarly easy method for volumes.

Please use the forum search feature on this category before opening new topics.

There are probably other topics as well.

2 Likes

Hi! Thanks for you reply. I’m looking in to it since. Cheers

Almost but not quite. You must extract the upper left 3x3 matrix from the 4x4 that SketchUp’s Tr ansformation class uses. The rightmost (4th) column contains the offset of the instance’s origin, which has no effect on scaling. Also, the 16th element of the Transformation may contain an additional scale factor instead of 1. That must be checked and accounted for.

2 Likes