• Public
  • Public/Protected
  • All



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


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


BETA - possibly breaking changes forthcoming

Search or submit any issues for this package


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.30 KB / CJS: 10.52 KB / UMD: 9.95 KB


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


Generated API docs



Karsten Schmidt

If this project contributes to an academic publication, please cite it as:

  title = "@thi.ng/geom",
  author = "Karsten Schmidt",
  note = "https://thi.ng/geom",
  year = 2013


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

Generated using TypeDoc