Image_Turtle

Image_Turtle is a image drawing system work with Lindenmayer system. It is made by Kore Nordmann, one of the lead of the Image_3D project. The class is called turtle is because the line drawing item is referred as turtle, like the one in the Logo programming language.
The tree below is generated by this code:

require_once 'Image/Turtle/Memory.php';
$turtle = new Image_Turtle_Memory(array(310, 590), -90);
 
// Configure turtle
$turtle->step = 130; // Width of step forward
$turtle->a = 25; // Angle
$turtle->s = .25; // Buckling
 
// Create and execute the "programm"
$turtle->addRule('w', 'FFF[+F+F+F][-F+F+F+F+F]');
$turtle->addRule('F', 'FFF[+F+F+F][-F+F+F+F+F]');
 
$turtle->setStartRule('w');
 
$turtle->process(3);
 
// Render output
$turtle->render(400, 600, 'tree.png');

Turtle Tree
Here is another image by Image_Turtle
Turtle Standard

Editor Comment:

Kore Nordmann have done a lot of work on image generation. Anyone who wants try out Logo, check out the Logo Class in PHP

Post new comment

The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar. If you have a Gravatar account, used to display your avatar.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <span> <fn>
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.

More information about formatting options

What is 3 + 35?
To combat spam, please solve the math question above.
Honey Pot that kill bots