Required to generate proper CSS classes and other class related IDs.
Add a vertex to the end of the vertices
array.
The vertex to add.
Check if the given vertex is inside this polygon.
Ray-casting algorithm found at
https://stackoverflow.com/questions/22521982/check-if-point-inside-a-polygon
The vertex to check. The new x-component.
True if the passed vertex is inside this polygon. The polygon is considered closed.
Get the bounding box (bounds) of this polygon.
The rectangular bounds of this polygon.
Get the polygon vertex at the given position (index).
The index may exceed the total vertex count, and will be wrapped around then (modulo).
For k >= 0:
The index of the desired vertex.
At the given index.
Convert this polygon to a sequence of cubic Bézier curves.
The first vertex in the returned array is the start point.
The following sequence are triplets of (first-control-point, secnond-control-point, end-point):
startPoint, controlPoint0_0, controlPoint1_1, pathPoint1, controlPoint1_0, controlPoint1_1, ..., endPoint
An optional threshold (default=1.0) how strong the curve segments should over-/under-drive. Should be between 0.0 and 1.0 for best results but other values are allowed.
An array of 2d vertices that shape the cubic Bézier curve.
Convert this polygon to a cubic bezier path instance.
The threshold, usually from 0.0 to 1.0.
Convert this polygon to a cubic bezier curve, represented as an SVG data string.
The 'd' part for an SVG 'path' element.
Convert this polygon to a sequence of quadratic Bézier curves.
The first vertex in the returned array is the start point.
The following sequence are pairs of control-point-and-end-point:
startPoint, controlPoint0, pathPoint1, controlPoint1, pathPoint2, controlPoint2, ..., endPoint
An array of 2d vertices that shape the quadratic Bézier curve.
Convert this polygon to a quadratic bezier curve, represented as an SVG data string.
The 'd' part for an SVG 'path' element.
Create an SVG representation of this polygon.
An optional set of options, like 'className'.
The SVG string.
Generated using TypeDoc
A polygon class. Any polygon consists of an array of vertices; polygons can be open or closed.
BezierPath
Bounds
SVGSerializabe
Vertex
XYCoords