1.0.1 • Published 2 years ago

@are/laser-pointer v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Excalidraw Freehand

Usage

import { ExcalidrawFreehand } from '@excalidraw/freehand'

const stroke = new ExcalidrawFreehand(options)

stroke.addPoint([100, 200, 1])
stroke.close()

const outline = stroke.getStrokeOutline()

Options

PropertyTypeDefaultDescription
sizenumber2Radius of the stroke.
streamlinenumber0.42Interpolate input points to reduce jitter.
simplifynumber0.1Reduce stroke size by sacrificing precision.
simplifyPhase"input" \| "output" \| "tail""output"Decides when the simplification algorithm should be applied.
sizeMapping(details: SizeMappingDetails) => number() => 1Maps each point to a value between 0.0 and 1.0.
1.0.1

2 years ago

1.0.0

2 years ago