Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AlexandrePerez/Spyral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spyral

Draw some cool spirals!

The goal

With Spyral you can draw cool and mesmerizing spirals!

Note: this is a work in progress, done quickly. There is plenty of room for improvement. So feel free to make some changes and improve this project :)

How it works

  1. Make convex polygons:

    1. Generate N random points (seeds)
    2. Get the Voronoi diagram from the seeds (see scipy)
    3. Get a set of vertices and regions (linked vertices) from the Voronoi diagram
  2. Draw spirals inside each polygon (region) generated:

    Do the follwing until a stop condition is true:

    1. Draw a line from one polygon's vertex to another.
    2. Move the vertex along the edge so that it is closer to the next vertex.
    3. Move to next vertex.

Example

Generate a 1500*500 banner:

raw_image(width=1500, height=500)

output : colored image

Generate a 1500*500 black and white banner:

raw_image(width=1500, height=500, color=(0, 0, 0)

output : black and white image

About

Draw some cool spirals!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages