HE_Mesh
5.1.0
|
Public Member Functions | |
RPolygon (final RPolygon p) | |
RPolygon (final RPoint[] points) | |
RPolygon (final RContour newcontour) | |
RPolygon () | |
void | addClose () |
void | print () |
RPolygon | toPolygon () |
RShape | toShape () |
RPoint[] | getHandles () |
RPoint[] | getPoints () |
int | getType () |
void | draw (final PApplet g) |
RPoint | getPoint (final float t) |
RPoint | getTangent (final float t) |
RPoint[] | getTangents () |
RPoint[][] | getPointsInPaths () |
RPoint[][] | getHandlesInPaths () |
RPoint[][] | getTangentsInPaths () |
boolean | contains (final RPoint p) |
boolean | isHole () |
![]() | |
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) |
Static Public Member Functions | |
static RPolygon | createCircle (final float x, final float y, final float radius, final int detail) |
static RPolygon | createCircle (final float radius, final int detail) |
static RPolygon | createCircle (final float x, final float y, final float radius) |
static RPolygon | createCircle (final float radius) |
static RPolygon | createRectangle (final float x, final float y, final float w, final float h) |
static RPolygon | createRectangle (final float w, final float h) |
static RPolygon | createStar (final float x, final float y, final float radiusBig, final float radiusSmall, final int spikes) |
static RPolygon | createStar (final float radiusBig, final float radiusSmall, final int spikes) |
static RPolygon | createRing (final float x, final float y, final float radiusBig, final float radiusSmall, final int detail) |
static RPolygon | createRing (final float radiusBig, final float radiusSmall, final int detail) |
static RPolygon | createRing (final float x, final float y, final float radiusBig, final float radiusSmall) |
static RPolygon | createRing (final float radiusBig, final float radiusSmall) |
Public Attributes | |
int | type = RGeomElem.POLYGON |
![]() | |
float | width |
float | height |
String | name = "" |
Static Public Attributes | |
static int | defaultDetail = 50 |
![]() | |
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 | |
RPolygon | removeOpenContours () |
void | clear () |
void | add (final float x, final float y) |
void | add (final RPoint p) |
void | add (final RPolygon p) |
void | add (final RContour c) |
boolean | isEmpty () |
RRectangle | getBBox () |
RPolygon | getInnerPoly (final int polyIndex) |
int | getNumInnerPoly () |
int | getNumPoints () |
float | getX (final int index) |
float | getY (final int index) |
void | setIsHole (final boolean isHole) |
boolean | isContributing (final int polyIndex) |
void | setContributing (final int polyIndex, final boolean contributes) |
![]() | |
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 RContour nextcontour) |
Related Functions | |
(Note that these are not member functions.) | |
RContour[] | contours |
RPoint | getCentroid () |
int | countContours () |
void | addContour (final RContour c) |
void | addContour () |
void | addContour (final RPoint[] points) |
void | setContour (final int indContour) |
void | addPoint (final RPoint p) |
void | addPoint (final float x, final float y) |
void | addPoint (final int indContour, final RPoint p) |
void | addPoint (final int indContour, final float x, final float y) |
RMesh | toMesh () |
float | getArea () |
void | draw (final PGraphics g) |
RPolygon | intersection (final RPolygon p) |
RPolygon | union (final RPolygon p) |
RPolygon | xor (final RPolygon p) |
RPolygon | diff (final RPolygon p) |
RPolygon | update () |
![]() | |
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 | |
![]() | |
float[] | lenCurves |
float | lenCurve = -1F |
RStyle | style = new RStyle() |
RPolygon is a reduced interface for creating, holding and drawing complex polygons. Polygons are groups of one or more contours (RContour). This interface allows us to perform binary operations (difference, xor, union and intersection) on polygons.
RPolygon Geometry
( ) ( ) ( ) ( ) ( ) ( ) ( )
geomerative.RPolygon.RPolygon | ( | final RPolygon | p | ) |
Make a copy of the given polygon.
createPolygon
p | the object of which to make a copy |
geomerative.RPolygon.RPolygon | ( | final RPoint[] | points | ) |
Create a new polygon given an array of points.
createPolygon
points | the points for the new polygon. |
geomerative.RPolygon.RPolygon | ( | final RContour | newcontour | ) |
Create a new polygon given a contour.
newcontour | the contour for the new polygon. |
geomerative.RPolygon.RPolygon | ( | ) |
Create an empty polygon.
|
protected |
Add a point to the first inner polygon.
|
protected |
Add a point to the first inner polygon.
|
protected |
Add an inner polygon to this polygon - assumes that adding polygon does not have any inner polygons.
|
protected |
Add an inner polygon to this polygon - assumes that adding polygon does not have any inner polygons.
void geomerative.RPolygon.addClose | ( | ) |
|
private |
|
protected |
Use this method to transform the polygon.
RPolygon_transform
m | RMatrix, the matrix of the affine transformation to apply to the polygon Remove all of the points. Creates an empty polygon. |
boolean geomerative.RPolygon.contains | ( | final RPoint | p | ) |
|
static |
Use this method to create a new circle polygon.
createCircle
radius | the radius of the circle |
detail | the number of vertices of the polygon |
|
static |
|
static |
|
static |
|
static |
Use this method to create a new rectangle polygon.
createRectangle
x | the upper-left corner x coordinate |
y | the upper-left corner y coordinate |
w | the width |
h | the height |
|
static |
|
static |
Use this method to create a new ring polygon.
createRing
radiusBig | the outter radius of the ring polygon |
radiusSmall | the inner radius of the ring polygon |
detail | the number of vertices on each contour of the ring |
|
static |
|
static |
|
static |
|
static |
Use this method to create a new starform polygon.
createStar
radiusBig | the outter radius of the star polygon |
radiusSmall | the inner radius of the star polygon |
spikes | the amount of spikes on the star polygon |
|
static |
void geomerative.RPolygon.draw | ( | final PApplet | g | ) |
|
protected |
Returns the bounding box of the polygon.
RPoint [] geomerative.RPolygon.getHandles | ( | ) |
RPoint [][] geomerative.RPolygon.getHandlesInPaths | ( | ) |
|
protected |
Returns the polygon at this index.
|
protected |
Returns the number of inner polygons - inner polygons are assumed to return one here.
|
protected |
Return the number points of the first inner polygon
RPoint geomerative.RPolygon.getPoint | ( | final float | t | ) |
RPoint [] geomerative.RPolygon.getPoints | ( | ) |
RPoint [][] geomerative.RPolygon.getPointsInPaths | ( | ) |
RPoint geomerative.RPolygon.getTangent | ( | final float | t | ) |
RPoint [] geomerative.RPolygon.getTangents | ( | ) |
RPoint [][] geomerative.RPolygon.getTangentsInPaths | ( | ) |
int geomerative.RPolygon.getType | ( | ) |
Use this method to get the type of element this is.
RPolygon_getType
|
protected |
Return the X value of the point at the index in the first inner polygon
|
protected |
Return the Y value of the point at the index in the first inner polygon
|
protected |
Return true if the given inner polygon is contributing to the set operation. This method should NOT be used outside the Clip algorithm.
|
protected |
Return true if the polygon is empty
boolean geomerative.RPolygon.isHole | ( | ) |
Return true if this polygon is a hole. Holes are assumed to be inner polygons of a more complex polygon.
IllegalStateException | if called on a complex polygon. |
void geomerative.RPolygon.print | ( | ) |
|
protected |
Removes contours with less than 3 points. These are contours that are open. Since close polygons have points[0] == points[-1] and two more points to form a triangle at least. This is useful to avoid the clipping algorithm from breaking.
|
protected |
Set whether or not this inner polygon is constributing to the set operation. This method should NOT be used outside the Clip algorithm.
|
protected |
Set whether or not this polygon is a hole. Cannot be called on a complex polygon.
IllegalStateException | if called on a complex polygon. |
RPolygon geomerative.RPolygon.toPolygon | ( | ) |
RShape geomerative.RPolygon.toShape | ( | ) |
|
related |
Add a new contour to the polygon.
addContour
c | the contour to be added ( ) |
|
related |
Add an empty contour to the polygon.
addContour ( )
|
related |
Add a new contour to the polygon given an array of points.
addContour
points | the points of the new contour to be added ( ) |
|
related |
Add a new point to the current contour.
addPoint
p | the point to be added ( ) ( ) |
|
related |
Add a new point to the current contour.
addPoint
x | the x coordinate of the point to be added |
y | the y coordinate of the point to be added ( ) ( ) |
|
related |
Add a new point to the selected contour.
addPoint
indContour | the index of the contour to which the point will be added |
p | the point to be added ( ) ( ) |
|
related |
Add a new point to the selected contour.
addPoint
indContour | the index of the contour to which the point will be added |
x | the x coordinate of the point to be added |
y | the y coordinate of the point to be added ( ) ( ) |
|
related |
|
related |
Use this method to count the number of contours in the polygon.
countContours
|
related |
Use this method to draw the polygon.
drawPolygon
g | PGraphics, the graphics object on which to draw the polygon ( ) |
|
related |
Use this method to get the area covered by the polygon.
getArea
|
related |
Use this method to get the centroid of the element.
RGroup_getCentroid
|
related |
Use this method to set the current contour to which append points.
addContour ( )
|
related |
Use this method to create a new mesh from a given polygon.
toMesh
|
related |
Use this method to get a rebuilt version of a given polygon by removing extra points and solving intersecting contours or holes.
RPolygon_update
|
static |
int geomerative.RPolygon.type = RGeomElem.POLYGON |