MUTABLE KOCH-SNOWFLAKE
The recursive algorithm shown here is based on that of a Koch-snowflake. The base-principle beeing that it starts with an
equilateral triangle and places another equilateral triangle in the middle third of every line with every iteration.
While doing so, the initial middle third of the original line is deleted and the outwards edge of the newly placed triangle
becomes part of the new circumference of the object. This leads to the interesting observation that the surface area
of the Koch snowflake is finite, while the circumference is infinite.
I experimented with the parameters for the snowflake and decided to not only let the algorithm place the new triangles on
the outside of the existing ones, but to have predefined vectors in the code that place the triangles on both sides of the base
geometry. With increasing iterations, this creates quite interesting patterns, and opens up the possibility to change the vectors
defined in the code to create an infinite amount of Koch-Snowflake inspired patterns.
The code for the variable Koch-Snowflake starts with the definition of different lists beeing used to store the point vectors during the iterative process
and a dictionary containing variables that can be altered to easily influence the structure. Also the start geometry, an eqilateral triangle, is created here.
From here the main three functions responsible for generating and displaying the geometry are called. The system-function mainly contains an if statement,
which calls the generate-function as long as the predefined maximum amount of iterations is not yet reached. Inside the generate-function the main part of the
geometry generation is happening. The function starts with a list of every point making up the existing lines. Now two neighbouring point-vectors
representing a line between them are paired together by an for-loop. For every single one of these point-pairs their connecting vector is now split into three parts
the middle part is taken out and insted a equilateral triangle with sides one third as long as the original connecting vector is placed here.
When the maximum amount of iterations is reached, a list containing all the geometries points in te right order is sent to the draw-function which then generates
a closed line through the generated points.
Klick and drag on the geometry to turn or move it, scroll to zoom in. This is 7 iterations of the afformentioned process.
A GUI to change the iterations and shape is currently in developement.