Package net.paulhertz.pixelaudio.curves

# Class PACurveUtility

java.lang.Object
net.paulhertz.pixelaudio.curves.PACurveUtility

public class PACurveUtility extends Object

A class to maintain static versions of point reduction and curve-modeling methods. Called by PACurveMaker and other curve-modeling applications. Includes an implementation of the Ramer-Douglas-Peucker (RDP) point reduction algorithm, Bezier curve generation methods, and a simple brush stroke modeling method.

Drawing methods are supplied to simplify drawing calls for the objects generated by PACurveUtility and PACurveMaker. The curve and shape drawing methods in particular can be handled by the PABezShape class, which has its own fill and stroke properties for curves (Bezier paths with no fill) and shapes (Bezier paths that may be filled), which are not distinguished within PABezShape. When stroke, fill, and weight are supplied in method arguments for PABezShape instances, the methods will call PABezShape's drawQuick() methods, which use the current drawing context to determine fill, stroke, and weight properties.

See Also:
  - https://thecodingtrain.com/CodingChallenges/152-rdp-algorithm.html
  - http://www.particleincell.com/2012/bezier-splines/
  - https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `private`
  `PACurveUtility()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `applyTransformToCurve(PACurveMaker curve, GestureTransformState state)`
  Applies a GestureTransformState to a PACurveMaker using the curve's live dragPoints.
  `static float[]`
  `bounds(ArrayList<processing.core.PVector> points)`
  Calculates the boundary rectangle of a list of points and returns it as an array of floats.
  `static GestureSchedule`
  `buildScheduleFromBezShape(PABezShape shape, int steps, float[] anchorTimesMs, boolean arcLengthTime)`
  Schedules times along a gestural curve, typically stored as a PACurveMaker instance.
  `static PABezShape`
  `calculateCurve(ArrayList<processing.core.PVector> framePoints)`
  Creates a Bezier curve from a supplied set of points.
  `static PABezShape`
  `calculateWeightedCurve(ArrayList<processing.core.PVector> framePoints, float bias)`
  `static void`
  `calculateWeightedCurve(PABezShape bezPoints)`
  Scales the position of the curve control points on a Bezier curve by a factor determined by the length of the line between the two anchor points and a bias value, such as PACurveUtility.LAMBDA (the default, in this method).
  `static PABezShape`
  `calculateWeightedCurve(PABezShape bezPoints, float bias)`
  Scales the position of the curve control points on a Bezier curve by a factor determined by the length of the line between the two anchor points and a bias value, such as PACurveUtility.LAMBDA.
  `(package private) static void`
  `computeControlPoints(float[] K, float[] p1, float[] p2)`
  `static void`
  `curveDraw(processing.core.PApplet parent, PABezShape curve)`
  Draws a Bezier path in a PApplet using 2D curve data and the local stroke color and weight of a PABezShape.
  `static void`
  `curveDraw(processing.core.PApplet parent, PABezShape curve, int curveColor, float curveWeight)`
  Draws a Bezier path in a PApplet using 2D curve data and supplied stroke color and weight.
  `static void`
  `curveDraw(processing.core.PGraphics pg, PABezShape curve)`
  Draws a Bezier path in a PGraphics using 2D curve data and local stroke color and weight of a PABezShape.
  `static void`
  `curveDraw(processing.core.PGraphics pg, PABezShape curve, int curveColor, float curveWeight)`
  Draws a Bezier path in a PGraphics using 2D curve data and supplied stroke color and weight.
  `(package private) static int`
  `findFurthest(ArrayList<processing.core.PVector> points, int a, int b, float epsilon)`
  `static processing.core.PVector`
  `flipHorizontal(float x, float y, float xctr)`
  `static processing.core.PVector`
  `flipVertical(float x, float y, float yctr)`
  `static processing.core.PVector`
  `getBoundsCenter(ArrayList<processing.core.PVector> points)`
  `static void`
  `indexedRDP(int startIndex, int endIndex, ArrayList<processing.core.PVector> allPoints, ArrayList<processing.core.PVector> rdpPoints, ArrayList<Integer> rdpIndices, float epsilon)`
  Ramer-Douglas-Peucker point reduction algorithm (RDP), reduces points in allPoints and returns the result in rdpPoints.
  `static float[]`
  `intsToFloats(int[] src)`
  `static float[]`
  `intsToFloats(int[] src, int targetLen)`
  `private static float`
  `lerp(float a, float b, float u)`
  * ---------------- UTILITY ------------------ * *
  `(package private) static float`
  `lineDist(processing.core.PVector c, processing.core.PVector a, processing.core.PVector b)`
  `static void`
  `lineDraw(processing.core.PApplet parent, ArrayList<processing.core.PVector> points, int lineColor, float lineWeight)`
  Draws a line in a PApplet context using the PVector data in points and supplied color and weight.
  `static void`
  `lineDraw(processing.core.PGraphics pg, ArrayList<processing.core.PVector> points, int lineColor, float lineWeight)`
  Draws a line in a PGraphics using the 2D PVector data and supplied color and weight.
  `static processing.core.PVector`
  `normalAtPoint(processing.core.PVector a1, processing.core.PVector a2, float u, float d)`
  Calculates a normal to a line at a point on the line at parametric distance u, normalized if d = 1.
  `static float`
  `pathLength(List<processing.core.PVector> points)`
  `static void`
  `pointsDraw(processing.core.PApplet parent, ArrayList<processing.core.PVector> points, int pointColor, float diameter)`
  Draws circular points in a PApplet context using the PVector data and supplied color and diameter.
  `static void`
  `pointsDraw(processing.core.PGraphics pg, ArrayList<processing.core.PVector> points, int pointColor, float diameter)`
  Draws circular points in a PGraphics context using the PVector data and supplied color and diameter.
  `static PABezShape`
  `quickBrushShape(ArrayList<processing.core.PVector> points, float brushWidth)`
  `static PABezShape`
  `quickBrushShape(ArrayList<processing.core.PVector> points, float brushWidth, boolean isDrawWeighted, float bias)`
  Simulates a brush stroke as a PABezShape object by creating two Bezier curves offset on either side of a supplied list of 2D PVector objects and joining them into a closed shape with pointed ends.
  `static PABezShape`
  `quickBrushShape(ArrayList<processing.core.PVector> points, float brushWidth, float bias)`
  `static void`
  `rdp(int startIndex, int endIndex, ArrayList<processing.core.PVector> allPoints, ArrayList<processing.core.PVector> rdpPoints, float epsilon)`
  Ramer-Douglas-Peucker point reduction algorithm (RDP), reduces points in allPoints and returns the result in rdpPoints.
  `static void`
  `restoreCurveRestPoints(PACurveMaker curve, GestureTransformState state)`
  Restores curve points from state.restPoints, if present.
  `static void`
  `reverseArray(ArrayList<processing.core.PVector> arr, int l, int r)`
  Reverses the order of a portion of an ArrayList of PVector objects, between indices l and r, inclusive.
  `static processing.core.PVector`
  `rotateCoordAroundPoint(float x, float y, float xctr, float yctr, float theta)`
  Rotates a point theta radians around a point (xctr, yctr), returns a new point.
  `void`
  `rotatePoints(ArrayList<processing.core.PVector> points, float xctr, float yctr, float theta)`
  Rotates this shape around a supplied center point, in place.
  `static ArrayList<processing.core.PVector>`
  `rotatePointsCopy(ArrayList<processing.core.PVector> points, float xctr, float yctr, float theta)`
  Rotates this shape around a supplied center point, returning a new list.
  `(package private) static processing.core.PVector`
  `scalarProjection(processing.core.PVector p, processing.core.PVector a, processing.core.PVector b)`
  `static processing.core.PVector`
  `scaleCoordAroundPoint(float x, float y, float xScale, float yScale, float xctr, float yctr)`
  Scales a point by xScale and yScale around a point (xctr, yctr), returns a new point.
  `static processing.core.PVector`
  `scaledNormalAtPoint(processing.core.PVector anchor, processing.core.PVector normal, float d)`
  `void`
  `scalePoints(ArrayList<processing.core.PVector> points, float xScale, float yScale, float x0, float y0)`
  Scales points around a given point, in place.
  `static ArrayList<processing.core.PVector>`
  `scalePointsCopy(ArrayList<processing.core.PVector> points, float xScale, float yScale, float x0, float y0)`
  Scales points around a given point, returning a new list.
  `static void`
  `shapeDraw(processing.core.PApplet parent, PABezShape shape)`
  Draws a PABezShape in a PApplet using local fill, stroke, and weight of the shape.
  `static void`
  `shapeDraw(processing.core.PApplet parent, PABezShape shape, int shapeFill, int shapeStroke, float shapeWeight)`
  Draws a PABezShape in a PApplet using supplied fill, stroke, and weight.
  `static void`
  `shapeDraw(processing.core.PGraphics pg, PABezShape shape)`
  Draws a PABezShape in a PGraphics using local fill, stroke, and weight of the shape.
  `static void`
  `shapeDraw(processing.core.PGraphics pg, PABezShape shape, int shapeFill, int shapeStroke, float shapeWeight)`
  Draws a PABezShape in a PGraphics using supplied fill, stroke, and weight.
  `static processing.core.PVector`
  `transformCoord(float x, float y, float xctr, float yctr, float scaleX, float scaleY, boolean flipHorizontal, boolean flipVertical, float theta, float xTrans, float yTrans)`
  Applies flip/scale, then rotation, then translation to a point.
  `static void`
  `transformPoints(ArrayList<processing.core.PVector> points, float xctr, float yctr, float scaleX, float scaleY, boolean flipHorizontal, boolean flipVertical, float theta, float xTrans, float yTrans)`
  Applies flip/scale, then rotation, then translation to a point.
  `static ArrayList<processing.core.PVector>`
  `transformPointsCopy(ArrayList<processing.core.PVector> points, float xctr, float yctr, float scaleX, float scaleY, boolean flipHorizontal, boolean flipVertical, float theta, float xTrans, float yTrans)`
  Applies flip/scale, then rotation, then translation to a point.
  `static processing.core.PVector`
  `translateCoord(float x, float y, float xOffset, float yOffset)`
  Translates a point by xOffset and yOffset, returns a new point.
  `void`
  `translatePoints(ArrayList<processing.core.PVector> points, float xTrans, float yTrans)`
  Translates points in x and y directions, in place.
  `static ArrayList<processing.core.PVector>`
  `translatePointsCopy(ArrayList<processing.core.PVector> points, float xTrans, float yTrans)`
  Translates points in x and y directions, returning a new list.
  `static processing.core.PVector`
  `weightedControlVec(float ax, float ay, float cx, float cy, float w, float d)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PACurveUtility

    private PACurveUtility()

- ## Method Details

  - ### rdp

    public static void rdp(int startIndex, int endIndex, ArrayList<processing.core.PVector> allPoints, ArrayList<processing.core.PVector> rdpPoints, float epsilon)
    Ramer-Douglas-Peucker point reduction algorithm (RDP), reduces points in allPoints and returns the result in rdpPoints.
    Parameters:
      `startIndex` - start index in allPoints (usually 0 to begin with)
      `endIndex` - end index in allPoints (usually allPoints.size()-1 to begin with)
      `allPoints` - ArrayList of dense points, for example a hand-drawn line
      `rdpPoints` - an empty ArrayList for accumulating reduced points
      `epsilon` - the expected distance between reduced points

  - ### indexedRDP

    public static void indexedRDP(int startIndex, int endIndex, ArrayList<processing.core.PVector> allPoints, ArrayList<processing.core.PVector> rdpPoints, ArrayList<Integer> rdpIndices, float epsilon)
    Ramer-Douglas-Peucker point reduction algorithm (RDP), reduces points in allPoints and returns the result in rdpPoints.
    Parameters:
      `startIndex` - start index in allPoints (usually 0 to begin with)
      `endIndex` - end index in allPoints (usually allPoints.size()-1 to begin with)
      `allPoints` - ArrayList of dense points, for example a hand-drawn line
      `rdpPoints` - an empty ArrayList for accumulating reduced points
      `epsilon` - the expected distance between reduced points

  - ### findFurthest

    static int findFurthest(ArrayList<processing.core.PVector> points, int a, int b, float epsilon)
    Parameters:
      `points` - a list of points to evaluate
      `a` - start index in points
      `b` - end index in points
      `epsilon` - expected distance between reduced points
    Returns:

  - ### lineDist

    static float lineDist(processing.core.PVector c, processing.core.PVector a, processing.core.PVector b)

  - ### scalarProjection

    static processing.core.PVector scalarProjection(processing.core.PVector p, processing.core.PVector a, processing.core.PVector b)

  - ### calculateCurve

    public static PABezShape calculateCurve(ArrayList<processing.core.PVector> framePoints)
    Creates a Bezier curve from a supplied set of points.
    Parameters:
      `framePoints` - An array of 2D PVector objects representing the points a Bezier curve will traverse
    Returns:
      A Bezier curve path constructed of PABezShape objects

  - ### computeControlPoints

    static void computeControlPoints(float[] K, float[] p1, float[] p2)

  - ### calculateWeightedCurve

    public static PABezShape calculateWeightedCurve(PABezShape bezPoints, float bias)
    Scales the position of the curve control points on a Bezier curve by a factor determined by the length of the line between the two anchor points and a bias value, such as PACurveUtility.LAMBDA. It's most useful when a short control line segment follows a long segment.
    Parameters:
      `bezPoints` -
      `bias` -

  - ### calculateWeightedCurve

    public static PABezShape calculateWeightedCurve(ArrayList<processing.core.PVector> framePoints, float bias)

  - ### calculateWeightedCurve

    public static void calculateWeightedCurve(PABezShape bezPoints)
    Scales the position of the curve control points on a Bezier curve by a factor determined by the length of the line between the two anchor points and a bias value, such as PACurveUtility.LAMBDA (the default, in this method). It's most useful when a short control line segment follows a long segment.
    Parameters:
      `bezPoints` - a Bezier path encapsulated in a PABezShape instance

  - ### weightedControlVec

    public static processing.core.PVector weightedControlVec(float ax, float ay, float cx, float cy, float w, float d)

  - ### quickBrushShape

    public static PABezShape quickBrushShape(ArrayList<processing.core.PVector> points, float brushWidth, boolean isDrawWeighted, float bias)
    Simulates a brush stroke as a PABezShape object by creating two Bezier curves offset on either side of a supplied list of 2D PVector objects and joining them into a closed shape with pointed ends.
    Parameters:
      `points` - an ArrayList of 2D PVector objects
      `brushWidth` - width of the brush in pixels
      `isDrawWeighted` - create a weighted version of the PABezShape shape
      `bias` - adjusts distances between control points and anchor points
    Returns:

  - ### quickBrushShape

    public static PABezShape quickBrushShape(ArrayList<processing.core.PVector> points, float brushWidth)

  - ### quickBrushShape

    public static PABezShape quickBrushShape(ArrayList<processing.core.PVector> points, float brushWidth, float bias)

  - ### normalAtPoint

    public static processing.core.PVector normalAtPoint(processing.core.PVector a1, processing.core.PVector a2, float u, float d)
    Calculates a normal to a line at a point on the line at parametric distance u, normalized if d = 1.
    Parameters:
      `a1` - 2D PVector, first point
      `a2` - 2D PVector, second point
      `u` - parametric distance along the line from a1 to a2
      `d` - distance of the normal from the line a1, a2
    Returns:
      Normal to line through a1 and a2

  - ### scaledNormalAtPoint

    public static processing.core.PVector scaledNormalAtPoint(processing.core.PVector anchor, processing.core.PVector normal, float d)
    Parameters:
      `anchor` - 2D PVector, the point from which the normal extends
      `normal` - 2D PVector, normal to anchor
      `d` - distance for scaling the normal, distance from anchor to returned PVector
    Returns:
      2D PVector, the normal scaled by d

  - ### reverseArray

    public static void reverseArray(ArrayList<processing.core.PVector> arr, int l, int r)
    Reverses the order of a portion of an ArrayList of PVector objects, between indices l and r, inclusive.
    Parameters:
      `arr` - an ArrayList of PVector objects
      `l` - index at which to start reversing order of elements
      `r` - index at which to stop reversing order of elements

  - ### buildScheduleFromBezShape

    public static GestureSchedule buildScheduleFromBezShape(PABezShape shape, int steps, float[] anchorTimesMs, boolean arcLengthTime)
    Schedules times along a gestural curve, typically stored as a PACurveMaker instance. A calling sequence might be: `PABezShape curve = curveMaker.getCurve(); float rdpTimes = intsToFloats(curveMaker.getReducedTimes()); GestureSchedule curveSchedule = PACurveUtility.buildScheduleFromBezShape(curve, cfg.bezierCurveSteps, rdpTimes, true);`
    Parameters:
      `shape` -
      `steps` -
      `anchorTimesMs` -
      `arcLengthTime` -
    Returns:

  - ### lerp

    private static float lerp(float a, float b, float u)
    * ---------------- UTILITY ------------------ * *

  - ### intsToFloats

    public static float[] intsToFloats(int[] src)
    Parameters:
      `src` - an array of int
    Returns:
      array src converted to float values

  - ### intsToFloats

    public static float[] intsToFloats(int[] src, int targetLen)
    Parameters:
      `src` - an array of int
      `targetLen` - desired length of array of float to consruct
    Returns:
      an array of targetLen float values derived from src

  - ### pathLength

    public static float pathLength(List<processing.core.PVector> points)
    Parameters:
      `points` - a List of PVector
    Returns:
      length of the path between the points

  - ### bounds

    public static float[] bounds(ArrayList<processing.core.PVector> points)
    Calculates the boundary rectangle of a list of points and returns it as an array of floats.
    Returns:
      [xMin, yMin, xMax, yMax]

  - ### getBoundsCenter

    public static processing.core.PVector getBoundsCenter(ArrayList<processing.core.PVector> points)

  - ### translateCoord

    public static processing.core.PVector translateCoord(float x, float y, float xOffset, float yOffset)
    Translates a point by xOffset and yOffset, returns a new point.
    Parameters:
      `x` - x coordinate of point
      `y` - y coordinate of point
      `xOffset` - distance to translate on x-xis
      `yOffset` - distance to translate on y-axis
    Returns:
      a new translated point

  - ### scaleCoordAroundPoint

    public static processing.core.PVector scaleCoordAroundPoint(float x, float y, float xScale, float yScale, float xctr, float yctr)
    Scales a point by xScale and yScale around a point (xctr, yctr), returns a new point.
    Parameters:
      `x` - x coordinate of point
      `y` - y coordinate of point
      `xScale` - scaling on x-axis
      `yScale` - scaling on y-axis
      `xctr` - x coordinate of center of transformation
      `yctr` - y coordinate of center of transformation
    Returns:
      a new scaled point as a PVector

  - ### rotateCoordAroundPoint

    public static processing.core.PVector rotateCoordAroundPoint(float x, float y, float xctr, float yctr, float theta)
    Rotates a point theta radians around a point (xctr, yctr), returns a new point. rotation is counterclockwise for positive theta in Cartesian system, clockwise in screen display coordinate system
    Parameters:
      `x` - x coordinate of point
      `y` - y coordinate of point
      `xctr` - x coordinate of center of rotation
      `yctr` - y coordinate of center of rotation
      `theta` - angle to rotate, in radians
    Returns:
      a new rotated point

  - ### flipHorizontal

    public static processing.core.PVector flipHorizontal(float x, float y, float xctr)

  - ### flipVertical

    public static processing.core.PVector flipVertical(float x, float y, float yctr)

  - ### translatePoints

    public void translatePoints(ArrayList<processing.core.PVector> points, float xTrans, float yTrans)
    Translates points in x and y directions, in place.
    Parameters:
      `points` - list of points to translate
      `xTrans` - translation in x direction
      `yTrans` - translation in y direction

  - ### scalePoints

    public void scalePoints(ArrayList<processing.core.PVector> points, float xScale, float yScale, float x0, float y0)
    Scales points around a given point, in place.
    Parameters:
      `points` - list of points to scale
      `xScale` - scaling on x-axis
      `yScale` - scaling on y-axis
      `x0` - x-coordinate of the center point
      `y0` - y-coordinate of the center point TODO for xScale or yScale very near 0, insure correct scaling.

  - ### rotatePoints

    public void rotatePoints(ArrayList<processing.core.PVector> points, float xctr, float yctr, float theta)
    Rotates this shape around a supplied center point, in place.
    Parameters:
      `points` - list of points to rotate
      `xctr` - x-coordinate of the center point
      `yctr` - y-coordinate of the center point
      `theta` - degrees to rotate (in radians) TODO for theta very near PI, 0, or TWO_PI, insure correct rotation.

  - ### translatePointsCopy

    public static ArrayList<processing.core.PVector> translatePointsCopy(ArrayList<processing.core.PVector> points, float xTrans, float yTrans)
    Translates points in x and y directions, returning a new list.
    Parameters:
      `points` - the points to be translated
      `xTrans` - translation in x direction
      `yTrans` - translation in y direction
    Returns:
      the translated points

  - ### scalePointsCopy

    public static ArrayList<processing.core.PVector> scalePointsCopy(ArrayList<processing.core.PVector> points, float xScale, float yScale, float x0, float y0)
    Scales points around a given point, returning a new list.
    Parameters:
      `points` - the points to be scaled
      `xScale` - scaling on x-axis
      `yScale` - scaling on y-axis
      `x0` - center of scaling on x-axis
      `y0` - center of scaling on y-axis
    Returns:
      the scaled points TODO for xScale or yScale very near 0, insure correct scaling.

  - ### rotatePointsCopy

    public static ArrayList<processing.core.PVector> rotatePointsCopy(ArrayList<processing.core.PVector> points, float xctr, float yctr, float theta)
    Rotates this shape around a supplied center point, returning a new list.
    Parameters:
      `points` - the points to be rotated
      `xctr` - center of rotation on x-axis
      `yctr` - center of rotation on y-axis
      `theta` - degrees to rotate (in radians) TODO for theta very near PI, 0, or TWO_PI, insure correct rotation.

  - ### transformCoord

    public static processing.core.PVector transformCoord(float x, float y, float xctr, float yctr, float scaleX, float scaleY, boolean flipHorizontal, boolean flipVertical, float theta, float xTrans, float yTrans)
    Applies flip/scale, then rotation, then translation to a point. Flip/scale and rotation are performed around (xctr, yctr).
    Parameters:
      `x` - source x
      `y` - source y
      `xctr` - pivot x
      `yctr` - pivot y
      `scaleX` - scale in x
      `scaleY` - scale in y
      `flipHorizontal` - mirror left/right around pivot
      `flipVertical` - mirror up/down around pivot
      `theta` - rotation in radians
      `xTrans` - translation in x
      `yTrans` - translation in y
    Returns:
      transformed point

  - ### transformPointsCopy

    public static ArrayList<processing.core.PVector> transformPointsCopy(ArrayList<processing.core.PVector> points, float xctr, float yctr, float scaleX, float scaleY, boolean flipHorizontal, boolean flipVertical, float theta, float xTrans, float yTrans)
    Applies flip/scale, then rotation, then translation to a point. Flip/scale and rotation are performed around (xctr, yctr). Returns a new `ArrayList`.
    Parameters:
      `points` -
      `xctr` -
      `yctr` -
      `scaleX` -
      `scaleY` -
      `flipHorizontal` -
      `flipVertical` -
      `theta` -
      `xTrans` -
      `yTrans` -
    Returns:

  - ### transformPoints

    public static void transformPoints(ArrayList<processing.core.PVector> points, float xctr, float yctr, float scaleX, float scaleY, boolean flipHorizontal, boolean flipVertical, float theta, float xTrans, float yTrans)
    Applies flip/scale, then rotation, then translation to a point. Flip/scale and rotation are performed around (xctr, yctr). Performs the transform in place.
    Parameters:
      `points` -
      `xctr` -
      `yctr` -
      `scaleX` -
      `scaleY` -
      `flipHorizontal` -
      `flipVertical` -
      `theta` -
      `xTrans` -
      `yTrans` -

  - ### applyTransformToCurve

    public static void applyTransformToCurve(PACurveMaker curve, GestureTransformState state)
    Applies a GestureTransformState to a PACurveMaker using the curve's live dragPoints. Uses state.restPoints if available; otherwise uses a copy of curve.copyAllPoints() taken at call time. Transform order: 1) flip/scale about pivot 2) rotate about pivot 3) translate
    Parameters:
      `curve` - PACurveMaker instance
      `state` - GestureTransformState instance with transform parameters

  - ### restoreCurveRestPoints

    public static void restoreCurveRestPoints(PACurveMaker curve, GestureTransformState state)
    Restores curve points from state.restPoints, if present.

  - ### lineDraw

    public static void lineDraw(processing.core.PApplet parent, ArrayList<processing.core.PVector> points, int lineColor, float lineWeight)
    Draws a line in a PApplet context using the PVector data in points and supplied color and weight.
    Parameters:
      `parent` - a PApplet where drawing takes place on screen
      `points` - ArrayList of 2D PVector objects, typically a point set without successive identical points
      `lineColor` - color for the line that is drawn
      `lineWeight` - weight for the line that is drawn

  - ### lineDraw

    public static void lineDraw(processing.core.PGraphics pg, ArrayList<processing.core.PVector> points, int lineColor, float lineWeight)
    Draws a line in a PGraphics using the 2D PVector data and supplied color and weight.
    Parameters:
      `pg` - a PGraphics where drawing takes place off screen
      `points` - ArrayList of 2D PVector objects, typically a point set without successive identical points
      `lineColor` - color for the line that is drawn
      `lineWeight` - weight for the line that is drawn

  - ### curveDraw

    public static void curveDraw(processing.core.PApplet parent, PABezShape curve, int curveColor, float curveWeight)
    Draws a Bezier path in a PApplet using 2D curve data and supplied stroke color and weight. The path is drawn with no fill.
    Parameters:
      `parent` -
      `curve` -
      `curveColor` -
      `curveWeight` -

  - ### curveDraw

    public static void curveDraw(processing.core.PApplet parent, PABezShape curve)
    Draws a Bezier path in a PApplet using 2D curve data and the local stroke color and weight of a PABezShape. If the PABezShape is filled, the fill will be drawn.
    Parameters:
      `parent` -
      `curve` -

  - ### curveDraw

    public static void curveDraw(processing.core.PGraphics pg, PABezShape curve, int curveColor, float curveWeight)
    Draws a Bezier path in a PGraphics using 2D curve data and supplied stroke color and weight. The path is drawn with no fill.
    Parameters:
      `pg` -
      `curve` -
      `curveColor` -
      `curveWeight` -

  - ### curveDraw

    public static void curveDraw(processing.core.PGraphics pg, PABezShape curve)
    Draws a Bezier path in a PGraphics using 2D curve data and local stroke color and weight of a PABezShape. If the PABezShape is filled, the fill will be drawn.
    Parameters:
      `pg` -
      `curve` -

  - ### shapeDraw

    public static void shapeDraw(processing.core.PApplet parent, PABezShape shape, int shapeFill, int shapeStroke, float shapeWeight)
    Draws a PABezShape in a PApplet using supplied fill, stroke, and weight. If weight == 0, the shape is drawn with no stroke.
    Parameters:
      `parent` -
      `shape` -
      `shapeFill` -
      `shapeStroke` -
      `shapeWeight` -

  - ### shapeDraw

    public static void shapeDraw(processing.core.PApplet parent, PABezShape shape)
    Draws a PABezShape in a PApplet using local fill, stroke, and weight of the shape.
    Parameters:
      `parent` -
      `shape` -

  - ### shapeDraw

    public static void shapeDraw(processing.core.PGraphics pg, PABezShape shape, int shapeFill, int shapeStroke, float shapeWeight)
    Draws a PABezShape in a PGraphics using supplied fill, stroke, and weight. If weight == 0, the shape is drawn with no stroke.
    Parameters:
      `pg` -
      `shape` -
      `shapeFill` -
      `shapeStroke` -
      `shapeWeight` -

  - ### shapeDraw

    public static void shapeDraw(processing.core.PGraphics pg, PABezShape shape)
    Draws a PABezShape in a PGraphics using local fill, stroke, and weight of the shape.
    Parameters:
      `pg` -
      `shape` -

  - ### pointsDraw

    public static void pointsDraw(processing.core.PApplet parent, ArrayList<processing.core.PVector> points, int pointColor, float diameter)
    Draws circular points in a PApplet context using the PVector data and supplied color and diameter.
    Parameters:
      `parent` - a PApplet where drawing takes place on screen
      `points` - ArrayList of 2D PVector objects, typically a point set without successive identical points
      `pointColor` - color for the circle that is drawn
      `diameter` - diameter of circle that is drawn

  - ### pointsDraw

    public static void pointsDraw(processing.core.PGraphics pg, ArrayList<processing.core.PVector> points, int pointColor, float diameter)
    Draws circular points in a PGraphics context using the PVector data and supplied color and diameter.
    Parameters:
      `pg` - a PGraphics where drawing takes place off screen
      `points` - ArrayList of 2D PVector objects, typically a point set without successive identical points
      `pointColor` - color for the circle that is drawn
      `diameter` - diameter of circle that is drawn