← Back

ofxPlotFinders

github.com/ofxyz/ofxPlotFinders · @ofxyz
OF 0.12 Graphics 2D

Plot finders turn images into strokes.

0 0 Last commit 2mo ago Created 5mo ago

README

ofxPlotFinders



Image-to-stroke plot finders.

Turns preprocessed greyscale layers into stroke buffers (ofPolyline / ofPath beziers). Optional RegionSet export uses the same find() pass (FinderRunFlags::EmitRegions).

Algorithms live under src/finders/ (one .cpp per finder). Shared helpers: src/sketch/ (sketch finders), src/HatchHelpers.* (parallel hatch line tracing). For scratch buffers, capabilities, regions, and commit-time geometry classification, see ARCHITECTURE.md.

Finders (registered)



PlotFinderIdPlotFinderTypeDisplay name
sketch / linesSketchLinesSketch Lines
sketch / curvesSketchCurvesSketch Curves
sketch / flowfieldSketchFlowFieldSketch Flow Field
sketch / sobelSketchSobelEdgesSketch Sobel Edges
hatch / crossCrossHatchCross Hatch
hatch / parallelParallelHatchParallel Hatch
hatch / streamlineStreamlineHatchStreamline Hatch
hatch / adaptiveAdaptiveHatchAdaptive Hatch
spiral / defaultSpiralSpiral (modulated)
spiral / archimedeanArchimedeanSpiralArchimedean Spiral
spiral / logarithmicLogarithmicSpiralLogarithmic Spiral
spiral / adaptiveAdaptiveSpiralAdaptive Spiral
stipple / dotsStipplingStippling
stipple / voronoiVoronoiStipplingVoronoi Stippling
structure / gridGridFinderGrid
structure / mazeMazeFinderMaze
structure / voronoiVoronoiFillVoronoi Fill
composite / chainCompositeFinderComposite
contour / edgesContoursContours
potrace / regionsPotracePotrace

Usage



#include "ofxPlotFinders.h"

PlotDoc doc(registry);
plotfind::FinderContext ctx(doc);
plotfind::FinderRegistry::instance().run(PlotFinderType::SketchLines, ctx, onProgress);


List available finders:

for (const auto& id : plotfind::FinderRegistry::instance().listIds()) {
    ofLog() << id.family << "/" << id.name;
}


Export partition regions (same find() pass):

plotfind::FinderContext ctx(doc);
const plotfind::RegionSet regions = plotfind::FinderRegistry::instance().runForRegions(
    PlotFinderType::CompositeFinder, ctx, onProgress);
for (const auto& region : regions.regions) {
    ofLog() << region.label << " avg=" << region.avgBrightness;
}


Paths and regions together:

plotfind::FinderRegistry::instance().run(
    PlotFinderType::Potrace, ctx, onProgress,
    plotfind::FinderRunFlags::EmitPaths | plotfind::FinderRunFlags::EmitRegions);


External semantic regions (faces, segmentation) use IRegionProvider and runFinderPerRegion(). Heavier external library backed providers (e.g. OpenCV) live in optional ofxPlotRegions.

Tests



Unit + golden smoke tests via ofxImGuiTestSuite:

cd addons/ofxPlotFinders/example-test
make -j4


Sources: tests/ · details: tests/README.md

Dependencies



PieceRole
ofxPlotterPlotDoc, PlotterComponents.h
ofxEnTTKitECS layer components
ofxPotracelibpotrace (GPL) for the Potrace finder
TODO: ofxPotrace should be an external finder and register here...

Layout



src/
  ofxPlotFinders.h       # umbrella include
  IPlotFinder.h
  FinderCapabilities.h
  FinderContext.h / .cpp
  FinderRegistry.h / .cpp
  RegionTypes.h / RegionHelpers.h
  HatchHelpers.h / .cpp  # parallel hatch line tracing
  IRegionProvider.h
  finders/               # one algorithm per pair .h/.cpp
  sketch/                # shared sketch helpers
tests/                   # IM_REGISTER_TEST suites
example-test/            # ofxImGuiTestSuite runner app
.clang-format


Related addons (ofxPlot)



AddonGitHub
ofxPlotFinders (this)ofxyz/ofxPlotFinders
ofxPlotterofxyz/ofxPlotter
ofxPlotProcessorsofxyz/ofxPlotProcessors
ofxPlotRegionsofxyz/ofxPlotRegions

Licence



GPL today, MIT After Potrace dep has moved out.

Get this addon

HTTPS
SSH