Geometry2d
See source codeTable of contents
- area
- bounds
- boundsVertices
- center
- debugColor
- excludeFromShapeBounds
- ignore
- isClosed
- isEmptyLabel
- isFilled
- isInternal
- isLabel
- length
- vertices
- Properties
- Methods
- distanceToLineSegment
- distanceToPoint
- getArea
- getBounds
- getBoundsVertices
- getLength
- getSvgPathData
- getVertices
- hitTestLineSegment
- hitTestPoint
- interpolateAlongEdge
- intersectCircle
- intersectLineSegment
- intersectPolygon
- intersectPolyline
- isExcludedByFilter
- isPointInBounds
- nearestPoint
- overlapsPolygon
- toSimpleSvgPath
- transform
- uninterpolateAlongEdge
abstract class Geometry2d {}Constructor
Constructs a new instance of the Geometry2d class
Parameters
| Name | Description |
|---|---|
|
Properties
area
readonly
get area(): numberbounds
readonly
get bounds(): BoxboundsVertices
readonly
get boundsVertices(): Vec[]center
readonly
get center(): VecdebugColor
optional
debugColor?: stringexcludeFromShapeBounds
excludeFromShapeBounds: booleanignore
optional
ignore?: booleanisClosed
isClosed: booleanisEmptyLabel
isEmptyLabel: booleanisFilled
isFilled: booleanisInternal
isInternal: booleanisLabel
isLabel: booleanlength
readonly
get length(): numbervertices
readonly
get vertices(): Vec[]Methods
distanceToLineSegment( )
distanceToLineSegment(
A: VecLike,
B: VecLike,
filters?: Geometry2dFilters
): numberParameters
| Name | Description |
|---|---|
| |
| |
|
Returns
numberdistanceToPoint( )
distanceToPoint(
point: VecLike,
hitInside?: boolean,
filters?: Geometry2dFilters
): numberParameters
| Name | Description |
|---|---|
| |
| |
|
Returns
numbergetArea( )
getArea(): numbergetBounds( )
getBounds(): BoxgetBoundsVertices( )
getBoundsVertices(): Vec[]getLength( )
getLength(_filters?: Geometry2dFilters): numberParameters
| Name | Description |
|---|---|
|
Returns
numbergetSvgPathData( )
abstract getSvgPathData(first: boolean): stringParameters
| Name | Description |
|---|---|
| |
Returns
stringgetVertices( )
abstract getVertices(filters: Geometry2dFilters): Vec[]Parameters
| Name | Description |
|---|---|
|
Returns
Vec[]hitTestLineSegment( )
hitTestLineSegment(
A: VecLike,
B: VecLike,
distance?: number,
filters?: Geometry2dFilters
): booleanParameters
| Name | Description |
|---|---|
| |
| |
| |
|
Returns
booleanhitTestPoint( )
hitTestPoint(
point: VecLike,
margin?: number,
hitInside?: boolean,
_filters?: Geometry2dFilters
): booleanParameters
| Name | Description |
|---|---|
| |
| |
| |
|
Returns
booleaninterpolateAlongEdge( )
Find a point along the edge of the geometry that is a fraction t along the entire way round.
interpolateAlongEdge(t: number, _filters?: Geometry2dFilters): VecParameters
| Name | Description |
|---|---|
| |
|
Returns
intersectCircle( )
intersectCircle(
center: VecLike,
radius: number,
_filters?: Geometry2dFilters
): VecLike[]Parameters
| Name | Description |
|---|---|
| |
| |
|
Returns
VecLike[]intersectLineSegment( )
intersectLineSegment(
A: VecLike,
B: VecLike,
_filters?: Geometry2dFilters
): VecLike[]Parameters
| Name | Description |
|---|---|
| |
| |
|
Returns
VecLike[]intersectPolygon( )
intersectPolygon(polygon: VecLike[], _filters?: Geometry2dFilters): VecLike[]Parameters
| Name | Description |
|---|---|
| |
|
Returns
VecLike[]intersectPolyline( )
intersectPolyline(
polyline: VecLike[],
_filters?: Geometry2dFilters
): VecLike[]Parameters
| Name | Description |
|---|---|
| |
|
Returns
VecLike[]isExcludedByFilter( )
isExcludedByFilter(filters?: Geometry2dFilters): booleanParameters
| Name | Description |
|---|---|
|
Returns
booleanisPointInBounds( )
isPointInBounds(point: VecLike, margin?: number): booleanParameters
| Name | Description |
|---|---|
| |
| |
Returns
booleannearestPoint( )
abstract nearestPoint(point: VecLike, _filters?: Geometry2dFilters): VecParameters
| Name | Description |
|---|---|
| |
|
Returns
overlapsPolygon( )
overlapsPolygon(_polygon: VecLike[]): booleanParameters
| Name | Description |
|---|---|
| |
Returns
booleantoSimpleSvgPath( )
toSimpleSvgPath(): stringtransform( )
transform(
transform: MatModel,
opts?: TransformedGeometry2dOptions
): Geometry2dParameters
| Name | Description |
|---|---|
| |
|
Returns
uninterpolateAlongEdge( )
Take point, find the closest point to it on the edge of the geometry, and return how far
along the edge it is as a fraction of the total length.
uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): numberParameters
| Name | Description |
|---|---|
| |
|
Returns
numberPrev
FontManagerNext
Group2d