Classes
Members
Methods
addVertex(pt, edge) → {Edge}
Split edge and add new vertex, return new edge inserted
- Source:
Parameters:
Name | Type | Description |
---|---|---|
pt |
Point
|
point on edge that will be added as new vertex |
edge |
Edge
|
edge to split |
Returns:
- Type:
-
Edge
dpath() → {*}
Return string to be assigned to 'd' attribute of element
- Source:
Returns:
- Type:
-
*
findEdgeByPoint(pt) → {Edge}
Returns edge which contains given point
- Source:
Parameters:
Name | Type | Description |
---|---|---|
pt |
Point
|
Returns:
- Type:
-
Edge
rotate(angle, center) → {Multiline}
Return new multiline rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counterclockwise, negative - clockwise
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
angle |
number
|
0 | rotation angle in radians |
center |
Point
|
rotation center, default is (0,0) |
setArcLength()
Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
- Source:
split(ip) → {Multiline}
Split edges of multiline with intersection points and return mutated multiline
- Source:
Parameters:
Name | Type | Description |
---|---|---|
ip |
Array.<Point>
|
array of points to be added as new vertices |
Returns:
- Type:
-
Multiline
svg(attrs) → {string}
Return string to draw multiline in svg
- Source:
Parameters:
Name | Type | Description |
---|---|---|
attrs |
an object with attributes for svg path element TODO: support semi-infinite Ray and infinite Line |
Returns:
- Type:
-
string
svgPoints() → {string}
Return string to be inserted into 'points' attribute of element
- Source:
Returns:
- Type:
-
string
toJSON() → {Object}
This method returns an object that defines how data will be
serialized when called JSON.stringify() method
- Source:
Returns:
- Type:
-
Object
toShapes() → {Array.<Shape>}
Transform multiline into array of shapes
- Source:
Returns:
- Type:
-
Array.<Shape>
transform(matrix) → {Multiline}
Return new multiline transformed using affine transformation matrix
Method does not support unbounded shapes
- Source:
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Matrix
|
affine transformation matrix |