Created
August 1, 2014 21:53
-
-
Save larsberg/4b80d84e81562b6024ee to your computer and use it in GitHub Desktop.
Revisions
-
larsberg created this gist
Aug 1, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ static void addSvgToMesh(string dir, ofMesh& m) { ofxSVG svg; svg.load(dir); for ( auto i=0; i<svg.getNumPath(); i++ ) { auto& path = svg.getPathAt(i); path.simplify(); auto pm = path.getTessellation(); if(pm.getIndices().size()) { auto& v = pm.getVertices(); for(auto& i: pm.getIndices()) m.addVertex(v[i]); } else { for(auto& v: pm.getVertices()) m.addVertex(v); } } }