Table of contents

Public class

Signature
class Polyline2d extends Geometry2d {}
References

Geometry2d

Source

packages/editor/src/lib/primitives/geometry/Polyline2d.ts


Constructor

Public constructor

Constructs a new instance of the Polyline2d class

Parameters
NameDescription

config

Omit<
  Geometry2dOptions,
  'isClosed' | 'isFilled'
> & {
  points: Vec[]
}
References

Vec


Properties



length

Public readonly property

Signature
get length(): number

points

Public property

Signature
points: Vec[]
References

Vec


segments

Public readonly property

Signature
get segments(): Edge2d[]
References

Edge2d


Methods

getVertices()

Public method

Signature
getVertices(): Vec[]
References

Vec


hitTestLineSegment()

Public method

Signature
hitTestLineSegment(A: Vec, B: Vec, zoom: number): boolean
Parameters
NameDescription

A

Vec

B

Vec

zoom

number
Returns
boolean
References

Vec


nearestPoint()

Public method

Signature
nearestPoint(A: Vec): Vec
Parameters
NameDescription

A

Vec
Returns
Vec
References

Vec


polygonsIntersectPositionedOnCanvas