UNPKG

@thi.ng/geom

Version:

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

16 lines (15 loc) 404 B
import { map } from "@thi.ng/transducers/map"; import { copyVectors } from "@thi.ng/vectors/copy"; import { __copyAttribs } from "./copy.js"; const __pointArraysAsShapes = (ctor, points, attribs, copyPoints = true) => points ? [ ...map( (pts) => new ctor( copyPoints ? copyVectors(pts) : pts, __copyAttribs(attribs) ), points ) ] : void 0; export { __pointArraysAsShapes };