Table of contents

Extends Geometry2d.

class Edge2d extends Geometry2d {}

Constructor

Constructs a new instance of the Edge2d class

Parameters

NameDescription

config

{
  end: Vec
  start: Vec
}

Properties

area

readonly
get area(): number

bounds

readonly
get bounds(): Box

center

readonly
get center(): Vec

d

d: Vec

debugColor

optional
debugColor?: string

end

end: Vec

ignore

optional
ignore?: boolean

isClosed

isClosed: boolean

isFilled

isFilled: boolean

isInternal

isInternal: boolean

isLabel

isLabel: boolean

length

readonly
get length(): number

start

start: Vec

u

u: Vec

ul

ul: number

vertices

readonly
get vertices(): Vec[]

Methods

distanceToLineSegment()

distanceToLineSegment(A: Vec, B: Vec, filters?: Geometry2dFilters): number

Parameters

NameDescription

A

B

filters

Returns

number

distanceToPoint()

distanceToPoint(
  point: Vec,
  hitInside?: boolean,
  filters?: Geometry2dFilters
): number

Parameters

NameDescription

point

hitInside

boolean

filters

Returns

number

getArea()

getArea(): number

getBounds()

getBounds(): Box

getLength()

getLength(): number

getSvgPathData()

getSvgPathData(first?: boolean): string

Parameters

NameDescription

first

boolean

Returns

string

getVertices()

getVertices(): Vec[]

hitTestLineSegment()

hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean

Parameters

NameDescription

A

B

distance

number

Returns

boolean

hitTestPoint()

hitTestPoint(
  point: Vec,
  margin?: number,
  hitInside?: boolean,
  filters?: Geometry2dFilters
): boolean

Parameters

NameDescription

point

margin

number

hitInside

boolean

filters

Returns

boolean

intersectCircle()

intersectCircle(
  center: VecLike,
  radius: number,
  filters?: Geometry2dFilters
): VecLike[]

Parameters

NameDescription

center

radius

number

filters

Returns


intersectLineSegment()

intersectLineSegment(
  A: VecLike,
  B: VecLike,
  filters?: Geometry2dFilters
): VecLike[]

Parameters

NameDescription

A

B

filters

Returns


intersectPolygon()

intersectPolygon(polygon: VecLike[], filters?: Geometry2dFilters): VecLike[]

Parameters

NameDescription

polygon

filters

Returns


intersectPolyline()

intersectPolyline(polyline: VecLike[], filters?: Geometry2dFilters): VecLike[]

Parameters

NameDescription

polyline

filters

Returns


isExcludedByFilter()

isExcludedByFilter(filters?: Geometry2dFilters): boolean

Parameters

NameDescription

filters

Returns

boolean

isPointInBounds()

isPointInBounds(point: Vec, margin?: number): boolean

Parameters

NameDescription

point

margin

number

Returns

boolean

midPoint()

midPoint(): Vec

nearestPoint()

nearestPoint(point: Vec): Vec

Parameters

NameDescription

point

Returns


nearestPointOnLineSegment()

Deprecated: Iterate the vertices instead.

nearestPointOnLineSegment(A: Vec, B: Vec): Vec

Parameters

NameDescription

A

B

Returns


toSimpleSvgPath()

toSimpleSvgPath(): string

transform()

transform(transform: MatModel): Geometry2d

Parameters

NameDescription

transform

Returns


Prev
CubicSpline2d
Next
EdgeScrollManager