TurtleP3D is a simple 3D Turtle library for Processing, that enables the creation complex recursive forms such as this Hilbert curve


(click and drag)

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

Source code: TurtleP3D_hilbert_example


To use it just download this file and unzip it. copy the TurtleP3D directory into the libraries folder of your Processing sketchbook. Follow this link for more info on installing processing libraries.

There are a couple of examples in the folder to get you started. I think that there are other libraries out there that do this and much more but when I was working on data sculpted plants I needed something really basic, and after ages of messing around I finally found this great project by Marek Paterczyk and turned it into this Processing library.

The library has most of the basic functions as described in Ableson and diSessa's great book Turtle Geometry including:

forward();
yaw();
Pitch();
roll();
Push();
pop();
but no penUp(); or penDown();

The main change to Marek's code was to add a buffer which is an arrayList filled with the turtles points. To draw the turtle I added a method called render(); which itterates through the buffer and draws lines within the Processing sketch. I needed to draw into the Processing sketch and send the turtles path to my RepRap so this seemed like the best solution.

If you use it and can think of ways it can be developed please let me know.
Enjoy.