15 YouTube views, likes subscribers in 10 minutes. Free!
Get Free YouTube Subscribers, Views and Likes

Coding Challenge 181: Weighted Voronoi Stippling

Follow
The Coding Train

Stippling is an artistic technique that uses numerous dots to craft an image. In this coding challenge I attempt to implement a weighted Voronoi stippling algorithm with p5.js along with the Delaunay triangulation package from d3.js. Code: https://thecodingtrain.com/challenges...

Watch this video adfree on Nebula https://nebula.tv/videos/codingtrain...

p5.js Web Editor Sketches:
Weighted Voronoi Stippling: https://editor.p5js.org/codingtrain/s...
Circumcircle: https://editor.p5js.org/codingtrain/s...
Delaunay Triangulation: https://editor.p5js.org/codingtrain/s...
Voronoi Diagram: https://editor.p5js.org/codingtrain/s...
Voronoi Phyllotaxis: https://editor.p5js.org/codingtrain/s...
Voronoi Diagram colored by area: https://editor.p5js.org/codingtrain/s...
Lloyd's relaxation: https://editor.p5js.org/codingtrain/s...
Weighted Stippling Size and Color: https://editor.p5js.org/codingtrain/s...
Weighted Stippling Abstract Pattern: https://editor.p5js.org/codingtrain/s...
Weighted Stippling Video: https://editor.p5js.org/codingtrain/s...

Previous:    • Coding Challenge 180: Falling Sand  
All:    • Coding Challenges  

References:
d3delaunay: https://d3js.org/d3delaunay
Weighted Voronoi Stippling: https://www.cs.ubc.ca/labs/imager/tr/...
Sweep Line Algorithm: https://en.wikipedia.org/wiki/Sweep_l...
Lloyd's algorithm: https://en.wikipedia.org/wiki/Lloyd%2...
Polygons and meshes by Paul Bourke: https://paulbourke.net/geometry/polyg...
Pablo Jurado Ruiz:   / pablojuradoruiz  
Stippling: https://en.wikipedia.org/wiki/Stippling
Voronoi Diagram: https://en.wikipedia.org/wiki/Voronoi...
Delaunay Triangulation: https://en.wikipedia.org/wiki/Delauna...
Mike Bostock's Voronoi Stippling: https://observablehq.com/@mbostock/vo...

Videos:
Pixel Array:    • 11.3: The Pixel Array  p5.js Tutorial  

Related Coding Challenges:
C4 Worley Noise:    • Coding Worley Noise  
33 Poissondisc Sampling:    • Coding Challenge #33: Poissondisc Sa...  

Timestamps:
0:00 Hello!
0:37 What is a Delaunay triangulation?
2:31 d3delaunay package
2:49 Coding the delaunay triangulation.
6:38 What is a Voronoi diagram?
9:17 voronoi function on the delaunay object
10:25 Things you could try with the Voronoi diagram
10:56 Lloyd's "relaxation" algorithm
12:07 Calculate the average of a polygon's vertices
15:30 Calculate the area of a polygon
16:45 Calculate the proper centroid of a polygon
18:47 What is stippling?
19:45 Draw dots based on brightness value of pixel
21:50 Calculate a weighted centroid
24:51 Using delaunay.find()
27:52 Ideas for you to try!
28:47 Goodbye!

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

Website: https://thecodingtrain.com/
Share Your Creation! https://thecodingtrain.com/guides/pas...
Suggest Topics: https://github.com/CodingTrain/Sugges...
GitHub: https://github.com/CodingTrain
Discord: https://thecodingtrain.com/discord
Membership: http://youtube.com/thecodingtrain/join
Store: https://standard.tv/codingtrain
Twitter:   / thecodingtrain  
Instagram:   / the.coding.train  

Coding Challenges:    • Coding Challenges  
Intro to Programming:    • Start learning here!  

p5.js: https://p5js.org
p5.js Web Editor: https://editor.p5js.org/
Processing: https://processing.org

Code of Conduct: https://github.com/CodingTrain/Codeo...

This description was autogenerated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#delaunaytriangulation #imagestippling #voronoi #sweepalgorithm #lloydsalgorithm #p5js #javascript

posted by yasabwenr