@thi.ng/geom-axidraw
Version:
Conversion and preparation of thi.ng/geom shapes & shape groups to/from AxiDraw pen plotter draw commands
47 lines • 1.52 kB
TypeScript
import type { DrawCommand } from "@thi.ng/axidraw";
import type { Attribs } from "@thi.ng/geom";
export interface AsGeometryOpts {
/**
* If true (default), records all movements whilst pen is up (otherwise only
* whilst pen is down)
*/
rapids: boolean;
/**
* If true (default), records all pen up/down positions.
*/
pen: boolean;
/**
* Attributes for result groups/pointclouds.
*/
attribs: Partial<{
paths: Attribs;
rapids: Attribs;
ups: Attribs;
downs: Attribs;
}>;
}
/**
* Converts a sequence of
* [DrawCommands](https://docs.thi.ng/umbrella/axidraw/types/DrawCommand.html)
* into thi.ng/geom geometry. Returns an object of shapes. The conversion can be
* controlled via given options.
*
* @remarks
* The returned object contains groups & shapes which are being color coded by
* default:
*
* - `paths`: a group of polylines for which pen is down (#000)
* - `rapids`: a group of polylines for which pen is up (#0ff)
* - `ups`: a point cloud of positions where pen is being lifted (#0f0)
* - `downs`: a point cloud of positions where pen is being placed down (#f00)
*
* @param src
* @param opts
*/
export declare const asGeometry: (src: Iterable<DrawCommand>, opts?: Partial<AsGeometryOpts>) => {
paths: import("@thi.ng/geom").Group;
rapids: import("@thi.ng/geom").Group;
ups: import("@thi.ng/geom").Points;
downs: import("@thi.ng/geom").Points;
};
//# sourceMappingURL=as-geometry.d.ts.map