# Evaluation of Graphics3D transforms [duplicate]

I want to find the centroid of a graphics primitive after a series of rotation and translation transforms. But it seems that graphics transforms don't "evaluate". For example, FullForm[Graphics3D[Translate[Sphere[{0, 0, 0}], {1, 0, 0}]]] returns unevaluated. So DiscretizeGraphics[Graphics3D[Translate[Sphere[{0, 0, 0}], {1, 0, 0}]]] command does not work. I also tried DiscretizeGraphics[Graphics3D[GeometricTransformation[Sphere[{0, 0, 0}],TranslationTransform[{1, 0, 0}]]]], it also doesn't work. Is there a geometric transform function that explicitly transforms the coordinates of the graphics objects?

It is easy to miss, but in the documentation for GeometricTransformation it says

Normal[expr] if possible replaces all GeometricTransformation[Subscript[g, i],\[Ellipsis]] constructs by versions of the Subscript[g, i] in which the coordinates have explicitly been transformed.

so in this case you have

In:= Normal@
GeometricTransformation[Sphere[{0, 0, 0}],
TranslationTransform[{1, 0, 0}]]

Out= Sphere[{1, 0, 0}, 1]


Note it isn't too difficult to find GeometricTransformation expressions that do not convert via Normal, so I guess that "if possible" comes into play there.

• That works for translation, but already for rotation of a cube it doesn't seem to. FullForm[Normal[ Graphics3D[ GeometricTransformation[Cuboid[{0, 0, 0}, {1, 1, 1}], RotationMatrix[Pi/4, {1, 0, 0}]]]]] – Mike R Jun 24 at 13:46
• @MikeR - use RotationTransform instead of RotationMatrix, but it still fails. What seems to work in that case is TransformedRegion[Cuboid[{0, 0, 0}, {1, 1, 1}], RotationTransform[Pi/4, {1, 0, 0}]] – Jason B. Jun 24 at 14:18
• Yes, that works! Also works for several sequential transforms, which is what I was looking for. – Mike R Jun 24 at 14:35

You could use my NormalizeGraphics function for this:

NormalizeGraphics @ Graphics3D[Translate[Sphere[{0,0,0}],{1,0,0}]] //InputForm


Graphics3D[Sphere[{1, 0, 0}, 1]]