@mocanvas/mocanvas · class

PathBuilderGeometry2d

declare class PathBuilderGeometry2d extends Geometry2d

One run of a path, as a Geometry2d the editor can hit-test, snap to and export.


Methods · 5

constructor(path: PathBuilder, startIdx: number, endIdx: number, options: Geometry2dOptions)
getSegments(): Geometry2d[]

This run split into one geometry per segment.

The unit an arrow terminal or a handle is placed against: a caller that wants "the third edge of the shape" wants a segment, not the whole run.

getSvgPathData(first?: boolean): string
getVertices(_filters?: Geometry2dFilters): Vec[]
toPathWords(): number[]

Properties · 3

readonly endIdx: number
readonly path: PathBuilder
readonly startIdx: number

Mentioned here

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.