Tori within tori​
​​by J. M.​​
​7/2/2022
Now that
Torus
is a built-in graphics primitive, I decided to revisit an old piece I made where I keep replacing tori with even smaller tori, ultimately resulting in a self-similar structure. I eventually came up with two variations. The original version looked a little like this:
n=3;tr=Table[AffineTransform[{EulerMatrix[{0,t,π/2},{1,3,1}].ScalingMatrix[{1/4,1/4,1/4}],Append[AngleVector[{3,t}],0]}],{t,0,2π-π/8,π/8}];​​tx=Nest[Flatten[Outer[Composition,tr,#,1]]&,tr,n];​​Graphics3D{Directive[Specularity[1,3],ColorData[97,1]],GeometricTransformation[Torus[{0,0,0},{2,4}],N[{#["AffineMatrix"],#["AffineVector"]}]&/@tx]},Boxed->False,Lighting->
lighting settings
,ImageSize->Large
Instead of generating multiple Torus objects, I generate and compose the required list of affine transformations before feeding them to
GeometricTransformation
, which results in something slightly more manageable. I was only successful up to three iterations; attempting to go further seems to be beyond my computer's capabilities.
The other variation shows the large and small tori altogether, and adjusting the opacity so that the larger tori do not obscure the smaller ones. I use less iterations here since going further makes it look cluttered:
n=2;​​txg=Flatten[NestList[Flatten[Outer[Composition,tr,#,1]]&,tr,n]];​​Graphics3D{Directive[Opacity[1/3],ColorData[97,3]],GeometricTransformation[Torus[{0,0,0},{2,4}],Prepend[N[{#["AffineMatrix"],#["AffineVector"]}]&/@txg,{IdentityMatrix[3],ConstantArray[0,3]}]]},Boxed->False,Lighting->
lighting settings
,ImageSize->Large