Fixed Distance Brush In p5js

With a little bit of vector math

Erratic Generator
Jan 25 · 7 min read
Custom brush shapes drawn at fixed distance.
Custom brush shapes drawn at fixed distance. Image by Author.

In the last post, I talked about how you can draw a custom path using curveVertex() function in p5js. The question now is what if I do not want to use a continuous line, but instead, I want to use custom shapes as my brush? You know in Photoshop, there are hundreds of different kinds of brushes.