What problem does it solve?
This Skill provides a zero-dependency, pure TypeScript toolkit for computational geometry and data-structure utilities, enabling creative coding projects to run in both Deno and browser environments without external runtime requirements.
Core Features & Use Cases
- Voronoi diagrams with polygon extraction and point utilities for creative coding.
- Shape helpers for 2D geometry, polygon operations, and point-in-polygon testing.
- VariationTree for live-coding explorations and algorithmic experimentation.
- Finite sequence combiners (Zipper, RootLooper, Nester) for complex, reusable animation sequences.
- Zero external dependencies; runs in browser, Deno, or Node.
Use cases include visualizing Voronoi diagrams in generative art, interactive sketches, and exploratory data-driven visuals across environments.
Quick Start
Import the library and compute a simple Voronoi diagram:
- Import: import { Voronoi, getVoronoiPolygons, filterSimilarPoints } from '@avtools/creative-algs';
- Create: const vor = new Voronoi();
- Sites: const sites = [{ x: 100, y: 100 }, { x: 300, y: 200 }, { x: 200, y: 400 }];
- Diagram: const diagram = vor.compute(sites, { xl: 0, xr: 800, yt: 0, yb: 600 });
- Polygons: const polygons = getVoronoiPolygons(diagram, sites);