Name

curveTightness

Examples
# curveTightness 1x -- original fails on map, mouseX
# https://processing.org/reference/curveTightness_.html

settings <- function() {
    size(100, 100, P3D)
}

setup <- function() {
    noFill()
    noLoop()
}

draw <- function() {
    # t <- map(50, 0, width, -5, 5)
    background(204)
    # curveTightness(t)
    
    mycurve(-1)
    translate(0, 10)
    mycurve(0)
    translate(0, 10)
    mycurve(1)
    translate(0, 10)
    mycurve(2)
}

mycurve <- function(tightness) {
    curveTightness(tightness)
    beginShape()
    curveVertex(10, 26)
    curveVertex(10, 26)
    curveVertex(83, 24)
    curveVertex(83, 61)
    curveVertex(25, 65)
    curveVertex(25, 65)
    endShape()
}
Description Modifies the quality of forms created with curve() and curveVertex(). The parameter tightness determines how the curve fits to the vertex points. The value 0.0 is the default value for tightness (this value defines the curves to be Catmull-Rom splines) and the value 1.0 connects all the points with straight lines. Values within the range -5.0 and 5.0 will deform the curves but will leave them recognizable and as values increase in magnitude, they will continue to deform.
Syntax
curveTightness(tightness)
Parameters
tightnessfloat: amount of deformation from the original vertices
Related curve
curveVertex
Creative Commons License