@mocanvas/editor · class

TransformedGeometry2d

declare class TransformedGeometry2d extends Geometry2d

Another geometry seen through an affine transform.

Every query is answered by mapping the question into the source geometry's own space, asking it there, and mapping the answer back — so a transformed geometry costs one matrix inversion rather than a rebuilt outline, and stays exact for anything the source answers exactly.


Methods · 8

constructor(geometry: Geometry2d, matrix: MatModel, opts?: TransformedGeometry2dOptions)
distanceToPoint(point: VecLike, hitInside?: boolean, filters?: Geometry2dFilters): number
getBoundsVertices(): Vec[]
getVertices(filters?: Geometry2dFilters): Vec[]
hitTestPoint(point: VecLike, margin?: number, hitInside?: boolean, filters?: Geometry2dFilters): boolean
ignoreHit(point: VecLike): boolean
nearestPoint(point: VecLike, filters?: Geometry2dFilters): Vec
toPathWords(): number[]

Properties · 2

readonly geometry: Geometry2d
readonly matrix: Mat

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.