UNPKG

@thi.ng/geom

Version:

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

10 lines (9 loc) 337 B
import { ComplexPolygon } from "./api/complex-polygon.js"; import { asPolygon } from "./as-polygon.js"; const complexPolygonFromPath = (path, opts, attribs) => { const [boundary, ...children] = asPolygon(path, opts); return new ComplexPolygon(boundary, children, attribs || boundary.attribs); }; export { complexPolygonFromPath };