HE_Mesh
5.1.0
|
Public Member Functions | |
RCommand () | |
RCommand (RCommand c) | |
RCommand (RCommand c, RPoint sp) | |
RCommand (RPoint sp, RPoint ep) | |
RCommand (float spx, float spy, float epx, float epy) | |
RCommand (RPoint sp, RPoint cp1, RPoint ep) | |
RCommand (float spx, float spy, float cp1x, float cp1y, float epx, float epy) | |
RCommand (RPoint sp, RPoint cp1, RPoint cp2, RPoint ep) | |
RCommand (float spx, float spy, float cp1x, float cp1y, float cp2x, float cp2y, float epx, float epy) | |
RShape | toShape () |
int | getType () |
int | countControlPoints () |
int | getCommandType () |
RPoint[] | getPoints () |
RPoint | getPoint (float t) |
RPoint[] | getTangents (int segments) |
RPoint[] | getTangents () |
RPoint | getTangent (float t) |
float | getCurveLength (float t) |
float | getCurveLength () |
RPoint[][] | getPointsInPaths () |
RPoint[][] | getHandlesInPaths () |
RPoint[][] | getTangentsInPaths () |
boolean | contains (RPoint p) |
void | draw (PGraphics g) |
void | draw (PApplet a) |
RPoint[] | getHandles () |
RCommand[] | split (float t) |
RPoint[] | intersectionPoints (RCommand other) |
RClosest | closestPoints (RCommand other) |
![]() | |
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.COMMAND |
RPoint[] | controlPoints |
RPoint | startPoint |
RPoint | endPoint |
![]() | |
float | width |
float | height |
String | name = "" |
Static Public Attributes | |
static final int | LINETO = 0 |
static final int | QUADBEZIERTO = 1 |
static final int | CUBICBEZIERTO = 2 |
static final int | ADAPTATIVE = 0 |
static final int | UNIFORMLENGTH = 1 |
static final int | UNIFORMSTEP = 2 |
static int | segmentType = UNIFORMLENGTH |
static float | segmentAngleTol = 0.0F |
![]() | |
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 |
Protected Member Functions | |
void | saveSegmentatorContext () |
void | restoreSegmentatorContext () |
RPoint[] | getPoints (boolean resetSegmentator) |
![]() | |
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 | |
RCommand[] | splitCubicBezier (float t) |
RCommand[] | splitQuadBezier (float t) |
RCommand[] | splitLine (float t) |
void | quadBezierAdaptative () |
void | quadBezierAdaptativeRecursive (float x1, float y1, float x2, float y2, float x3, float y3, int level) |
void | cubicBezierAdaptative () |
void | cubicBezierAdaptativeRecursive (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, int level) |
void | lineUniformStep () |
void | cubicBezierUniformStep () |
void | quadBezierUniformStep () |
void | lineUniformLength () |
void | quadBezierUniformLength () |
void | cubicBezierUniformLength () |
float | quadBezierLength () |
float | cubicBezierLength () |
void | append (RPoint nextcontrolpoint) |
void | addCurvePoint (RPoint nextcurvepoint) |
Additional Inherited Members | |
![]() | |
float[] | lenCurves |
float | lenCurve = -1F |
RStyle | style = new RStyle() |
![]() | |
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) |
geomerative.RCommand.RCommand | ( | ) |
Create an empty command
geomerative.RCommand.RCommand | ( | RCommand | c | ) |
Make a copy of another RCommand object. This can be useful when wanting to transform one but at the same time keep the original.
c | the object of which to make the copy |
Make a copy of another RCommand object with a specific start point.
c | the object of which to make the copy |
sp | the start point of the command to be created |
Create a LINETO command object with specific start and end points.
sp | the start point of the command to be created |
ep | the end point of the command to be created |
geomerative.RCommand.RCommand | ( | float | spx, |
float | spy, | ||
float | epx, | ||
float | epy | ||
) |
Create a LINETO command object with specific start and end point coordinates.
spx | the x coordinate of the start point of the command to be created |
spy | the y coordinate of the start point of the command to be created |
epx | the x coordinate of the end point of the command to be created |
epy | the y coordinate of the end point of the command to be created |
Create a QUADBEZIERTO command object with specific start, control and end point coordinates.
sp | the start point of the command to be created |
cp1 | the first control point of the command to be created |
ep | the end point of the command to be created |
geomerative.RCommand.RCommand | ( | float | spx, |
float | spy, | ||
float | cp1x, | ||
float | cp1y, | ||
float | epx, | ||
float | epy | ||
) |
Create a QUADBEZIERTO command object with specific start, control and end point coordinates.
spx | the x coordinate of the start point of the command to be created |
spy | the y coordinate of the start point of the command to be created |
cp1x | the x coordinate of the first control point of the command to be created |
cp1y | the y coordinate of the first control point of the command to be created |
epx | the x coordinate of the end point of the command to be created |
epy | the y coordinate of the end point of the command to be created |
Create a CUBICBEZIERTO command object with specific start, control and end point coordinates.
sp | the start point of the command to be created |
cp1 | the first control point of the command to be created |
cp2 | the second control point of the command to be created |
ep | the end point of the command to be created |
geomerative.RCommand.RCommand | ( | float | spx, |
float | spy, | ||
float | cp1x, | ||
float | cp1y, | ||
float | cp2x, | ||
float | cp2y, | ||
float | epx, | ||
float | epy | ||
) |
Create a CUBICBEZIERTO command object with specific start, control and end point coordinates.
spx | the x coordinate of the start point of the command to be created |
spy | the y coordinate of the start point of the command to be created |
cp1x | the x coordinate of the first control point of the command to be created |
cp1y | the y coordinate of the first control point of the command to be created |
cp2x | the x coordinate of the second control point of the command to be created |
cp2y | the y coordinate of the second control point of the command to be created |
epx | the x coordinate of the end point of the command to be created |
epy | the y coordinate of the end point of the command to be created |
|
private |
|
private |
Use this method to transform the command. transformCommand
g | PGraphics, the graphics object on which to apply an affine transformation to the command |
boolean geomerative.RCommand.contains | ( | RPoint | p | ) |
int geomerative.RCommand.countControlPoints | ( | ) |
Use this to return the number of control points of the curve. countControlPoints
|
private |
|
private |
|
private |
|
private |
|
private |
void geomerative.RCommand.draw | ( | PGraphics | g | ) |
Use this method to draw the command. drawCommand
g | PGraphics, the graphics object on which to draw the command |
void geomerative.RCommand.draw | ( | PApplet | a | ) |
Use this method to draw the command. drawCommand
a | the applet object on which to draw the command |
int geomerative.RCommand.getCommandType | ( | ) |
Use this to return the command type. getCommandType
float geomerative.RCommand.getCurveLength | ( | float | t | ) |
Use this to return arc length of a curve. It returns the float representing the length given the value of the advancement parameter t on the curve. The current implementation of this function is very slow, not recommended for using during frame draw. RCommand_getCurveLength
t | float, the parameter of advancement on the curve. t must have values between 0 and 1. |
float geomerative.RCommand.getCurveLength | ( | ) |
Use this to return arc length of a curve. It returns the float representing the length given the value of the advancement parameter t on the curve. The current implementation of this function is very slow, not recommended for using during frame draw. RCommand_getCurveLength
RPoint [] geomerative.RCommand.getHandles | ( | ) |
RPoint [][] geomerative.RCommand.getHandlesInPaths | ( | ) |
RPoint geomerative.RCommand.getPoint | ( | float | t | ) |
RPoint [] geomerative.RCommand.getPoints | ( | ) |
|
protected |
RPoint [][] geomerative.RCommand.getPointsInPaths | ( | ) |
RPoint geomerative.RCommand.getTangent | ( | float | t | ) |
Use this to return a specific tangent on the curve. It returns the RPoint representing the tangent vector for a given value of the advancement parameter t on the curve. getTangent
t | float, the parameter of advancement on the curve. t must have values between 0 and 1. |
RPoint [] geomerative.RCommand.getTangents | ( | int | segments | ) |
RPoint [] geomerative.RCommand.getTangents | ( | ) |
RPoint [][] geomerative.RCommand.getTangentsInPaths | ( | ) |
int geomerative.RCommand.getType | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
protected |
|
static |
Use this to set the segmentator angle tolerance for the ADAPTATIVE segmentator and set the segmentator to ADAPTATIVE. setSegmentAngle
segmentAngleTolerance | an angle from 0 to PI/2 it defines the maximum angle between segments. |
|
static |
Use this to set the segmentator type. ADAPTATIVE segmentator minimizes the number of segments avoiding perceptual artifacts like angles or cusps. Use this in order to have Polygons and Meshes with the fewest possible vertices. This can be useful when using or drawing a lot the same Polygon or Mesh deriving from this Shape. UNIFORMLENGTH segmentator is the slowest segmentator and it segments the curve on segments of equal length. This can be useful for very specific applications when for example drawing incrementaly a shape with a uniform speed. UNIFORMSTEP segmentator is the fastest segmentator and it segments the curve based on a constant value of the step of the curve parameter, or on the number of segments wanted. This can be useful when segmpointsentating very often a Shape or when we know the amount of segments necessary for our specific application. setSegment
|
static |
Use this to set the segmentator graphic context. setSegmentGraphic
g | graphics object too which to adapt the segmentation of the command. |
|
static |
Use this to set the segmentator length for the UNIFORMLENGTH segmentator and set the segmentator to UNIFORMLENGTH. setSegmentLength
segmentLngth | the length of each resulting segment. |
|
static |
Use this to set the segmentator offset for the UNIFORMLENGTH segmentator and set the segmentator to UNIFORMLENGTH. setSegmentOffset
segmentOffst | the offset of the first point on the path. |
|
static |
Use this to set the segmentator step for the UNIFORMSTEP segmentator and set the segmentator to UNIFORMSTEP. setSegmentStep
segmentStps | if a float from +0.0 to 1.0 is passed it's considered as the step, else it's considered as the number of steps. When a value of 0.0 is used the steps will be calculated automatically depending on an estimation of the length of the curve. The special value -1 is the same as 0.0 but also turning of the segmentation of lines (faster segmentation). |
RCommand [] geomerative.RCommand.split | ( | float | t | ) |
Returns two commands resulting of splitting the command. split
t | the advancement on the curve where command should be split. |
|
private |
Taken from: http://steve.hollasch.net/cgindex/curves/cbezarclen.html
who took it from: Schneider's Bezier curve-fitter
|
private |
|
private |
RShape geomerative.RCommand.toShape | ( | ) |
|
static |
RPoint [] geomerative.RCommand.controlPoints |
|
static |
RPoint geomerative.RCommand.endPoint |
|
static |
|
static |
|
static |
|
static |
RPoint geomerative.RCommand.startPoint |
int geomerative.RCommand.type = RGeomElem.COMMAND |
|
static |
|
static |