geomerative index |
Name | RPolygon
Examples |
    None available
Description | RPolygon is a reduced interface for creating, holding and drawing complex polygons. Polygons are groups of one or more contours (RContour). This interface allows to perform binary operations (difference, xor, union and intersection) on polygons.
Constructors |
    RPolygon();
    RPolygon(points);
    RPolygon(newcontour);
    RPolygon(p);
    RGeomElem();
Parameters |
RContour |  | newcontour, the contour for the new polygon.
RPolygon |  | p, the object of which to make a copy
Fields |
contours |  | Array of RContour objects holding the contours of the polygon.
Methods |
addContour ( ) |  | Use this method to create a new contour.
addPoint ( ) |  | Use this method to add new points to the current contour.
countContours ( ) |  | Use this method to count the number of contours in the polygon.
createCircle ( ) |  | Use this method to create a new circle polygon.
createRectangle ( ) |  | Use this method to create a new rectangle polygon.
createRing ( ) |  | Use this method to create a new ring polygon.
createStar ( ) |  | Use this method to create a new starform polygon.
diff ( ) |  | Use this method to get the difference of the given polygon with the polygon passed as atribute.
draw ( ) |  | Use this method to draw the polygon.
getArea ( ) |  | Use this method to get the area of an element.
getBounds ( ) |  | Use this method to get the bounding box of the element.
getCenter ( ) |  | Use this method to get the center point of the element.
getCenteringTransf ( ) |  | Use this method to get the transformation matrix in order to fit and center the element on the canvas. Scaling and translation damping parameters are available, in order to create animations.
getCentroid ( ) |  | Use this method to get the centroid of the element.
getCurveLength ( ) |  | Use this to return the points on the curve. It returns the points in the way of an array of RPoint.
getCurveLengths ( ) |  | Use this to return the points on the curve. It returns the points in the way of an array of RPoint.
getHandles ( ) |  | Use this to return the points of the polygon. It returns the points in the way of an array of RPoint.
getHeight ( ) |  | Use this method to get the height of the element.
getPoints ( ) |  | Use this to return the points of the polygon. It returns the points in the way of an array of RPoint.
getType ( ) |  | Use this method to get the type of element this is.
getWidth ( ) |  | Use this method to get the width of the element.
getX ( ) |  | Use this method to get the x (left side position) of the element.
getY ( ) |  | Use this method to get the y (left side position) of the element.
intersection ( ) |  | Use this method to get the intersection of the given polygon with the polygon passed as atribute.
isHole ( ) |  | Return true if this polygon is a hole. Holes are assumed to be inner polygons of a more complex polygon.
isIn ( ) |  | Use this method to know if the shape is inside a graphics object. This might be useful if we want to delete objects that go offscreen.
rotate ( ) |  | Use this to apply a rotation to the point.
scale ( ) |  | Use this to scale the point.
setContour ( ) |  | Use this method to set the current contour to which append points.
toMesh ( ) |  | Use this method to create a new mesh from a given polygon.
transform ( ) |  | Transform the geometric object to fit in a rectangle defined by the parameters passed.
translate ( ) |  | Use this to apply a translation to the point.
union ( ) |  | Use this method to get the union of the given polygon with the polygon passed as atribute.
update ( ) |  | Use this method to get a rebuilt version of a given polygon by removing extra points and solving intersecting contours or holes.
xor ( ) |  | Use this method to get the xor of the given polygon with the polygon passed as atribute.
Usage | Geometry
Related | RContour createCircle ( ) createRing ( ) createStar ( ) diff ( ) xor ( ) union ( ) intersection ( )