geomerative index
Name RSubshape
Examples
None available
Description RSubshape is a reduced interface for creating, holding and drawing contours. Subshapes are ordered lists of commands (RCommand) which define the outlines of Shapes. Subshapes can be self-intersecting.
Constructors
RSubshape();
RSubshape(x, y);
RSubshape(p);
RSubshape(s);
RGeomElem();
Parameters
x   float, the x coordinate of the first point of the subshape
y   float, the y coordinate of the first point of the subshape
RSubshape   s, the object from which to make the copy
RPoint   p, the first point of the subshape
Fields
commands   Array of RCommand objects holding the commands of the subshape.

Methods
addBezierTo ( )   Use this method to add a new cubic bezier to the subshape. The first point of the bezier will be the last point added to the subshape.

addLineTo ( )   Use this method to add a new line to the subshape. The first point of the line will be the last point added to the subshape.

addQuadTo ( )   Use this method to add a new quadratic bezier to the subshape. The first point of the bezier will be the last point added to the subshape.

countCommands ( )   Use this method to count the number of commands in the contour.

draw ( )   Use this method to draw the subshape.

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.

getCurvePoint ( )   Use this to return a specific point on the curve. It returns the RPoint for a given advancement parameter t on the curve.

getCurvePoints ( )   Use this to return the points on the curve. It returns the points in the way of an array of RPoint.

getCurveTangent ( )   Use this to return a specific tangent on the curve. It returns the RPoint tangent for a given advancement parameter t on the curve.

getCurveTangents ( )   Use this to return the tangents on the curve. It returns the vectors in the way of an array of RPoint.

getPoints ( )   Use this to return the start, control and end points of the subshape. It returns the points in the way of an array of RPoint.

getType ( )   Use this method to get the type of element this is.

transform ( )   Use this method to transform the shape.

Usage Geometry
Related RCommand
RPolygon