Table of contents

Extends Geometry2d.

class Group2d extends Geometry2d {}

Constructor

Constructs a new instance of the Group2d class

Parameters
NameDescription

config

Omit<
  Geometry2dOptions,
  'isClosed' | 'isFilled'
> & {
  children: Geometry2d[]
}

Properties

area

from Geometry2d
get area(): number

bounds

from Geometry2d
get bounds(): Box

center

from Geometry2d
get center(): Vec

children

children: Geometry2d[]

debugColor

from Geometry2d
debugColor?: string

ignore

from Geometry2d
ignore?: boolean

ignoredChildren

ignoredChildren: Geometry2d[]

isClosed

from Geometry2d
isClosed: boolean

isFilled

from Geometry2d
isFilled: boolean

isLabel

from Geometry2d
isLabel: boolean

length

from Geometry2d
get length(): number

vertices

from Geometry2d
get vertices(): Vec[]

Methods

distanceToLineSegment()

from Geometry2d
distanceToLineSegment(A: Vec, B: Vec): number
Parameters
NameDescription

A

Vec

B

Vec
Returns
number

distanceToPoint()

distanceToPoint(point: Vec, hitInside?: boolean): number
Parameters
NameDescription

point

Vec

hitInside

boolean
Returns
number

getArea()

getArea(): number

getBounds()

from Geometry2d
getBounds(): Box

getLength()

getLength(): number

getSvgPathData()

getSvgPathData(): string

getVertices()

getVertices(): Vec[]

hitTestLineSegment()

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

A

Vec

B

Vec

zoom

number
Returns
boolean

hitTestPoint()

hitTestPoint(point: Vec, margin: number, hitInside: boolean): boolean
Parameters
NameDescription

point

Vec

margin

number

hitInside

boolean
Returns
boolean

isPointInBounds()

from Geometry2d
isPointInBounds(point: Vec, margin?: number): boolean
Parameters
NameDescription

point

Vec

margin

number
Returns
boolean

nearestPoint()

nearestPoint(point: Vec): Vec
Parameters
NameDescription

point

Vec
Returns
Vec

nearestPointOnLineSegment()

from Geometry2d
nearestPointOnLineSegment(A: Vec, B: Vec): Vec
Parameters
NameDescription

A

Vec

B

Vec
Returns
Vec

toSimpleSvgPath()

toSimpleSvgPath(): string

Geometry2dGroupShapeUtil