Cube fractals

Robert Fathauer’s fractal

On May 16th, 2024, Robert Fathauer tweeted a wonderful timelapse video of building a white cube fractal, which you can see below.

When I tried to learn more about this fractal, I found a Mathematica demo called “Shifting Cube Fractal”. I couldn’t get the demo to work quite properly, so I illustrated it myself by writing a Mathematica script to make this video:

Bluesky #MathArtMarch

In March 2025, @ayliean.bsky.social started #MathArtMarch with a list of prompts to use to make new art or post existing art. On Day 12, I saw @curved-ruler.bsky.social‘s cube fractal, and inspired it, Ayliean’s prompt, and Robert Fathauer’s timelapse, I modified the above video to show off some new perspectives.

Day 1 of #MathArtMarch threadHop in and out of the challenge as you please! Do arty maths or mathsy art🌿(I will now attempt to make a thread of today’s delights, but I’m not very Bluesky yet 👇)

Ayliean (@ayliean.bsky.social) 2025-03-02T00:24:40.728Z

#MathArtMarch Day12: On an isometric gridCube fractal

curved-ruler (@curved-ruler.bsky.social) 2025-03-11T19:50:45.081Z

This video has four frames where the sides of the cube are perfectly transparent, and these look very reminiscent of @curved-ruler.bsky.social‘s cube fractal.

Mathematica code

Here’s my quick and dirty Mathematica code used to make the first illustration. If you modify it, show me what you make on Bluesky! (@peterkagey.com)

nextGen[cube_, t_] := (
s = Volume[cube]^(1/3)/2;
c = RegionCentroid[cube];
{
Cube[c + s {1.5, -0.5 + t, -0.5 + t}, s],
Cube[c + s {-1/2 + t, 1.5, -1/2 + t}, s],
Cube[c + s {-0.5 + t, -0.5 + t, 1.5}, s]
}
)
frames = Table[
cubes = {{Cube[]}};
cubes =
Append[cubes,
Flatten[nextGen[#, (Sin[2 \[Pi] t + \[Pi]/4] + 1)/2] & /@
cubes[[-1]]]];
cubes =
Append[cubes,
Flatten[nextGen[#, (Sin[2 \[Pi] t + \[Pi]/4] + 1)/2] & /@
cubes[[-1]]]];
cubes =
Append[cubes,
Flatten[nextGen[#, (Sin[2 \[Pi] t + \[Pi]/4] + 1)/2] & /@
cubes[[-1]]]];
cubes =
Append[cubes,
Flatten[nextGen[#, (Sin[2 \[Pi] t + \[Pi]/4] + 1)/2] & /@
cubes[[-1]]]];
Graphics3D[
Transpose[{Table[
Hue[(3 n)/5 + (Sin[2 \[Pi]*t] + 1)/10], {n, 1, 5}], cubes}],
ViewVector ->
100*{Sin[4 \[Pi]*t - \[Pi]/4], Sin[4 \[Pi]*t - \[Pi]/4],
Sqrt[2] Cos[4 \[Pi]*t - \[Pi]/4]},
ViewVertical -> -{Sin[4 \[Pi]*t + \[Pi]/4],
Sin[4 \[Pi]*t + \[Pi]/4], Sqrt[2] Cos[4 \[Pi]*t + \[Pi]/4]},
ViewAngle -> 0.025,
ImageSize -> {720, 720}, Boxed -> False, Lighting -> "Neutral",
SphericalRegion -> True],
{t, 1/200, 1, 1/200}
]
Export["frame_000.png", frames, "VideoFrames"]

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *