# 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 12

### Classes

Multiline

### Members

#### box

(Getter) Return bounding box of the multiline

Source:
  - classes/multiline.js, line 56

#### edges

(Getter) Return array of edges

Source:
  - classes/multiline.js, line 48

#### vertices

(Getter) Returns array of vertices

Source:
  - classes/multiline.js, line 64

### Methods

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

Split edge and add new vertex, return new edge inserted

Source:
  - classes/multiline.js, line 84

##### Parameters:

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

##### Returns:

Type:
  `Edge`

#### clone() → {Multiline}

Return new cloned instance of Multiline

Source:
  - classes/multiline.js, line 74

##### Returns:

Type:
  `Multiline`

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

Returns edge which contains given point

Source:
  - classes/multiline.js, line 124

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

Source:
  - classes/multiline.js, line 152

##### 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

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

Split edges of multiline with intersection points and return mutated multiline

Source:
  - classes/multiline.js, line 111

##### 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:
  - classes/multiline.js, line 189

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrs` |  | an object with attributes for svg path element TODO: support semi-infinite Ray and infinite Line

##### Returns:

Type:
  `string`

#### toJSON() → {Object}

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

Source:
  - classes/multiline.js, line 179

##### Returns:

Type:
  `Object`

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

Transform multiline into array of shapes

Source:
  - classes/multiline.js, line 170

##### Returns:

Type:
  `Array.<Shape>`

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

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

Source:
  - classes/multiline.js, line 162

##### Parameters:

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

##### Returns:

Type:
  `Multiline`

- new multiline

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

Returns new multiline translated by vector vec

Source:
  - classes/multiline.js, line 140

##### Parameters:

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

##### Returns:

Type:
  `Multiline`