[Triangle

The above picture was generated by povray using the sierpyr program with DEPTH = 3 and RADIUS = 0.01.

A while ago, can't quite remember when, I was interested in fractals and decided to expand the sierpinsky gasket into 3 dimensions. The first attempt, which the above picture comes from, was a C program that generated povray code. Since then it's been ported to a few other formats, some of which might show up here.

C source to generate povray include file.
DEPTH determines how many levels of recursion to do. 1 is just the outside pyramid, 2 has 4 sub pyramids, etc. RADIUS determines the radius of the cylinders that draw the fractal. The include file defines the object SierPyr.
PovRay include files for the triangle at depths: 1, 2, 3, and 4.
Here are PovRay include files for the pyramid at various depths. (RADIUS = 0.01)
Sample povray file
This is a sample povray file to draw the pyramid.
Tar-Gzip Archive
Here are all the files above, plus the picture, in a tar-gzip archive.