Greg Klein's Blog

Archive for the ‘fractal’ Category

T-Square Fractal Cubes

with one comment

If you don’t already know, I like fractals a lot.

A few months ago I was playing around with the T-Square fractal. Recently I decided to revisit this fractal and try to add another dimension. So instead of using squares, I decided that I’d use cubes and make the rules the same. For each free corner on a cube, create another cube and repeat.

So I wrote a small program in Python that creates a scene for Povray (speaking of which, I wasn’t able to find any good libraries for talking to Povray in Python! If anyone knows of such a library, I’d love to know.)

Anyway, here are the results:

T-Cube Fractal

T-Cube fractal iterated 9 deep

I’d love to make a video out of this but I don’t think my budget can afford it right now. The frame you see above you took about an hour or so to render on my laptop. Unless anyone has a cluster they’re willing to lend me, I’ll have to stick to stills for now.

Update 3/26/12:

I decided to 3d print it. Printed on a 3d powder printer at Makers Factory in Santa Cruz.

In order to get it made into a proper 3d file, I actually ended up writing a Python script for Blender, you can find that here. Turns out that scripting Blender is way easier than writing .STL files — just to write a cube you need to define a bunch of vertices’s and get them all in the right order or the normals are screwed up.

And a 3d print of the fractal with only 6 iterations this time.

Update (again) 4/16/12:

I sent away to Shapeways to get it printed in black plastic.

3d printed fractal from Shapeways

Written by gregklein

February 17, 2012 at 5:03 pm

Posted in fractal, math, python

Tagged with

Fun with an HP 7475 Plotter

with one comment

So I got an HP 7475 Plotter used. I’ve been playing with it using a Python library called Chiplotle.

Recently I’ve been making fractals on it. Here’s a Hilbert curve I made:

Hilbert curve on a plotter

Hilbert curves are space filling fractal curves. This means that when iterated to infinity, at no point is there a straight line; thus it is a curve. Very neat!

Iterated deeper this time

In order to get this to work, I wrote a turtle graphics class for the Chiplotle library. If anyone finds this useful, you can grab the code here.

Oh, and here’s a Sierpinski triangle:

A Sierpinski Triangle

Written by gregklein

January 16, 2012 at 9:05 pm

Posted in fractal, math, python

Buddhabrot 4-Dimensional Rotation

leave a comment »

I’ve been playing with fractals recently. More specifically, the Buddhabrot fractal.

The Buddhabrot set is closely related to the Mandelbrot set: Z_{n+1} = Z^2_{n}+C

The mandelbrot set is displayed on the complex plane, where one axis is the real component of C (we’ll call it C_r) and the other is the imaginary component of C (a.k.a C_i).

With the Buddhabrot set, we can add a few more axes. Instead of just using C_i and C_r, we also use the real and imaginary components of Z_0 as axes. Whereas in the Mandelbrot set, Z_0 is assumed to be 0+0i, in our 4D Buddhabrot set, we make these values variable as well.

So instead of the two dimensional image you’re used to seeing of the Mandelbrot set, we’ve instead got 4 axes: C_i, C_r, Z_i, and Z_r.

Which leads us to our next problem — how do you visualise a 4 dimensional object on a computer? Well, it’s difficult. You obviously can’t just draw an image of it, or even just show a 3 dimensional picture of it. Instead, we show it rotation in 4 dimensional space.

So, here’s the result:

I’ve made all of this code open source — here’s the project page.

Written by gregklein

May 16, 2011 at 1:55 am

Posted in fractal