# Multiline

Class Multiline represent connected path of `edges`, where each edge may be `segment`, `arc`, `line` or `ray`

## Constructor

#### new Multiline()

Source:
  - classes/multiline.js, line 11

### Classes

Multiline

### Members

#### edges

(Getter) Return array of edges

Source:
  - classes/multiline.js, line 46

#### box

(Getter) Return bounding box of the multiline

Source:
  - classes/multiline.js, line 54

#### vertices

(Getter) Returns array of vertices

Source:
  - classes/multiline.js, line 62

### Methods

#### clone() → {Multiline}

Return new cloned instance of Multiline

Source:
  - classes/multiline.js, line 72

##### Returns:

Type:
  `Multiline`

#### addVertex(pt, edge) → {Edge}

Split edge and add new vertex, return new edge inserted

Source:
  - classes/multiline.js, line 82

##### Parameters:

Name | Type | Description
--- | --- | ---
`pt` | `Point` | point on edge that will be added as new vertex
`edge` | `Edge` | edge to split

##### Returns:

Type:
  `Edge`

#### split(ip) → {Multiline}

Split edges of multiline with intersection points and return mutated multiline

Source:
  - classes/multiline.js, line 109

##### Parameters:

Name | Type | Description
--- | --- | ---
`ip` | `Array.<Point>` | array of points to be added as new vertices

##### Returns:

Type:
  `Multiline`

#### findEdgeByPoint(pt) → {Edge}

Returns edge which contains given point

Source:
  - classes/multiline.js, line 122

##### Parameters:

Name | Type | Description
--- | --- | ---
`pt` | `Point` |

##### Returns:

Type:
  `Edge`

#### translate(vec) → {Multiline}

Returns new multiline translated by vector vec

Source:
  - classes/multiline.js, line 138

##### Parameters:

Name | Type | Description
--- | --- | ---
`vec` | `Vector` |

##### Returns:

Type:
  `Multiline`

#### 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 counter clockwise, negative - clockwise

Source:
  - classes/multiline.js, line 150

##### Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`angle` | `number` | 0 | rotation angle in radians
`center` | `Point` |  | rotation center, default is (0,0)

##### Returns:

Type:
  `Multiline`

- new rotated polygon

#### transform(matrix) → {Multiline}

Return new multiline transformed using affine transformation matrix Method does not support unbounded shapes

Source:
  - classes/multiline.js, line 160

##### Parameters:

Name | Type | Description
--- | --- | ---
`matrix` | `Matrix` | affine transformation matrix

##### Returns:

Type:
  `Multiline`

- new multiline

#### toShapes() → {Array.<Shape>}

Transform multiline into array of shapes

Source:
  - classes/multiline.js, line 168

##### Returns:

Type:
  `Array.<Shape>`

#### toJSON() → {Object}

This method returns an object that defines how data will be serialized when called JSON.stringify() method

Source:
  - classes/multiline.js, line 177

##### Returns:

Type:
  `Object`

#### svg(attrs) → {string}

Return string to draw multiline in svg

Source:
  - classes/multiline.js, line 189

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrs` |  | an object with attributes for svg path element, like "stroke", "strokeWidth", "fill", "fillRule", "fillOpacity" Defaults are stroke:"black", strokeWidth:"1", fill:"lightcyan", fillRule:"evenodd", fillOpacity: "1" TODO: support infinite Ray and Line

##### Returns:

Type:
  `string`