HE_Mesh
5.1.0
|
Public Member Functions | |
RPath () | |
RPath (final RPoint[] points) | |
RPath (final float x, final float y) | |
RPath (final RPoint p) | |
RPath (final RPath s) | |
RPath (final RCommand c) | |
int | countCommands () |
RPoint[] | getHandles () |
RPoint[] | getPoints () |
RPoint[][] | getPointsInPaths () |
RPoint[][] | getHandlesInPaths () |
RPoint[][] | getTangentsInPaths () |
RPoint[] | getTangents () |
RPoint[] | intersectionPoints (final RCommand other) |
RPoint[] | intersectionPoints (final RPath other) |
RClosest | closestPoints (final RCommand other) |
RClosest | closestPoints (final RPath other) |
RPoint | getPoint (final float t) |
RPoint | getTangent (final float t) |
boolean | contains (final RPoint p) |
void | insertHandle (final float t) |
void | insertHandleInPaths (final float t) |
RPath[] | split (final float t) |
void | polygonize () |
void | draw (final PGraphics g) |
void | draw (final PApplet g) |
void | addCommand (final RCommand p) |
void | addBezierTo (final RPoint cp1, final RPoint cp2, final RPoint end) |
void | addBezierTo (final float cp1x, final float cp1y, final float cp2x, final float cp2y, final float endx, final float endy) |
void | addQuadTo (final RPoint cp1, final RPoint end) |
void | addQuadTo (final float cp1x, final float cp1y, final float endx, final float endy) |
void | addLineTo (final RPoint end) |
void | addLineTo (final float endx, final float endy) |
void | addClose () |
RPolygon | toPolygon () |
RShape | toShape () |
RMesh | toMesh () |
int | getType () |
![]() | |
abstract void | draw (PGraphics g) |
abstract void | draw (PApplet g) |
void | draw () |
abstract RPoint | getPoint (float t) |
abstract RPoint | getTangent (float t) |
abstract RPoint[] | getHandles () |
abstract RPoint[] | getPoints () |
abstract RPoint[] | getTangents () |
abstract RPoint[][] | getHandlesInPaths () |
abstract RPoint[][] | getPointsInPaths () |
abstract RPoint[][] | getTangentsInPaths () |
abstract boolean | contains (RPoint p) |
abstract int | getType () |
abstract RShape | toShape () |
void | print () |
void | setFill (boolean _fill) |
void | setFill (int _fillColor) |
void | setFill (String str) |
void | setStroke (boolean _stroke) |
void | setStroke (int _strokeColor) |
void | setStroke (String str) |
void | setStrokeWeight (float value) |
void | setStrokeWeight (String str) |
void | setStrokeCap (String str) |
void | setStrokeJoin (String str) |
void | setStrokeAlpha (int opacity) |
void | setStrokeAlpha (String str) |
void | setFillAlpha (int opacity) |
void | setFillAlpha (String str) |
void | setAlpha (float opacity) |
void | setAlpha (int opacity) |
void | setAlpha (String str) |
RStyle | getStyle () |
void | setStyle (RStyle s) |
void | setName (String str) |
float[] | getCurveLengths () |
float | getCurveLength () |
RPolygon | toPolygon () |
RMesh | toMesh () |
void | transform (RMatrix m) |
void | transform (float x, float y, float w, float h) |
boolean | isIn (PGraphics g) |
boolean | isIn (PApplet g) |
RMatrix | getCenteringTransf (PGraphics g) throws RuntimeException |
RMatrix | getCenteringTransf (PGraphics g, float margin) throws RuntimeException |
void | centerIn (PGraphics g) |
void | centerIn (PGraphics g, float margin) |
void | centerIn (PGraphics g, float margin, float sclDamping, float trnsDamping) throws RuntimeException |
void | rotate (float angle) |
void | scale (float sx, float sy) |
void | scale (float s) |
Public Attributes | |
int | type = RGeomElem.SUBSHAPE |
![]() | |
float | width |
float | height |
String | name = "" |
Protected Member Functions | |
void | calculateCurveLengths () |
![]() | |
void | saveContext (PGraphics g) |
void | saveContext (PApplet p) |
void | saveContext () |
void | restoreContext (PGraphics g) |
void | restoreContext (PApplet p) |
void | restoreContext () |
void | setContext (PGraphics g) |
void | setContext (PApplet p) |
void | setContext () |
void | setStyle (RGeomElem p) |
void | setStyle (String styleString) |
void | calculateCurveLengths () |
void | updateOrigParams () |
Private Member Functions | |
void | append (final RCommand nextcommand) |
void | insert (final RCommand newcommand, final int i) throws RuntimeException |
void | extract (final int i) throws RuntimeException |
Related Functions | |
(Note that these are not member functions.) | |
RCommand[] | commands |
RPoint | lastPoint |
float[] | indAndAdvAt (final float t) |
![]() | |
boolean | contains (RGeomElem shp) |
boolean | containsBounds (RGeomElem shp) |
boolean | containsHandles (RGeomElem shp) |
boolean | contains (RPoint[] ps) |
boolean | intersects (RGeomElem shp) |
boolean | intersectsBounds (RGeomElem shp) |
boolean | intersectsHandles (RGeomElem shp) |
boolean | intersects (RPoint[] ps) |
void | transform (float x, float y, float w, float h, boolean keepAspectRatio) |
RRectangle | getBounds () |
RPoint[] | getBoundsPoints () |
RPoint | getTopLeft () |
RPoint | getTopRight () |
RPoint | getBottomLeft () |
RPoint | getBottomRight () |
float | getX () |
float | getY () |
float | getOrigHeight () |
float | getOrigWidth () |
float | getWidth () |
float | getHeight () |
RPoint | getCenter () |
RPoint | getCentroid () |
float | getArea () |
RMatrix | getCenteringTransf (PGraphics g, float margin, float sclDamping, float trnsDamping) throws RuntimeException |
void | translate (float tx, float ty) |
void | translate (RPoint t) |
void | rotate (float angle, float vx, float vy) |
void | rotate (float angle, RPoint v) |
void | scale (float sx, float sy, RPoint p) |
void | scale (float sx, float sy, float x, float y) |
void | scale (float s, RPoint p) |
void | scale (float s, float x, float y) |
void | skewX (float angle) |
void | skewY (float angle) |
void | shear (float shx, float shy) |
Additional Inherited Members | |
![]() | |
static final int | SHAPE = 0 |
static final int | SUBSHAPE = 1 |
static final int | COMMAND = 2 |
static final int | POLYGON = 3 |
static final int | CONTOUR = 4 |
static final int | MESH = 5 |
static final int | TRISTRIP = 6 |
static final int | GROUP = 7 |
static final int | UNKNOWN = 8 |
![]() | |
float[] | lenCurves |
float | lenCurve = -1F |
RStyle | style = new RStyle() |
RPath is a reduced interface for creating, holding and drawing contours. Paths are ordered lists of commands (RCommand) which define the outlines of shapes. Paths can be self-intersecting.
RPath Geometry
geomerative.RPath.RPath | ( | ) |
Create a new empty path.
geomerative.RPath.RPath | ( | final RPoint[] | points | ) |
geomerative.RPath.RPath | ( | final float | x, |
final float | y | ||
) |
Create a new path, given the coordinates of the first point.
x | x coordinate of the first point of the new path |
y | y coordinate of the first point of the new path |
geomerative.RPath.RPath | ( | final RPoint | p | ) |
geomerative.RPath.RPath | ( | final RCommand | c | ) |
Add a new cubic bezier to the path. The first point of the bezier will be the last point added to the path.
addBezierTo
cp1 | first control point |
cp2 | second control point |
end | end point |
void geomerative.RPath.addBezierTo | ( | final float | cp1x, |
final float | cp1y, | ||
final float | cp2x, | ||
final float | cp2y, | ||
final float | endx, | ||
final float | endy | ||
) |
Add a new cubic bezier to the path. The first point of the bezier will be the last point added to the path.
addBezierTo
cp1x | the x coordinate of the first control point |
cp1y | the y coordinate of the first control point |
cp2x | the x coordinate of the second control point |
cp2y | the y coordinate of the second control point |
endx | the x coordinate of the end point |
endy | the y coordinate of the end point |
void geomerative.RPath.addClose | ( | ) |
void geomerative.RPath.addCommand | ( | final RCommand | p | ) |
Use this method to add new commands to the contour.
addCommand
void geomerative.RPath.addLineTo | ( | final RPoint | end | ) |
Add a new line to the path. The first point of the line will be the last point added to the path.
addLineTo
end | end point |
void geomerative.RPath.addLineTo | ( | final float | endx, |
final float | endy | ||
) |
Add a new line to the path. The first point of the line will be the last point added to the path.
addLineTo
endx | the x coordinate of the end point |
endy | the y coordinate of the end point |
Add a new quadratic bezier to the path. The first point of the bezier will be the last point added to the path.
addQuadTo
cp1 | first control point |
end | end point |
void geomerative.RPath.addQuadTo | ( | final float | cp1x, |
final float | cp1y, | ||
final float | endx, | ||
final float | endy | ||
) |
Add a new quadratic bezier to the path. The first point of the bezier will be the last point added to the path.
addQuadTo
cp1x | the x coordinate of the first control point |
cp1y | the y coordinate of the first control point |
endx | the x coordinate of the end point |
endy | the y coordinate of the end point |
|
private |
|
protected |
Use this to find the closest or intersection points between this path and a command.
Use this to return the intersection points between two paths. Returns null if no intersection exists.
boolean geomerative.RPath.contains | ( | final RPoint | p | ) |
Use this to return a specific tangent on the curve. It returns true if the point passed as a parameter is inside the path. Implementation taken from: http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
p | the point for which to test containement.. |
int geomerative.RPath.countCommands | ( | ) |
Use this method to count the number of commands in the contour.
countCommands
void geomerative.RPath.draw | ( | final PGraphics | g | ) |
Use this method to draw the path.
drawPath
g | PGraphics, the graphics object on which to draw the path |
void geomerative.RPath.draw | ( | final PApplet | g | ) |
|
private |
RPoint [] geomerative.RPath.getHandles | ( | ) |
RPoint [][] geomerative.RPath.getHandlesInPaths | ( | ) |
RPoint geomerative.RPath.getPoint | ( | final float | t | ) |
RPoint [] geomerative.RPath.getPoints | ( | ) |
RPoint [][] geomerative.RPath.getPointsInPaths | ( | ) |
RPoint geomerative.RPath.getTangent | ( | final float | t | ) |
RPoint [] geomerative.RPath.getTangents | ( | ) |
RPoint [][] geomerative.RPath.getTangentsInPaths | ( | ) |
int geomerative.RPath.getType | ( | ) |
Use this method to get the type of element this is.
RPolygon_getType
|
private |
void geomerative.RPath.insertHandle | ( | final float | t | ) |
Use this to insert a split point into the path.
insertHandle
t | float, the parameter of advancement on the curve. t must have values between 0 and 1. |
void geomerative.RPath.insertHandleInPaths | ( | final float | t | ) |
Use this to insert a split point into each command of the path.
insertHandleInPaths
t | float, the parameter of advancement on the curve. t must have values between 0 and 1. |
Use this to return the intersection points between this path and a command. Returns null if no intersection exists.
Use this to return the intersection points between two paths. Returns null if no intersection exists.
void geomerative.RPath.polygonize | ( | ) |
RPath [] geomerative.RPath.split | ( | final float | t | ) |
RMesh geomerative.RPath.toMesh | ( | ) |
RPolygon geomerative.RPath.toPolygon | ( | ) |
RShape geomerative.RPath.toShape | ( | ) |
|
related |
|
related |
Use this method to transform the shape.
RPath_transform
m | RMatrix, the matrix defining the affine transformation ( ) |
|
related |
Last point from where to add the next command. Initialized to (0, 0).
lastPoint
int geomerative.RPath.type = RGeomElem.SUBSHAPE |