Skip to content

awoodthomas/pyart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyArt

A crack at some simple generative art, using PyCairo for illustration. "Turtles" can iteratively draw paths - throwback to one of the first computer science courses I ever took!

snake.py - Turtles that have probabilisticly decide to turn or branch off another turtle. Different thresholds for turning, branching, different starting turtle "seeds", and different turn angles generate very different images!

spiral.py - Turtles that spiral around! Turtles will quickly collide into edges or other spirals. Currently allows "phasing" - where turtles are allowed to pass through boundaries without drawing for a limited number of steps. Idea for the future: have turtles just make a 180 degree turn (with some width) if they hit something...

Setup

Install dependencies using Poetry:

poetry install

Running

poetry run -m python snake.py

Example Images

To start, just some 90 degree turns:

Next, let's go to 45 degree turns. These are some of my favorites. Sparser ones look like metro systems, denser ones look very PCB-esque.

drawing drawing drawing

If we go to 10 degree turns, we get something more like old city streets. Or, if we go to random turn lengths, something more like blood vessels.

drawing drawing drawing

Now let's try some spirals! These turtles are allowed to pass through boundaries until they can resume their spiral.

If we allow branching on spirals, it gets pretty wild. Low branching probabilities makes this a bit more sane.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages