UNPKG

@thi.ng/geom

Version:

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

18 lines (17 loc) 316 B
import { ensureArray } from "@thi.ng/arrays/ensure-array"; class APC { constructor(points, attribs) { this.attribs = attribs; this.points = points ? ensureArray(points) : []; } points; *[Symbol.iterator]() { yield* this.points; } clear() { this.points.length = 0; } } export { APC };