Skip to content

Latest commit

 

History

History

geom

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

geom

npm version npm downloads Twitter Follow

This project is part of the @thi.ng/umbrella monorepo.

About

Functional, polymorphic API for 2D geometry types & SVG generation.

This project is a partially ported from the Clojure version of the same name. All polymorphic operations built on @thi.ng/defmulti.

Up-to-date feature matrix spreadsheet

This package acts as a higher-level frontend for most of the following related packages (which are more low-level, lightweight and usable by themselves too):

Support packages

Status

BETA - possibly breaking changes forthcoming

Search or submit any issues for this package

Installation

yarn add @thi.ng/geom
// ES module
<script type="module" src="https://unpkg.com/@thi.ng/geom?module" crossorigin></script>

// UMD
<script src="https://unpkg.com/@thi.ng/geom/lib/index.umd.js" crossorigin></script>

Package sizes (gzipped, pre-treeshake): ESM: 10.42 KB / CJS: 10.76 KB / UMD: 10.11 KB

Dependencies

Usage examples

Several demos in this repo's /examples directory are using this package.

A selection:

Screenshot Description Live demo Source
Convex hull & shape clipping of 2D polygons Demo Source
geom-fuzz basic shape & fill examples Demo Source
Animated, recursive polygon tessellations Demo Source
Poisson-disk shape-aware sampling, Voronoi & Minimum Spanning Tree visualization Demo Source
Mouse gesture / stroke analysis, simplification, corner detection Demo Source
2D Bezier curve-guided particle system Demo Source
Animated arcs & drawing using hiccup-canvas Demo Source
Canvas based Immediate Mode GUI components Demo Source
Animated sine plasma effect visualized using contour lines Demo Source
Polygon to cubic curve conversion & visualization Demo Source
Animated Voronoi diagram, cubic splines & SVG download Demo Source
2D scenegraph & shape picking Demo Source
2D scenegraph & image map based geometry manipulation Demo Source
3D wireframe textmode demo Demo Source

API

Generated API docs

TODO

Authors

Karsten Schmidt

License

© 2013 - 2020 Karsten Schmidt // Apache Software License 2.0