geomerative
Modifier and Type | Field and Description |
---|---|
static int |
COMMAND |
static int |
CONTOUR |
static int |
GROUP |
float |
height
Shape document height.
|
static int |
MESH |
java.lang.String |
name |
static int |
POLYGON |
static int |
SHAPE |
static int |
SUBSHAPE |
static int |
TRISTRIP |
static int |
UNKNOWN |
float |
width
Shape document width.
|
Constructor and Description |
---|
RGeomElem() |
Modifier and Type | Method and Description |
---|---|
void |
centerIn(processing.core.PGraphics g) |
void |
centerIn(processing.core.PGraphics g,
float margin) |
void |
centerIn(processing.core.PGraphics g,
float margin,
float sclDamping,
float trnsDamping) |
boolean |
contains(RGeomElem shp)
Use this method to test if the shape contains all the points of another shape.
|
abstract boolean |
contains(RPoint p) |
boolean |
contains(RPoint[] ps)
Use this method to test if the shape contains an array of points.
|
boolean |
containsBounds(RGeomElem shp)
Use this method to test if the shape contains the bounding box of another shape.
|
boolean |
containsHandles(RGeomElem shp)
Use this method to test if the shape contains the handles of another shape.
|
void |
draw() |
abstract void |
draw(processing.core.PApplet g) |
abstract void |
draw(processing.core.PGraphics g) |
float |
getArea()
Use this method to get the area of an element.
|
RPoint |
getBottomLeft()
Use this method to get the bottom left position of the element.
|
RPoint |
getBottomRight()
Use this method to get the bottom right position of the element.
|
geomerative.RRectangle |
getBounds()
Use this method to get the bounding box of the element.
|
RPoint[] |
getBoundsPoints()
Use this method to get the points of the bounding box of the element.
|
RPoint |
getCenter()
Use this method to get the center point of the element.
|
RMatrix |
getCenteringTransf(processing.core.PGraphics g) |
RMatrix |
getCenteringTransf(processing.core.PGraphics g,
float margin) |
RMatrix |
getCenteringTransf(processing.core.PGraphics g,
float margin,
float sclDamping,
float trnsDamping)
Use this method to get the transformation matrix in order to fit and center the element on the canvas.
|
RPoint |
getCentroid()
Use this method to get the centroid of the element.
|
float |
getCurveLength()
Use this to return the length of the curve.
|
float[] |
getCurveLengths()
Use this to return arclengths of each command on the curve.
|
abstract RPoint[] |
getHandles() |
abstract RPoint[][] |
getHandlesInPaths() |
float |
getHeight()
Use this method to get the height of the element.
|
float |
getOrigHeight()
Use this method to get the original height of the element.
|
float |
getOrigWidth()
Use this method to get the original width of the element.
|
abstract RPoint |
getPoint(float t) |
abstract RPoint[] |
getPoints() |
abstract RPoint[][] |
getPointsInPaths() |
RStyle |
getStyle() |
abstract RPoint |
getTangent(float t) |
abstract RPoint[] |
getTangents() |
abstract RPoint[][] |
getTangentsInPaths() |
RPoint |
getTopLeft()
Use this method to get the top left position of the element.
|
RPoint |
getTopRight()
Use this method to get the top right position of the element.
|
abstract int |
getType() |
float |
getWidth()
Use this method to get the width of the element.
|
float |
getX()
Use this method to get the x (left side) position of the element.
|
float |
getY()
Use this method to get the y position of the element.
|
boolean |
intersects(RGeomElem shp)
Use this method to test if the shape intersects another shape.
|
boolean |
intersects(RPoint[] ps)
Use this method to test if the shape intersects an array of points.
|
boolean |
intersectsBounds(RGeomElem shp)
Use this method to test if the shape intersects the bounding box of another shape.
|
boolean |
intersectsHandles(RGeomElem shp)
Use this method to test if the shape intersects the handles of another shape.
|
boolean |
isIn(processing.core.PApplet g) |
boolean |
isIn(processing.core.PGraphics g)
Use this method to know if the shape is inside a graphics object.
|
void |
print() |
void |
rotate(float angle) |
void |
rotate(float angle,
float vx,
float vy)
Apply a rotation to the element, given an angle and optionally a rotation center.
|
void |
rotate(float angle,
RPoint v)
Apply a rotation to the element, given an angle and optionally a rotation center.
|
void |
scale(float s) |
void |
scale(float sx,
float sy) |
void |
scale(float s,
float x,
float y)
Apply a scale to the element, given scaling factors and optionally a scaling center.
|
void |
scale(float sx,
float sy,
float x,
float y)
Apply a scale to the element, given scaling factors and optionally a scaling center.
|
void |
scale(float sx,
float sy,
RPoint p)
Apply a scale to the element, given scaling factors and optionally a scaling center.
|
void |
scale(float s,
RPoint p)
Apply a scale to the element, given scaling factors and optionally a scaling center.
|
void |
setAlpha(float opacity) |
void |
setAlpha(int opacity) |
void |
setAlpha(java.lang.String str) |
void |
setFill(boolean _fill) |
void |
setFill(int _fillColor) |
void |
setFill(java.lang.String str) |
void |
setFillAlpha(int opacity) |
void |
setFillAlpha(java.lang.String str) |
void |
setName(java.lang.String str) |
void |
setStroke(boolean _stroke) |
void |
setStroke(int _strokeColor) |
void |
setStroke(java.lang.String str) |
void |
setStrokeAlpha(int opacity) |
void |
setStrokeAlpha(java.lang.String str) |
void |
setStrokeCap(java.lang.String str) |
void |
setStrokeJoin(java.lang.String str) |
void |
setStrokeWeight(float value) |
void |
setStrokeWeight(java.lang.String str) |
void |
setStyle(RStyle s) |
void |
shear(float shx,
float shy)
Apply a shear to the element, given shearing factors
|
void |
skewX(float angle)
Apply a horizontal skew to the element, given skewing angle
|
void |
skewY(float angle)
Apply a vertical skew to the element, given skewing angle
|
RMesh |
toMesh() |
RPolygon |
toPolygon() |
abstract RShape |
toShape() |
void |
transform(float x,
float y,
float w,
float h) |
void |
transform(float x,
float y,
float w,
float h,
boolean keepAspectRatio)
Transform the geometric object to fit in a rectangle defined by the parameters passed.
|
void |
transform(RMatrix m) |
void |
translate(float tx,
float ty)
Apply a translation to the element, given translation coordinates.
|
void |
translate(RPoint t)
Apply a translation to the element, given a point.
|
public static final int SHAPE
public static final int SUBSHAPE
public static final int COMMAND
public static final int POLYGON
public static final int CONTOUR
public static final int MESH
public static final int TRISTRIP
public static final int GROUP
public static final int UNKNOWN
public float width
public float height
public java.lang.String name
public abstract void draw(processing.core.PGraphics g)
public abstract void draw(processing.core.PApplet g)
public void draw()
public abstract RPoint getPoint(float t)
public abstract RPoint getTangent(float t)
public abstract RPoint[] getHandles()
public abstract RPoint[] getPoints()
public abstract RPoint[] getTangents()
public abstract RPoint[][] getHandlesInPaths()
public abstract RPoint[][] getPointsInPaths()
public abstract RPoint[][] getTangentsInPaths()
public abstract boolean contains(RPoint p)
public boolean contains(RGeomElem shp)
public boolean containsBounds(RGeomElem shp)
public boolean containsHandles(RGeomElem shp)
public boolean contains(RPoint[] ps)
public boolean intersects(RGeomElem shp)
public boolean intersectsBounds(RGeomElem shp)
public boolean intersectsHandles(RGeomElem shp)
public boolean intersects(RPoint[] ps)
public abstract int getType()
public abstract RShape toShape()
public void print()
public void setFill(boolean _fill)
public void setFill(int _fillColor)
public void setFill(java.lang.String str)
public void setStroke(boolean _stroke)
public void setStroke(int _strokeColor)
public void setStroke(java.lang.String str)
public void setStrokeWeight(float value)
public void setStrokeWeight(java.lang.String str)
public void setStrokeCap(java.lang.String str)
public void setStrokeJoin(java.lang.String str)
public void setStrokeAlpha(int opacity)
public void setStrokeAlpha(java.lang.String str)
public void setFillAlpha(int opacity)
public void setFillAlpha(java.lang.String str)
public void setAlpha(float opacity)
public void setAlpha(int opacity)
public void setAlpha(java.lang.String str)
public RStyle getStyle()
public void setStyle(RStyle s)
public void setName(java.lang.String str)
public float[] getCurveLengths()
public float getCurveLength()
public RPolygon toPolygon()
public RMesh toMesh()
public void transform(RMatrix m)
public void transform(float x, float y, float w, float h, boolean keepAspectRatio)
public void transform(float x, float y, float w, float h)
public geomerative.RRectangle getBounds()
public RPoint[] getBoundsPoints()
public RPoint getTopLeft()
public RPoint getTopRight()
public RPoint getBottomLeft()
public RPoint getBottomRight()
public float getX()
public float getY()
public float getOrigHeight()
public float getOrigWidth()
public float getWidth()
public float getHeight()
public RPoint getCenter()
public RPoint getCentroid()
public float getArea()
public boolean isIn(processing.core.PGraphics g)
g
- the graphics objectpublic boolean isIn(processing.core.PApplet g)
public RMatrix getCenteringTransf(processing.core.PGraphics g, float margin, float sclDamping, float trnsDamping) throws java.lang.RuntimeException
g
- the canvas to which to fit and center the pathmargin
- the margin to take into account when fittingsclDamping
- a value from 0 to 1. The damping coefficient for the scale, if the value is 0, then no scaling is applied.trnsDamping
- a value from 0 to 1. The damping coefficient for the translation, if the value is 0, then no translation is applied.java.lang.RuntimeException
public RMatrix getCenteringTransf(processing.core.PGraphics g) throws java.lang.RuntimeException
java.lang.RuntimeException
public RMatrix getCenteringTransf(processing.core.PGraphics g, float margin) throws java.lang.RuntimeException
java.lang.RuntimeException
public void centerIn(processing.core.PGraphics g)
public void centerIn(processing.core.PGraphics g, float margin)
public void centerIn(processing.core.PGraphics g, float margin, float sclDamping, float trnsDamping) throws java.lang.RuntimeException
java.lang.RuntimeException
public void translate(float tx, float ty)
tx
- the coefficient of x translationty
- the coefficient of y translationpublic void translate(RPoint t)
t
- the translation vector to be appliedpublic void rotate(float angle, float vx, float vy)
angle
- the angle of rotation to be appliedvx
- the x coordinate of the center of rotationvy
- the y coordinate of the center of rotationpublic void rotate(float angle)
public void rotate(float angle, RPoint v)
angle
- the angle of rotation to be appliedv
- the position vector of the center of rotationpublic void scale(float sx, float sy, RPoint p)
sx
- the scaling coefficient over the x axissy
- the scaling coefficient over the y axisp
- the position vector of the center of the scalingpublic void scale(float sx, float sy)
public void scale(float sx, float sy, float x, float y)
sx
- the scaling coefficient over the x axissy
- the scaling coefficient over the y axisx
- x coordinate of the position vector of the center of the scalingy
- y coordinate of the position vector of the center of the scalingpublic void scale(float s, RPoint p)
s
- the scaling coefficient for a uniform scalingp
- the position vector of the center of the scalingpublic void scale(float s)
public void scale(float s, float x, float y)
s
- the scaling coefficient for a uniform scalingx
- x coordinate of the position vector of the center of the scalingy
- y coordinate of the position vector of the center of the scalingpublic void skewX(float angle)
angle
- skewing anglepublic void skewY(float angle)
angle
- skewing anglepublic void shear(float shx, float shy)
shx
- x coordinate shearingshy
- y coordinate shearingGeomerative by Ricard Marxer, http://www.ricardmarxer.com/geomerative/