Quantcast
Viewing all articles
Browse latest Browse all 40524

Svg image to Ilda Laser - normalisation of the polyline?

@drakko :

I can get 60 fps with this one, but as you can see, there is no distinction between shapes :

    svg.load("batman.svg");
for (int i = 0; i < svg.getNumPath(); i++){
    ofPath p = svg.getPathAt(i);
    p.setPolyWindingMode(OF_POLY_WINDING_ODD);
    vector<ofPolyline>& lines = p.getOutline();
    for(int j=0;j<(int)lines.size();j++){
        outlines.push_back(lines[j].getResampledBySpacing(1));
    }
}
for (int i = 0; i < (int)outlines.size(); i++){
    line = outlines[i];
    ofBeginShape();
    for (int j = 0; j < line.size(); j++){
        line2.addVertex(ofMap(line[j].x, 0, svg.getWidth(), 0, 1),ofMap(line[j].y, 0, svg.getHeight(), 0, 1) ,0);
    }
    ofEndShape();
    
}


Viewing all articles
Browse latest Browse all 40524

Trending Articles