geomerative
public class RPath extends RGeomElem
Modifier and Type | Field and Description |
---|---|
RCommand[] |
commands
Array of RCommand objects holding the commands of the path.
|
RPoint |
lastPoint
Last point from where to add the next command.
|
int |
type |
Constructor and Description |
---|
RPath()
Create a new empty path.
|
RPath(float x,
float y)
Create a new path, given the coordinates of the first point.
|
RPath(RCommand c) |
RPath(RPath s)
Copy a path.
|
RPath(RPoint p)
Create a new path, given the first point.
|
RPath(RPoint[] points)
Create a new path, given an array of points.
|
Modifier and Type | Method and Description |
---|---|
void |
addBezierTo(float cp1x,
float cp1y,
float cp2x,
float cp2y,
float endx,
float endy)
Add a new cubic bezier to the path.
|
void |
addBezierTo(RPoint cp1,
RPoint cp2,
RPoint end)
Add a new cubic bezier to the path.
|
void |
addClose() |
void |
addCommand(RCommand p)
Use this method to add new commands to the contour.
|
void |
addLineTo(float endx,
float endy)
Add a new line to the path.
|
void |
addLineTo(RPoint end)
Add a new line to the path.
|
void |
addQuadTo(float cp1x,
float cp1y,
float endx,
float endy)
Add a new quadratic bezier to the path.
|
void |
addQuadTo(RPoint cp1,
RPoint end)
Add a new quadratic bezier to the path.
|
RClosest |
closestPoints(RCommand other)
Use this to find the closest or intersection points between this path and a command.
|
RClosest |
closestPoints(RPath other)
Use this to return the intersection points between two paths.
|
boolean |
contains(RPoint p)
Use this to return a specific tangent on the curve.
|
int |
countCommands()
Use this method to count the number of commands in the contour.
|
void |
draw(processing.core.PApplet g) |
void |
draw(processing.core.PGraphics g)
Use this method to draw the path.
|
RPoint[] |
getHandles()
Use this to return the start, control and end points of the path.
|
RPoint[][] |
getHandlesInPaths()
Use this to return the handles of each path of the path.
|
RPoint |
getPoint(float t)
Return a specific point on the curve.
|
RPoint[] |
getPoints()
Use this to return the points on the curve.
|
RPoint[][] |
getPointsInPaths()
Use this to return the points of each path of the path.
|
RPoint |
getTangent(float t)
Use this to return a specific tangent on the curve.
|
RPoint[] |
getTangents()
Use this to return the tangents on the curve.
|
RPoint[][] |
getTangentsInPaths()
Use this to return the tangents of each path of the path.
|
int |
getType()
Use this method to get the type of element this is.
|
void |
insertHandle(float t)
Use this to insert a split point into the path.
|
void |
insertHandleInPaths(float t)
Use this to insert a split point into each command of the path.
|
RPoint[] |
intersectionPoints(RCommand other)
Use this to return the intersection points between this path and a command.
|
RPoint[] |
intersectionPoints(RPath other)
Use this to return the intersection points between two paths.
|
void |
polygonize() |
void |
print() |
RPath[] |
split(float t)
Use this to split a path into two separate new paths.
|
RMesh |
toMesh() |
RPolygon |
toPolygon() |
RShape |
toShape() |
centerIn, centerIn, centerIn, contains, contains, containsBounds, containsHandles, draw, getArea, getBottomLeft, getBottomRight, getBounds, getBoundsPoints, getCenter, getCenteringTransf, getCenteringTransf, getCenteringTransf, getCentroid, getCurveLength, getCurveLengths, getHeight, getOrigHeight, getOrigWidth, getStyle, getTopLeft, getTopRight, getWidth, getX, getY, intersects, intersects, intersectsBounds, intersectsHandles, isIn, isIn, rotate, rotate, rotate, scale, scale, scale, scale, scale, scale, setAlpha, setAlpha, setAlpha, setFill, setFill, setFill, setFillAlpha, setFillAlpha, setName, setStroke, setStroke, setStroke, setStrokeAlpha, setStrokeAlpha, setStrokeCap, setStrokeJoin, setStrokeWeight, setStrokeWeight, setStyle, shear, skewX, skewY, transform, transform, transform, translate, translate
public int type
public RCommand[] commands
public RPoint lastPoint
public RPath()
public RPath(RPoint[] points)
points
- the points of the new pathpublic RPath(float x, float y)
x
- x coordinate of the first point of the new pathy
- y coordinate of the first point of the new pathpublic RPath(RPoint p)
p
- first point of the new pathpublic RPath(RPath s)
s
- path to be copiedpublic RPath(RCommand c)
public int countCommands()
public RPoint[] getHandles()
getHandles
in class RGeomElem
public RPoint[] getPoints()
public RPoint[][] getPointsInPaths()
getPointsInPaths
in class RGeomElem
public RPoint[][] getHandlesInPaths()
getHandlesInPaths
in class RGeomElem
public RPoint[][] getTangentsInPaths()
getTangentsInPaths
in class RGeomElem
public RPoint[] getTangents()
getTangents
in class RGeomElem
public RPoint[] intersectionPoints(RCommand other)
public RPoint[] intersectionPoints(RPath other)
public RClosest closestPoints(RCommand other)
public RClosest closestPoints(RPath other)
public RPoint getPoint(float t)
public RPoint getTangent(float t)
getTangent
in class RGeomElem
t
- float, the parameter of advancement on the curve. t must have values between 0 and 1.public boolean contains(RPoint p)
public void insertHandle(float t)
t
- float, the parameter of advancement on the curve. t must have values between 0 and 1.public void insertHandleInPaths(float t)
t
- float, the parameter of advancement on the curve. t must have values between 0 and 1.public RPath[] split(float t)
t
- float, the parameter of advancement on the curve. t must have values between 0 and 1.public void polygonize()
public void draw(processing.core.PGraphics g)
public void addCommand(RCommand p)
public void addBezierTo(RPoint cp1, RPoint cp2, RPoint end)
cp1
- first control pointcp2
- second control pointend
- end pointpublic void addBezierTo(float cp1x, float cp1y, float cp2x, float cp2y, float endx, float endy)
cp1x
- the x coordinate of the first control pointcp1y
- the y coordinate of the first control pointcp2x
- the x coordinate of the second control pointcp2y
- the y coordinate of the second control pointendx
- the x coordinate of the end pointendy
- the y coordinate of the end pointpublic void addQuadTo(RPoint cp1, RPoint end)
cp1
- first control pointend
- end pointpublic void addQuadTo(float cp1x, float cp1y, float endx, float endy)
cp1x
- the x coordinate of the first control pointcp1y
- the y coordinate of the first control pointendx
- the x coordinate of the end pointendy
- the y coordinate of the end pointpublic void addLineTo(RPoint end)
end
- end pointpublic void addLineTo(float endx, float endy)
endx
- the x coordinate of the end pointendy
- the y coordinate of the end pointpublic void addClose()
public int getType()
Geomerative by Ricard Marxer, http://www.ricardmarxer.com/geomerative/