From b7f80bdefd3c639307043787860ff1cbd01f4573 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 31 Jan 2018 00:03:23 +0000 Subject: driver 0.1 --- drawing/src/ofApp.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'drawing/src/ofApp.cpp') diff --git a/drawing/src/ofApp.cpp b/drawing/src/ofApp.cpp index 4b25356..da00262 100644 --- a/drawing/src/ofApp.cpp +++ b/drawing/src/ofApp.cpp @@ -12,16 +12,26 @@ void ofApp::setup(){ svg.load("lorenzo.svg"); imagepaths= svg.getPaths(); + float simplify_factor=0.3f; + + std::stringstream strm; + for (auto& path:imagepaths){ path.setPolyWindingMode(OF_POLY_WINDING_ODD); + + vector outlines= path.getOutline(); for (auto& outline:outlines){ + strm << outline.size() << "->"; + outline.simplify(simplify_factor); + strm << outline.size() << " "; segmenters.push_back(lineSegmenter(outline)); } + strm << " , "; } - cout << "Drawing: found " << imagepaths.size() << " paths with " << segmenters.size() << " shapes" <getSegments(numsegments,coverage,phase); + for (auto segment=segments.begin();segment!=segments.end();segment++){ lasershapes.push_back(colourPolyline(*segment)); } } + + break; } case 1:{ -- cgit v1.2.3