@weasel-js/geom
v1.9.3
Published
Pure geometry kernel for @weasel-js/core: affine, box, curve, polyline, the Path command stream and its math, and easing curves in 2D. Dependency-free core; curve representations in ./curves, tessellation in ./tessellate (earcut), polygon booleans and pat
Readme
@weasel-js/geom
Pure 2D geometry kernel for @weasel-js/core: affine, box, curve, polyline, the
Path command stream and the math over it (builders, SVG d parsing, bounds,
transforms, hit-testing, sampling, curve fitting), and easing curves.
Dependency-free core. Subpaths:
./curves— alternate curve representations (cubic and quadratic Bezier, NURBS, Spiro)./tessellate— fill tessellation, polylines and trimming; needs the optional peerearcut./booleans— polygon booleans and path splitting; needs the optional peerpolygon-clipping./3d— vectors, quaternions, 4x4 matrices and ray intersection./nd— the port-curve rule (portControls,portCurvePoints,PORT_REACH) over plain number arrays, for any dimension
Part of weasel, a domain-agnostic 2D scene-graph canvas kit for React. See the API reference.
Install
npm install @weasel-js/geomUsage
import { /* … */ } from '@weasel-js/geom';
import { /* … */ } from '@weasel-js/geom/booleans';
import { /* … */ } from '@weasel-js/geom/curves';
import { /* … */ } from '@weasel-js/geom/tessellate';License
MIT
