256{
259 auto [profile_use, config_substitutions] =
extract_profile(arch, profile_out);
260
262
263 struct Status
264 {
265 double incr, val, prev;
266 bool stop = false;
267 } st{100. / arch.entries.size(), 0., 0.};
268
269 for (const EntryBuffer &entry : arch.entries) {
270 if (st.stop) break;
271
272 st.val += st.incr;
273 double curr = std::round(st.val);
274 if (curr > st.prev) {
275 st.prev = curr;
277 }
278
279
280
281 auto svgtxt = reserve_vector<char>(entry.buf.size() + 1);
282 std::copy(entry.buf.begin(), entry.buf.end(), std::back_inserter(svgtxt));
283 svgtxt.emplace_back('\0');
284 NanoSVGParser svgp(svgtxt.data());
285
287 for (NSVGshape *shape = svgp.image->shapes; shape != nullptr; shape = shape->next) {
288 for (NSVGpath *path = shape->paths; path != nullptr; path = path->next) {
290 for (int i = 0; i < path->npts; ++i) {
292 p.points.emplace_back(
scaled(
Vec2f(path->pts[c], path->pts[c + 1])));
293 }
294 polys.emplace_back(p);
295 }
296 }
297
298
299
300
301
304 slices.emplace_back(expolys);
305 }
306
307
308 return std::move(config_substitutions);
309}
@ pftNonZero
Definition clipper.hpp:81
std::vector< Polygon, PointsAllocator< Polygon > > Polygons
Definition Polygon.hpp:15
std::pair< DynamicPrintConfig, ConfigSubstitutions > extract_profile(const ZipperArchive &arch, DynamicPrintConfig &profile_out)
Definition ZipperArchiveImport.cpp:110
BoundingBox scaled(const BoundingBoxf &bb)
Definition BoundingBox.hpp:240
Slic3r::ExPolygons union_ex(const Slic3r::Polygons &subject, ClipperLib::PolyFillType fill_type)
Definition ClipperUtils.cpp:774
std::vector< ExPolygon > ExPolygons
Definition ExPolygon.hpp:13
const constexpr char * CONFIG_FNAME
Definition ZipperArchiveImport.hpp:29
void invert_raster_trafo(ExPolygons &expolys, const sla::RasterBase::Trafo &trafo, coord_t width, coord_t height)
Definition SL1.cpp:277
const constexpr char * PROFILE_FNAME
Definition ZipperArchiveImport.hpp:30
Eigen::Matrix< float, 2, 1, Eigen::DontAlign > Vec2f
Definition Point.hpp:48
RasterParams get_raster_params(const DynamicPrintConfig &cfg)
Definition SL1.cpp:303
Slic3r::Polygon Polygon
Definition Emboss.cpp:34