This project is part of the @thi.ng/umbrella monorepo.
Freely customizable, iterative nD subdivision curves for open / closed geometries. This is a support package for @thi.ng/geom.
Based in principle on:
- Generating subdivision curves with L−systems on a GPU
- Clojure version thi.ng/geom-clj.
Supplied / implemented subdivision schemes:
- Split @ midpoints (open / closed)
- Split @ thirds (open / closed)
- Chaikin (open / closed)
- Cubic (closed only)
Chaikin (closed) | Chaikin (open) |
---|---|
STABLE - used in production
Search or submit any issues for this package
- @thi.ng/geom-splines - nD cubic & quadratic curve analysis, conversion, interpolation, splitting
yarn add @thi.ng/geom-subdiv-curve
ES module import:
<script type="module" src="https://cdn.skypack.dev/@thi.ng/geom-subdiv-curve"></script>
For Node.js REPL:
# with flag only for < v16
node --experimental-repl-await
> const geomSubdivCurve = await import("@thi.ng/geom-subdiv-curve");
Package sizes (gzipped, pre-treeshake): ESM: 697 bytes
import * as gsc from "@thi.ng/geom-subdiv-curve";
gsc.subdivide([[0,0], [100,0], [100,100], [0,100]], gsc.SUBDIV_CHAIKIN_CLOSED, 4)
Karsten Schmidt
If this project contributes to an academic publication, please cite it as:
@misc{thing-geom-subdiv-curve,
title = "@thi.ng/geom-subdiv-curve",
author = "Karsten Schmidt",
note = "https://thi.ng/geom-subdiv-curve",
year = 2016
}
© 2016 - 2021 Karsten Schmidt // Apache Software License 2.0