## Fun, oh fun: Menger sponges

### Fun, oh fun: Menger sponges

Hello,

I've made a Sierpinski pyramid with the help of the macro "Sierpinski Triangle
in 3D by Anders Haglund" and two (haven't tried 4 yet) while loops. Some
overlapping occurs(two pyramids in the exact spot), but its not significant.

The macro is making an iteration 10 pyramid which I use to make bigger pyramids
(ie, I cheat higher iterations).

Each while loop goes from 0 to 4. I use a few thousand of these uber-pyramids,
they only use very little memory.

What I want to know consists of the following:
1) What is the equation for the Cube Menger sponge?
2) If at iteration2  25 pyramids are used in the base pyramid, and 25 of those
are used to create one larger which is used 25 times to make the last pyramid,
what is the equivilent iteration level when I use base pyramid iteration 10?

I'll give my source if it is wanted, but I suspect it is nothing special.

Thanks! ian

Hey Guys,

I'm trying to implement a box filter line drawing algorithm and i'm
having some difficulties. basically my problem is with finding the
area under a 1-pixel wide line. usually in the worst case it cover 3
adjacent pixels at given x coordinate that is on the line segment.

i'm wondering if there is a general formula based on the angle the
line intersects the pixels giving the area.

maybe i'm way off track here.. can anyone help?

another thought i had was to draw line segments between all the
intersection points of the 1-pixel wide line and a given x value..
this would split up the area into triangles.. and then using the cross
product to calculate the areas and add them up,, but this seems to me
a wasteful way of doing it..

any input would be greatly appreciated..

thanks