Class PACurveUtility
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyTransformToCurve(PACurveMaker curve, GestureTransformState state) Applies a GestureTransformState to a PACurveMaker using the curve's live dragPoints.static float[]Calculates the boundary rectangle of a list of points and returns it as an array of floats.static GestureSchedulebuildScheduleFromBezShape(PABezShape shape, int steps, float[] anchorTimesMs, boolean arcLengthTime) Schedules times along a gestural curve, typically stored as a PACurveMaker instance.static PABezShapecalculateCurve(ArrayList<processing.core.PVector> framePoints) Creates a Bezier curve from a supplied set of points.static PABezShapecalculateWeightedCurve(ArrayList<processing.core.PVector> framePoints, 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.static voidcalculateWeightedCurve(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 PABezShapecalculateWeightedCurve(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 voidcomputeControlPoints(float[] K, float[] p1, float[] p2) static voidcurveDraw(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 voidcurveDraw(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 voidcurveDraw(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 voidcurveDraw(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 intfindFurthest(ArrayList<processing.core.PVector> points, int a, int b, float epsilon) static processing.core.PVectorflipHorizontal(float x, float y, float xctr) Flips a point horizontally across a vertical line at xctr, returns a new point.static processing.core.PVectorflipVertical(float x, float y, float yctr) Flips a point vertically across a horizontal line at yctr, returns a new point.static processing.core.PVectorgetBoundsCenter(ArrayList<processing.core.PVector> points) Calculates the center of the boundary rectangle of a list of points and returns it as a PVector.static voidindexedRDP(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 floatlerp(float a, float b, float u) linear interpolation(package private) static floatlineDist(processing.core.PVector c, processing.core.PVector a, processing.core.PVector b) static voidlineDraw(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 voidlineDraw(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.PVectornormalAtPoint(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 floatpathLength(List<processing.core.PVector> points) static voidpointsDraw(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 voidpointsDraw(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 PABezShapequickBrushShape(ArrayList<processing.core.PVector> points, float brushWidth) static PABezShapequickBrushShape(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 PABezShapequickBrushShape(ArrayList<processing.core.PVector> points, float brushWidth, float bias) static voidrdp(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 voidrestoreCurveRestPoints(PACurveMaker curve, GestureTransformState state) Restores curve points from state.restPoints, if present.static voidreverseArray(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.PVectorrotateCoordAroundPoint(float x, float y, float xctr, float yctr, float theta) Rotates a point theta radians around a point (xctr, yctr), returns a new point.voidrotatePoints(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.PVectorscalarProjection(processing.core.PVector p, processing.core.PVector a, processing.core.PVector b) static processing.core.PVectorscaleCoordAroundPoint(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.PVectorscaledNormalAtPoint(processing.core.PVector anchor, processing.core.PVector normal, float d) voidscalePoints(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 voidshapeDraw(processing.core.PApplet parent, PABezShape shape) Draws a PABezShape in a PApplet using local fill, stroke, and weight of the shape.static voidshapeDraw(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 voidshapeDraw(processing.core.PGraphics pg, PABezShape shape) Draws a PABezShape in a PGraphics using local fill, stroke, and weight of the shape.static voidshapeDraw(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.PVectortransformCoord(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 voidtransformPoints(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.PVectortranslateCoord(float x, float y, float xOffset, float yOffset) Translates a point by xOffset and yOffset, returns a new point.voidtranslatePoints(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.PVectorweightedControlVec(float ax, float ay, float cx, float cy, float w, float d) Scales the position of a curve control point (cx, cy) relative to an anchor point (ax, ay) on a Bezier curve.
-
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 linerdpPoints- an empty ArrayList for accumulating reduced pointsepsilon- 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 linerdpPoints- an empty ArrayList for accumulating reduced pointsepsilon- the expected distance between reduced points
-
findFurthest
- Parameters:
points- a list of points to evaluatea- start index in pointsb- end index in pointsepsilon- 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
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
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- a Bezier path encapsulated in a PABezShape instancebias- adjusts distances between control points and anchor points- Returns:
- a Bezier curve path constructed of PABezShape objects
-
calculateWeightedCurve
public static PABezShape calculateWeightedCurve(ArrayList<processing.core.PVector> framePoints, 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:
framePoints- An array of 2D PVector objects to transform into a Bezier curvebias- adjusts distances between control points and anchor points- Returns:
- A Bezier curve path constructed of PABezShape objects
-
calculateWeightedCurve
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) Scales the position of a curve control point (cx, cy) relative to an anchor point (ax, ay) on a Bezier curve.- Parameters:
ax- anchor point x coordinateay- anchor point y coordinatecx- control point x coordinatecy- control point y coordinatew- weighting factor, such as PACurveUtility.LAMBDA, that adjusts the distance between control point and anchor pointd- distance between anchor points- Returns:
- a PVector representing the scaled control point position
-
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 objectsbrushWidth- width of the brush in pixelsisDrawWeighted- create a weighted version of the PABezShape shapebias- 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 pointa2- 2D PVector, second pointu- parametric distance along the line from a1 to a2d- 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 extendsnormal- 2D PVector, normal to anchord- distance for scaling the normal, distance from anchor to returned PVector- Returns:
- 2D PVector, the normal scaled by d
-
reverseArray
Reverses the order of a portion of an ArrayList of PVector objects, between indices l and r, inclusive.- Parameters:
arr- an ArrayList of PVector objectsl- index at which to start reversing order of elementsr- 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) linear interpolation- Parameters:
a- start valueb- end valueu- parametric distance between a and b, between 0 and- Returns:
- a + u * (b - a)
-
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 inttargetLen- desired length of array of float to consruct- Returns:
- an array of targetLen float values derived from src
-
pathLength
- Parameters:
points- a List of PVector- Returns:
- length of the path between the points
-
bounds
Calculates the boundary rectangle of a list of points and returns it as an array of floats.- Returns:
- [xMin, yMin, xMax, yMax]
-
getBoundsCenter
Calculates the center of the boundary rectangle of a list of points and returns it as a PVector. -
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 pointy- y coordinate of pointxOffset- distance to translate on x-xisyOffset- 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 pointy- y coordinate of pointxScale- scaling on x-axisyScale- scaling on y-axisxctr- x coordinate of center of transformationyctr- 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 pointy- y coordinate of pointxctr- x coordinate of center of rotationyctr- y coordinate of center of rotationtheta- angle to rotate, in radians- Returns:
- a new rotated point
-
flipHorizontal
public static processing.core.PVector flipHorizontal(float x, float y, float xctr) Flips a point horizontally across a vertical line at xctr, returns a new point.- Parameters:
x- x coordinate of pointy- y coordinate of pointxctr- x coordinate of center of flip- Returns:
- a new flipped point
-
flipVertical
public static processing.core.PVector flipVertical(float x, float y, float yctr) Flips a point vertically across a horizontal line at yctr, returns a new point.- Parameters:
x- x coordinate of pointy- y coordinate of pointyctr- y coordinate of center of flip- Returns:
- a new flipped point
-
translatePoints
Translates points in x and y directions, in place.- Parameters:
points- list of points to translatexTrans- translation in x directionyTrans- 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 scalexScale- scaling on x-axisyScale- scaling on y-axisx0- x-coordinate of the center pointy0- 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 rotatexctr- x-coordinate of the center pointyctr- y-coordinate of the center pointtheta- 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 translatedxTrans- translation in x directionyTrans- 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 scaledxScale- scaling on x-axisyScale- scaling on y-axisx0- center of scaling on x-axisy0- 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 rotatedxctr- center of rotation on x-axisyctr- center of rotation on y-axistheta- 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 xy- source yxctr- pivot xyctr- pivot yscaleX- scale in xscaleY- scale in yflipHorizontal- mirror left/right around pivotflipVertical- mirror up/down around pivottheta- rotation in radiansxTrans- translation in xyTrans- 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 newArrayList<PVector>.- 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
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 instancestate- GestureTransformState instance with transform parameters
-
restoreCurveRestPoints
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 screenpoints- ArrayList of 2D PVector objects, typically a point set without successive identical pointslineColor- color for the line that is drawnlineWeight- 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 screenpoints- ArrayList of 2D PVector objects, typically a point set without successive identical pointslineColor- color for the line that is drawnlineWeight- 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
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
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
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
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 screenpoints- ArrayList of 2D PVector objects, typically a point set without successive identical pointspointColor- color for the circle that is drawndiameter- 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 screenpoints- ArrayList of 2D PVector objects, typically a point set without successive identical pointspointColor- color for the circle that is drawndiameter- diameter of circle that is drawn
-