Fix of "Don't use bridging perimeters on top of elephant-foot compensation #3011"

If the Elephant foot compensation is applied to the 1st object's layer,
the uncompensated 1st object's slice is newly used for calculation
of bridges, overhans, skirt, brim, raft and supports.

Layer::slices were renamed to Layer::lslices to simplify reading
of the code, to differentiate from LayerRegion::slices.
This commit is contained in:
bubnikv 2020-01-03 14:05:56 +01:00
parent a4ad0a0925
commit 3d17543d40
8 changed files with 158 additions and 137 deletions

View file

@ -106,12 +106,16 @@ public:
coordf_t print_z; // Z used for printing in unscaled coordinates
coordf_t height; // layer height in unscaled coordinates
// collection of expolygons generated by slicing the original geometry;
// also known as 'islands' (all regions and surface types are merged here)
// The slices are chained by the shortest traverse distance and this traversal
// order will be recovered by the G-code generator.
ExPolygons slices;
std::vector<BoundingBox> slices_bboxes;
// Collection of expolygons generated by slicing the possibly multiple meshes of the source geometry
// (with possibly differing extruder ID and slicing parameters) and merged.
// For the first layer, if the ELephant foot compensation is applied, this lslice is uncompensated, therefore
// it includes the Elephant foot effect, thus it corresponds to the shape of the printed 1st layer.
// These lslices aka islands are chained by the shortest traverse distance and this traversal
// order will be applied by the G-code generator to the extrusions fitting into these lslices.
// These lslices are also used to detect overhangs and overlaps between successive layers, therefore it is important
// that the 1st lslice is not compensated by the Elephant foot compensation algorithm.
ExPolygons lslices;
std::vector<BoundingBox> lslices_bboxes;
size_t region_count() const { return m_regions.size(); }
const LayerRegion* get_region(int idx) const { return m_regions.at(idx); }