What is p5.plotSvg?
mainp5.plotSvg is a p5.js library designed to export SVG files specifically tailored for path-based vector output devices like pen plotters (e.g., AxiDraw), laser cutters, and CNC machines.
Key Characteristics
- Geometry-focused: It focuses on the geometry of paths rather than visual styling. It assumes the final appearance is determined by the physical tool used.
- Non-intrusive: It does not interfere with graphics performance during animations.
- Machine-friendly: It includes features like filtering degenerate paths, sanitizing numeric values, clamping coordinates, and controlling decimal precision.
- Plotting Workflows: Supports Inkscape-compatible layer metadata, SVG group naming/merging, and grouping by stroke-color to support multi-pen workflows.
Compatibility
- p5.js: Compatible with versions 1.4.2 through 1.11.13. Support for p5.js v2 is available for most 2D geometry export and is under active development for newer v2 curve and spline features.