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


Comments

Post new comment

  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <span> <fn>
  • Lines and paragraphs break automatically.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Mathematical equations and graphs can be added between [tex] and [/tex], [graph] and [/graph] tags.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
  _       _   _   _       __  __    ___          
| | | | | | | |__ | \/ | / _ \ _ __
| | | |_| | | '_ \ | |\/| | | | | | | '_ \
| |___ | _ | | | | | | | | | | |_| | | | | |
|_____| |_| |_| |_| |_| |_| |_| \__\_\ |_| |_|
Enter the code depicted in ASCII art style.
Honey Pot that kill bots