Skip to content

Experimenting with pycairo and noise library. Eventually aim to do more complicated shapes.

Notifications You must be signed in to change notification settings

cnfrancis/noisey-shapes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Noisey-shapes

Description
Making the computer draw weird shapes using basic trigonometry and different species of randomness(noise). Will draw more complicated shapes eventually.

The folder images_ contains the shapes drawn by the file main.py. The folder reference_materialcontains visual examples and explanations of Perlin noise implementation and how to use it in Python.

Challenges

I got started by going through A practical guide using Processing by Matt Pearson. The thing is the book shows example and case studies written in processing, a sort of java-like syntax language. My struggles:

  • I use python and fortunately there is this library python-cairo which is documented, but very few example online. So it was fun learning how to use this library.
  • One of the most used function in processing is the noise(). It returns a random value using the Perlin algorithm, (Perlin Noise). Which is quite different from python's randoms functions. Graphs are shown below. If you want to use it you need the Python noise library. Its quite simple to use once you learned how it works!

Random Noise
High variance in output, not ideal for drawing smooth shapes.

img

Perlin Noise
The variance is better looking. Perlin noise in Python is achieved using the noise library, see reference_material for how use it.

img

Libraries

  • numpy
  • python-cairo
  • noise

Note
It's way easier to install all these libraries using conda instead of pip.

Example

ea89c1c7_3_turns.png img

About

Experimenting with pycairo and noise library. Eventually aim to do more complicated shapes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published