Alexandre B A Villares


Arc, tangents & Bezier studies

sketch_2020_09_26a

from sketch-a-day project, sketch_2020_09_26a

This repository contains the product of my studies trying to work with arcs, bezier approximations of arcs and tangents. Most functions were made initially on Processing Python mode and now work with py5. Some will work with pyp5js too, and I have ported b_arc for Processing Java and p5js. You are welcome to help porting more stuff!

I have added very little new ideas here, you can look at the findings & previous studies I moved into the PRIOR_ART folder. I tried to attribute stuff with links.

Please note that the most recent (and maybe unstable?) version of the Python functions shown here are kept at this other repository: github.com/villares/villares. You will probably want to get arcs.py and line_geometry.py it depends on.

Bezier approximation of an arc

Processing PShape insfrastructure (and Py5hape that depends on it) does not contain a fuction for embeding an arc in a larger polyline shape. The b_arc function provided here can be used inside beginShape()/endShape() as a kind of “arcVertex” (which doesn’t exist). It follows mostly the Processing arc signature, but does not include PIE and CHORD modes. You can find demos at:

More arcs and the first tangents

Other functions based on b_arc, and a polygonal approximation called p_arc, are kept at arcs.py.

Filleted polygons and nice shapes that can wrap circles

Perhaps the bigest motivation for starting the studies in this repository, next, we have some functions that povide continous poly-based shapes with tangent arcs.


Please open an issue if you have a question. Consider supporting the author, Alexandre B A Villares, at gumroad.com/villares.