The curveTightness() function in p5.js is used to modify the quality of curves created using the curve() and curveVertex() functions. The tightness parameter is used to define how the curve would fit its vertex points. The default value of tightness for a curve is 0.0 and the value of 1.0 connects all the points with straight lines.
The tightness value can range from -5.0 to 5.0, with the higher values deforming the curve more, while still leaving them recognizable.
curveTightness( amount )
Parameters: This function accepts one parameter as mentioned above and described below:
- amount: It is a number that specifies the amount that the curve would be deformed from its original vertices. This value ranges from -5.0 to 5.0.
Examples below illustrates the curvePoint() function in p5.js:
Online editor: https://editor.p5js.org/
Environment Setup: https://www.geeksforgeeks.org/p5-js-soundfile-object-installation-and-methods/