| Addon | Role |
|---|---|
| ofxPlotGenerators | Pixel Generation + Direct path geometry (procedural) |
| ofxPlotFinders | Raster / image → strokes (ofPath in plotter layers) |
| ofxPlotter | Authoring, layers, export (ImageToPath::toStrokeDocument) |
| ofxPlotProcessors (this) | Optimize paths before G-code |
Geometry in the pipeline is ofPath where bezier curves are preserved wherever possible.
Affine processors (scale, rotate, translate, skew, layout) transform control points directly. Vertex-level processors (simplify, snap, clip, squiggles) tessellate internally when needed, then rebuild as lineTo paths.
paths— oneofPathper pen-down strokemeta— parallelStrokeMeta(closed,allowReverse,locked,layerId, color, …)bounds— cached AABB from path commands; callrebuildBounds()after edits
Helper accessors: pathStart(index), pathEnd(index), pathLengthMM(index) (tessellated length for metrics).
Each processor implements:
id()— stable key (e.g."line_merge")displayName()— UI labelprocess(doc, options, result?)— in-place mutationdefaultOptions()—ofJsondefaults
Singleton registry of built-in processors. Lookup by id() for pipeline steps and UI.
Ordered list of { processorId, enabled, options }. Methods:
run(doc)/runFrom(doc, stepIndex)runWithReport(doc)— per-stepPlotMetricsbefore/afterloadPreset(path)/savePreset(path)PlotPipeline::defaults()— merge + sort on, squiggles/filter off
pathCount, vertexCount, drawLengthMM, travelLengthMM — used for “travel saved” UI.
vertexCount and draw length are derived from tessellated outlines (for consistent metrics across curved paths).
Uniform-grid spatial index for path endpoint merge/sort (pathStartPt / pathEndPt).
Most geometry processors respect optional JSON filter:
"layer_ids": [1, 2]If omitted or empty, all layers are affected. Merge/sort/shuffle run per layer in first-seen layer order.
- Subclass
IPlotProcessorundersrc/processors/ - Register in
ProcessorRegistry.cpp - Document options in Processors