Options
All
  • Public
  • Public/Protected
  • All
Menu

@thi.ng/geom

geom

npm versionnpm downloads Twitter Follow

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

For the Clojure version, please visit: thi.ng/geom-clj

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.44 KB / CJS: 10.77 KB / UMD: 10.12 KB

Dependencies

Usage examples

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

A selection:

ScreenshotDescriptionLive demoSource
Convex hull & shape clipping of 2D polygonsDemoSource
geom-fuzz basic shape & fill examplesDemoSource
Animated, recursive polygon tessellationsDemoSource
Poisson-disk shape-aware sampling, Voronoi & Minimum Spanning Tree visualizationDemoSource
Mouse gesture / stroke analysis, simplification, corner detectionDemoSource
2D Bezier curve-guided particle systemDemoSource
Animated arcs & drawing using hiccup-canvasDemoSource
Canvas based Immediate Mode GUI componentsDemoSource
Animated sine plasma effect visualized using contour linesDemoSource
Polygon to cubic curve conversion & visualizationDemoSource
Animated Voronoi diagram, cubic splines & SVG downloadDemoSource
2D scenegraph & shape pickingDemoSource
2D scenegraph & image map based geometry manipulationDemoSource
3D wireframe textmode demoDemoSource

API

Generated API docs

TODO

Authors

Karsten Schmidt

License

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

Generated using TypeDoc