Group2d

See source code
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

readonly
get area(): number;

bounds

readonly
get bounds(): Box;

boundsVertices

readonly
get boundsVertices(): Vec[];

center

readonly
get center(): Vec;

children

children: Geometry2d[];

debugColor

optional
debugColor?: string;

excludeFromShapeBounds

excludeFromShapeBounds: boolean;

ignore

optional
ignore?: boolean;

ignoredChildren

ignoredChildren: Geometry2d[];

isClosed

isClosed: boolean;

isEmptyLabel

isEmptyLabel: boolean;

isFilled

isFilled: boolean;

isInternal

isInternal: boolean;

isLabel

isLabel: boolean;

length

readonly
get length(): number;

vertices

readonly
get vertices(): Vec[];

Methods

distanceToLineSegment( )

distanceToLineSegment(
  A: VecLike,
  B: VecLike,
  filters?: Geometry2dFilters,
): number;

Parameters

NameDescription

A

VecLike;

B

VecLike;

filters

Returns

number;

distanceToPoint( )

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

Parameters

NameDescription

point

VecLike;

hitInside

boolean;

filters

Returns

number;

getArea( )

getArea(): number;

getBounds( )

getBounds(): Box;

getBoundsVertices( )

getBoundsVertices(): Vec[];

getLength( )

getLength(filters?: Geometry2dFilters): number;

Parameters

NameDescription

filters

Returns

number;

getSvgPathData( )

getSvgPathData(): string;

getVertices( )

getVertices(filters: Geometry2dFilters): Vec[];

Parameters

NameDescription

filters

Returns

Vec[];

hitTestLineSegment( )

hitTestLineSegment(
  A: VecLike,
  B: VecLike,
  zoom: number,
  filters?: Geometry2dFilters,
): boolean;

Parameters

NameDescription

A

VecLike;

B

VecLike;

zoom

number;

filters

Returns

boolean;

hitTestPoint( )

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

Parameters

NameDescription

point

VecLike;

margin

number;

hitInside

boolean;

filters

Returns

boolean;

ignoreHit( )

Called after a hit test succeeds. Return true to reject the hit and allow shapes behind this one to be selected instead (e.g. transparent image pixels).

ignoreHit(_point: VecLike): boolean;

Parameters

NameDescription

_point

VecLike;

Returns

boolean;

interpolateAlongEdge( )

interpolateAlongEdge(t: number, filters?: Geometry2dFilters): Vec;

Parameters

NameDescription

t

number;

filters

Returns

Vec;

intersectCircle( )

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

Parameters

NameDescription

center

VecLike;

radius

number;

filters

Returns

VecLike[];

intersectLineSegment( )

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

Parameters

NameDescription

A

VecLike;

B

VecLike;

filters

Returns

VecLike[];

intersectPolygon( )

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

Parameters

NameDescription

polygon

VecLike[];

filters

Returns

VecLike[];

intersectPolyline( )

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

Parameters

NameDescription

polyline

VecLike[];

filters

Returns

VecLike[];

isExcludedByFilter( )

isExcludedByFilter(filters?: Geometry2dFilters): boolean;

Parameters

NameDescription

filters

Returns

boolean;

isPointInBounds( )

isPointInBounds(point: VecLike, margin?: number): boolean;

Parameters

NameDescription

point

VecLike;

margin

number;

Returns

boolean;

nearestPoint( )

nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec;

Parameters

NameDescription

point

VecLike;

filters

Returns

Vec;

overlapsPolygon( )

overlapsPolygon(polygon: VecLike[]): boolean;

Parameters

NameDescription

polygon

VecLike[];

Returns

boolean;

toSimpleSvgPath( )

toSimpleSvgPath(): string;

transform( )

transform(transform: Mat): Geometry2d;

Parameters

NameDescription

transform

Mat;

Returns


uninterpolateAlongEdge( )

uninterpolateAlongEdge(point: VecLike, filters?: Geometry2dFilters): number;

Parameters

NameDescription

point

VecLike;

filters

Returns

number;

Prev
Geometry2d
Next
GroupShapeUtil