interface RVG · Factories
RvgShapeFactory
interface RvgShapeFactory
Creates shapes of a group that are not drawn: the input of computations, or points and outlines to compute with.
Reach it through shapes of a group. A shape made here holds the points it gets, as described on
Shape; for a shape that is drawn, use visuals of the group. Without points, the shape's
points are at (0, 0) (polygon() has none, polygon(size) has size).
Methods
arc
arc(start: Point | VectorLike, middle: Point | VectorLike, end: Point | VectorLike): ArcCreates a circular arc passing through exactly 3 specified points.
start- The start point of the arc.
middle- The middle point on the arc.
end- The end point of the arc.
Returns An arc instance.
box
box(p1: Point | VectorLike, p2: Point | VectorLike): BoxCreates a box spanned by two points.
p1- The first corner.
p2- The opposite corner.
Returns A box instance.
circle
circle(): CircleCreates a circle with 3 points initialized at the origin.
Returns A circle instance.
circle(p1: Point | VectorLike, p2: Point | VectorLike, p3: Point | VectorLike): CircleCreates a circle passing through exactly 3 specified points.
p1- The first point.
p2- The second point.
p3- The third point.
Returns A circle instance.
circleAt
circleAt(center: Point | VectorLike, radius: Real | NumberLike): CircleCreates a circle at a specified center with a specified radius.
center- The center of the circle.
radius- The radius of the circle.
Returns A circle instance.
polygon
polygon(vertices: Sequence<Vector> | VectorsLike): PolygonCreates a polygon from a collection of vertices.
vertices- The points defining the polygon.
Returns A polygon instance.
polygon(size: number): PolygonCreates a polygon with a specified number of vertices initialized at the origin.
size- The number of vertices.
Returns A polygon instance.
polygon3P
polygon3P(): PolygonCreates a polygon with 3 vertices initialized at the origin.
Returns A polygon instance.
polygon3P(p1: Point | VectorLike, p2: Point | VectorLike, p3: Point | VectorLike): PolygonCreates a polygon with exactly 3 specified points.
p1- The first vertex.
p2- The second vertex.
p3- The third vertex.
Returns A polygon instance.
polygon4P
polygon4P(): PolygonCreates a polygon with 4 vertices initialized at the origin.
Returns A polygon instance.
polygon4P(p1: Point | VectorLike, p2: Point | VectorLike, p3: Point | VectorLike, p4: Point | VectorLike): PolygonCreates a polygon with exactly 4 specified points.
p1- The first vertex.
p2- The second vertex.
p3- The third vertex.
p4- The fourth vertex.
Returns A polygon instance.
polyline
polyline(vertices: Sequence<Vector> | VectorsLike): PolylineCreates a polyline from a collection of vertices.
vertices- The points defining the polyline.
Returns A polyline instance.
polyline(size: number): PolylineCreates a polyline with a specified number of vertices initialized at the origin.
size- The number of vertices.
Returns A polyline instance.
polyline3P
polyline3P(): PolylineCreates a polyline with 3 vertices initialized at the origin.
Returns A polyline instance.
polyline3P(p1: Point | VectorLike, p2: Point | VectorLike, p3: Point | VectorLike): PolylineCreates a polyline with exactly 3 specified points.
p1- The first vertex.
p2- The second vertex.
p3- The third vertex.
Returns A polyline instance.
polyline4P
polyline4P(): PolylineCreates a polyline with 4 vertices initialized at the origin.
Returns A polyline instance.
polyline4P(p1: Point | VectorLike, p2: Point | VectorLike, p3: Point | VectorLike, p4: Point | VectorLike): PolylineCreates a polyline with exactly 4 specified points.
p1- The first vertex.
p2- The second vertex.
p3- The third vertex.
p4- The fourth vertex.
Returns A polyline instance.
rectangle
rectangle(p1: Point | VectorLike, p2: Point | VectorLike, height: Real | NumberLike): RectangleCreates a rectangle defined by two points and a height.
p1- The first point defining the base of the rectangle.
p2- The second point defining the base of the rectangle.
height- The height of the rectangle perpendicular to the base.
Returns A rectangle instance.
segment
segment(): SegmentCreates a line segment initialized at the origin.
Returns A line segment instance.
segment(p1: Point | VectorLike, p2: Point | VectorLike): SegmentCreates a line segment between two specified points.
p1- The start point.
p2- The end point.
Returns A line segment instance.
triangle
triangle(): TriangleCreates a triangle with 3 vertices initialized at the origin.
Returns A triangle instance.
triangle(p1: Point | VectorLike, p2: Point | VectorLike, p3: Point | VectorLike): TriangleCreates a triangle with the specified vertices.
p1- The first vertex.
p2- The second vertex.
p3- The third vertex.
Returns A triangle instance.
