The Sierpinski Tetrahedron is a 3D fractal. It is constructed by an iterative process, where each level is built up from subcomponents of the previous level.
In the first iteration, you start with a simple tetrahedron, scale it down to one half the size, make four copies, and arrange them in the tetrahedron-like shape pictured below.
The second iteration is the same procedure, only you apply it to the first level tetrahedron. The result is the second level tetrahedron.
At each level, the inside faces are painted a different color. The sequence is red, orange, yellow, green, blue, indigo, and magenta. I think this helps to reveal the structure.
Here is how the fifth level tetrahedron looks.
This plugin will construct the Sierpinski Tetrahedron up to the seventh level. At that point, I ran out of contrasting colors for the inside faces. And it takes over two minutes to generate all the geometry, so it seemed like a good place to quit.
Usage
To run the script, select Sierpinski Tetrahedron from the Draw menu. This brings up a dialog box. Enter the parameter values. Click OK, and place the component in the model.
The outside color was left undefined, and shows up as white by default. You can easily change it by clicking anywhere on the component with the paint bucket.
The colors of the inside faces can also be changed with the paint bucket. Just open the component (double-click with the select tool) first. All the inside faces for a particular level are grouped together as a subcomponent. So, if you click on one inside face with the paint bucket, all the faces in that subcomponent will be painted.
Download
Download the Sierpinski Tetrahedron version 1.0 here: rp_sierpinski_tetrahedron.rb.
To install, move the file rp_sierpinski_tetrahedron.rb to your SketchUp Plugins folder. Restart SketchUp.