Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kubric/geometry

cirbuk12MIT1.4.5TypeScript support: included

Javascript library for 2d geometry. Cloned from flattenjs

geometry, 2d, algorithms, shape, polygon, distance, intersection, relation, point in polygon, spatial search, affine transformations, boolean operations, polygon clipping, dimensionally extended 9-intersections model

readme

Javascript library for 2d geometry

This is a fork from @flattenjs/core with added functionality. Refer the docs of the original package. The changes and the additional features are added below

Importing

The import of the library has changed to the following

import Geometry from '@kubric/geometry'
const {Point, Vector, Circle, Line, Ray, Segment, Arc, Box, Polygon, Matrix, PlanarSet} = Geometry;

Circle

The Geometry.Circle class also supports checking for if a polygon is contained in a circle.