Port "Extend sparse infill" from Prusa (#2134)

* Remove BambuLab's implementation of solid infill bridging enhancement
, will use Prusa's instead

* Port "Extend sparse infill" from Prusa

* Improve anchoring by shifting the lines half-spacing

* Add missing fill patterns

* Improve anchoring by keeping fine details

* Make sure the opposite directions do not cancel each other

---------

Co-authored-by: Pavel Mikus <pavel.mikus.mail@seznam.cz>
This commit is contained in:
Noisyfox 2023-09-29 23:39:12 +08:00 committed by GitHub
parent 0e785c05e5
commit ee0e6a7227
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1017 additions and 506 deletions

View file

@ -3,6 +3,7 @@
#include "libslic3r.h"
#include "Surface.hpp"
#include <initializer_list>
#include <vector>
namespace Slic3r {
@ -26,12 +27,12 @@ public:
for (const Surface &surface : this->surfaces) if (surface.is_bottom() && surface.expolygon.contains(item)) return true;
return false;
}
SurfacesPtr filter_by_type(const SurfaceType type);
SurfacesPtr filter_by_types(const SurfaceType *types, int ntypes);
SurfacesPtr filter_by_type(const SurfaceType type) const;
SurfacesPtr filter_by_types(std::initializer_list<SurfaceType> types) const;
void keep_type(const SurfaceType type);
void keep_types(const SurfaceType *types, int ntypes);
void keep_types(std::initializer_list<SurfaceType> types);
void remove_type(const SurfaceType type);
void remove_types(const SurfaceType *types, int ntypes);
void remove_types(std::initializer_list<SurfaceType> types);
void filter_by_type(SurfaceType type, Polygons* polygons) const;
void remove_type(const SurfaceType type, ExPolygons *polygons);
void set_type(SurfaceType type) {
@ -54,6 +55,13 @@ public:
return false;
}
Surfaces::const_iterator cbegin() const { return this->surfaces.cbegin(); }
Surfaces::const_iterator cend() const { return this->surfaces.cend(); }
Surfaces::const_iterator begin() const { return this->surfaces.cbegin(); }
Surfaces::const_iterator end() const { return this->surfaces.cend(); }
Surfaces::iterator begin() { return this->surfaces.begin(); }
Surfaces::iterator end() { return this->surfaces.end(); }
void set(const SurfaceCollection &coll) { surfaces = coll.surfaces; }
void set(SurfaceCollection &&coll) { surfaces = std::move(coll.surfaces); }
void set(const ExPolygons &src, SurfaceType surfaceType) { clear(); this->append(src, surfaceType); }