Published On Feb 22, 2024
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 ad-free 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:
š d3-delaunay: https://d3js.org/d3-delaunay
š 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 Poisson-disc Sampling: Ā Ā Ā ā¢Ā CodingĀ ChallengeĀ #33:Ā Poisson-discĀ Sa...Ā Ā
Timestamps:
0:00 Hello!
0:37 What is a Delaunay triangulation?
2:31 d3-delaunay 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/Code-o...
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...
#delaunaytriangulation #imagestippling #voronoi #sweepalgorithm #lloydsalgorithm #p5js #javascript