Fix of infill type update with vase mode enabled after change
of the number of bottom layers. related to [2.2.1-RC] Vase mode prints base no matter what #3823
This commit is contained in:
parent
bd1a128ef8
commit
7f376fa927
4 changed files with 14 additions and 9 deletions
|
@ -114,7 +114,7 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
|
||||||
if (surface.surface_type == stInternalVoid)
|
if (surface.surface_type == stInternalVoid)
|
||||||
has_internal_voids = true;
|
has_internal_voids = true;
|
||||||
else {
|
else {
|
||||||
FlowRole extrusion_role = (surface.surface_type == stTop) ? frTopSolidInfill : (surface.is_solid() ? frSolidInfill : frInfill);
|
FlowRole extrusion_role = surface.is_top() ? frTopSolidInfill : (surface.is_solid() ? frSolidInfill : frInfill);
|
||||||
bool is_bridge = layer.id() > 0 && surface.is_bridge();
|
bool is_bridge = layer.id() > 0 && surface.is_bridge();
|
||||||
params.extruder = layerm.region()->extruder(extrusion_role);
|
params.extruder = layerm.region()->extruder(extrusion_role);
|
||||||
params.pattern = layerm.region()->config().fill_pattern.value;
|
params.pattern = layerm.region()->config().fill_pattern.value;
|
||||||
|
@ -132,7 +132,7 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
|
||||||
is_bridge ?
|
is_bridge ?
|
||||||
erBridgeInfill :
|
erBridgeInfill :
|
||||||
(surface.is_solid() ?
|
(surface.is_solid() ?
|
||||||
((surface.surface_type == stTop) ? erTopSolidInfill : erSolidInfill) :
|
(surface.is_top() ? erTopSolidInfill : erSolidInfill) :
|
||||||
erInternalInfill);
|
erInternalInfill);
|
||||||
params.bridge_angle = float(surface.bridge_angle);
|
params.bridge_angle = float(surface.bridge_angle);
|
||||||
params.angle = float(Geometry::deg2rad(layerm.region()->config().fill_angle.value));
|
params.angle = float(Geometry::deg2rad(layerm.region()->config().fill_angle.value));
|
||||||
|
|
|
@ -117,7 +117,7 @@ void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Poly
|
||||||
// Voids are sparse infills if infill rate is zero.
|
// Voids are sparse infills if infill rate is zero.
|
||||||
Polygons voids;
|
Polygons voids;
|
||||||
for (const Surface &surface : this->fill_surfaces.surfaces) {
|
for (const Surface &surface : this->fill_surfaces.surfaces) {
|
||||||
if (surface.surface_type == stTop) {
|
if (surface.is_top()) {
|
||||||
// Collect the top surfaces, inflate them and trim them by the bottom surfaces.
|
// Collect the top surfaces, inflate them and trim them by the bottom surfaces.
|
||||||
// This gives the priority to bottom surfaces.
|
// This gives the priority to bottom surfaces.
|
||||||
surfaces_append(top, offset_ex(surface.expolygon, margin, EXTERNAL_SURFACES_OFFSET_PARAMETERS), surface);
|
surfaces_append(top, offset_ex(surface.expolygon, margin, EXTERNAL_SURFACES_OFFSET_PARAMETERS), surface);
|
||||||
|
@ -313,7 +313,7 @@ void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Poly
|
||||||
s2.clear();
|
s2.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s1.surface_type == stTop)
|
if (s1.is_top())
|
||||||
// Trim the top surfaces by the bottom surfaces. This gives the priority to the bottom surfaces.
|
// Trim the top surfaces by the bottom surfaces. This gives the priority to the bottom surfaces.
|
||||||
polys = diff(polys, bottom_polygons);
|
polys = diff(polys, bottom_polygons);
|
||||||
surfaces_append(
|
surfaces_append(
|
||||||
|
|
|
@ -817,11 +817,12 @@ void PrintObject::detect_surfaces_type()
|
||||||
m_layers[idx_layer]->m_regions[idx_region]->slices.surfaces = std::move(surfaces_new[idx_layer]);
|
m_layers[idx_layer]->m_regions[idx_region]->slices.surfaces = std::move(surfaces_new[idx_layer]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spiral_vase && num_layers > 1) {
|
if (spiral_vase) {
|
||||||
// Turn the last bottom layer infill to a top infill, so it will be extruded with a proper pattern.
|
if (num_layers > 1)
|
||||||
Surfaces &surfaces = m_layers[num_layers - 1]->m_regions[idx_region]->slices.surfaces;
|
// Turn the last bottom layer infill to a top infill, so it will be extruded with a proper pattern.
|
||||||
for (Surface &surface : surfaces)
|
m_layers[num_layers - 1]->m_regions[idx_region]->slices.set_type(stTop);
|
||||||
surface.surface_type = stTop;
|
for (size_t i = num_layers; i < m_layers.size(); ++ i)
|
||||||
|
m_layers[i]->m_regions[idx_region]->slices.set_type(stInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Detecting solid surfaces for region " << idx_region << " - clipping in parallel - start";
|
BOOST_LOG_TRIVIAL(debug) << "Detecting solid surfaces for region " << idx_region << " - clipping in parallel - start";
|
||||||
|
|
|
@ -34,6 +34,10 @@ public:
|
||||||
void remove_type(const SurfaceType type);
|
void remove_type(const SurfaceType type);
|
||||||
void remove_types(const SurfaceType *types, int ntypes);
|
void remove_types(const SurfaceType *types, int ntypes);
|
||||||
void filter_by_type(SurfaceType type, Polygons* polygons);
|
void filter_by_type(SurfaceType type, Polygons* polygons);
|
||||||
|
void set_type(SurfaceType type) {
|
||||||
|
for (Surface &surface : this->surfaces)
|
||||||
|
surface.surface_type = type;
|
||||||
|
}
|
||||||
|
|
||||||
void clear() { surfaces.clear(); }
|
void clear() { surfaces.clear(); }
|
||||||
bool empty() const { return surfaces.empty(); }
|
bool empty() const { return surfaces.empty(); }
|
||||||
|
|
Loading…
Add table
Reference in a new issue