// add bridge polys and substract them from normal and full fill polys void Layer::addBridgePolygons(const vector<Poly> newpolys) { if (newpolys.size()==0) return; bridgePolygons.clear(); Clipping clipp; clipp.clear(); clipp.addPolys(fillPolygons,subject); clipp.addPolys(newpolys,clip); vector<Poly> inter = clipp.intersect(); bridgePolygons= inter;//.insert(bridgePolygons.end(),inter.begin(),inter.end()); clipp.clear(); clipp.addPolys(fillPolygons,subject); clipp.addPolys(inter,clip); setNormalFillPolygons(clipp.substract()); mergeFullPolygons(true); }
// add full fill and substract them from normal fill polys void Layer::addFullPolygons(const vector<Poly> newpolys, bool decor) { if (newpolys.size()==0) return; Clipping clipp; clipp.clear(); // full fill only where already normal fill clipp.addPolys(fillPolygons,subject); clipp.addPolys(newpolys,clip); vector<Poly> inter = clipp.intersect(); if (decor) decorPolygons.insert(decorPolygons.end(),inter.begin(),inter.end()); else fullFillPolygons.insert(fullFillPolygons.end(),inter.begin(),inter.end()); //substract from normal fills clipp.clear(); clipp.addPolys(fillPolygons,subject); clipp.addPolys(inter,clip); setNormalFillPolygons(clipp.substract()); mergeFullPolygons(false); }