Projects using CPython and Turtle graphics
- tree_turtle_random2.py This script draws recursively generated trees. A lot of the tree's parameters have random variation.
- truchet_tiles2.py This script shows a series of patterns of Truchet Tiles.The tiles are drawn using the Turtle libary. All patterns are made from 4 different tiles.
- truchet_tiles2_random.py Randomly generated Truchet Tiles using complementery tiles for pleasing result.
- spiral.py An animated spiral effect using Turtle graphics
- turtle_python_logo.py This script defines a fucntion to draw an ellipse using Turtle graphics. Turtle graphics does have a circle function but no ellipse. The ellipse function is then used to draw a python logo suing Turtle graphics.
- sierpinsky_turtle_cpython.py This script draws a Sierpinsky triangle recursively using turtle.
- phyllotaxis2.py This script produces images generated using the Vogel formula coming from the field of Phyllotaxis. It shows combinations of symbols and color sets.
This script draws recursively generated trees.
A lot of the tree's parameters have random variation.
The code uses Turtle graphics for drawing and the timer function.
This script shows a series of patterns of Truchet Tiles.
The tiles are drawn using the Turtle libary. All patters are made from 4 different tiles.
The patterns are defined as rows and columns of tile numbers, for this nested tuples are used:
pattern_X = (
(2,4,3,4,4,2),
(2,1,2,2,4,4),
(3,4,4,2,2,4),
(2,2,4,4,2,1),
(4,2,2,4,3,4),
(4,4,2,1,2,2)
)
Randomly generated Truchet Tiles using complementery tiles for pleasing result.
code of version which loops automatically through random patterns, mouse click stops script:
code of version which saves pattern to text file when key is pressed, loops to next random patterns with mouse click:
An animated spiral effect using Turtle graphics
This script defines a fucntion to draw an ellipse using Turtle graphics.
Turtle graphics does have a circle function but no ellipse.
The ellipse function is then used to draw a python logo suing Turtle graphics.
This script draws a Sierpinsky triangle recursively using turtle.
This one makes use extra functionality in CPython's turtle on the PC, such as drawing filled shapes.
The code shows several triangles using successively deeper recursion.
This script produces images generated using the Vogel formula coming from the field of Phyllotaxis.
φ = n * 137.5
r = c * √n
n: index of element
c: constant
r: radius
φ: azimith
It shows combinations of symbols and color sets.