Bugfix: only_retract_when_crossing_perimeters was not correctly applied on bottom layer when no bottom solid layers were printed

This commit is contained in:
Alessandro Ranellucci 2014-12-22 11:46:16 +01:00
parent 540c2b8705
commit 93507bfd49
4 changed files with 15 additions and 15 deletions

View file

@ -344,7 +344,7 @@ sub travel_to {
if ($travel->length < scale $self->config->get_at('retract_before_travel', $self->writer->extruder->id) if ($travel->length < scale $self->config->get_at('retract_before_travel', $self->writer->extruder->id)
|| ($self->config->only_retract_when_crossing_perimeters || ($self->config->only_retract_when_crossing_perimeters
&& $self->config->fill_density > 0 && $self->config->fill_density > 0
&& defined($self->layer) && $self->layer->any_internal_region_slice_contains_line($travel)) && defined($self->layer) && $self->layer->any_internal_region_fill_surface_contains_line($travel))
|| (defined $role && $role == EXTR_ROLE_SUPPORTMATERIAL && $self->layer->support_islands->contains_line($travel)) || (defined $role && $role == EXTR_ROLE_SUPPORTMATERIAL && $self->layer->support_islands->contains_line($travel))
) { ) {
# Just perform a straight travel move without any retraction. # Just perform a straight travel move without any retraction.
@ -607,7 +607,7 @@ sub _plan {
# if the path is not contained in a single island we need to retract # if the path is not contained in a single island we need to retract
$gcode .= $gcodegen->retract $gcode .= $gcodegen->retract
if !$gcodegen->config->only_retract_when_crossing_perimeters if !$gcodegen->config->only_retract_when_crossing_perimeters
|| !$gcodegen->layer->any_internal_region_slice_contains_polyline($travel); || !$gcodegen->layer->any_internal_region_fill_surface_contains_polyline($travel);
# append the actual path and return # append the actual path and return
# use G1 because we rely on paths being straight (G0 may make round paths) # use G1 because we rely on paths being straight (G0 may make round paths)

View file

@ -122,15 +122,15 @@ Layer::make_slices()
template <class T> template <class T>
bool bool
Layer::any_internal_region_slice_contains(const T &item) const Layer::any_internal_region_fill_surface_contains(const T &item) const
{ {
FOREACH_LAYERREGION(this, layerm) { FOREACH_LAYERREGION(this, layerm) {
if ((*layerm)->slices.any_internal_contains(item)) return true; if ((*layerm)->fill_surfaces.any_internal_contains(item)) return true;
} }
return false; return false;
} }
template bool Layer::any_internal_region_slice_contains<Line>(const Line &item) const; template bool Layer::any_internal_region_fill_surface_contains<Line>(const Line &item) const;
template bool Layer::any_internal_region_slice_contains<Polyline>(const Polyline &item) const; template bool Layer::any_internal_region_fill_surface_contains<Polyline>(const Polyline &item) const;
#ifdef SLIC3RXS #ifdef SLIC3RXS

View file

@ -93,7 +93,7 @@ class Layer {
LayerRegion* add_region(PrintRegion* print_region); LayerRegion* add_region(PrintRegion* print_region);
void make_slices(); void make_slices();
template <class T> bool any_internal_region_slice_contains(const T &item) const; template <class T> bool any_internal_region_fill_surface_contains(const T &item) const;
protected: protected:
int _id; // sequential number of layer, 0-based int _id; // sequential number of layer, 0-based

View file

@ -69,10 +69,10 @@
%code%{ RETVAL = (int)(intptr_t)THIS; %}; %code%{ RETVAL = (int)(intptr_t)THIS; %};
void make_slices(); void make_slices();
bool any_internal_region_slice_contains_line(Line* line) bool any_internal_region_fill_surface_contains_line(Line* line)
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*line); %}; %code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*line); %};
bool any_internal_region_slice_contains_polyline(Polyline* polyline) bool any_internal_region_fill_surface_contains_polyline(Polyline* polyline)
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*polyline); %}; %code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*polyline); %};
}; };
%name{Slic3r::Layer::Support} class SupportLayer { %name{Slic3r::Layer::Support} class SupportLayer {
@ -119,8 +119,8 @@
Ref<ExPolygonCollection> slices() Ref<ExPolygonCollection> slices()
%code%{ RETVAL = &THIS->slices; %}; %code%{ RETVAL = &THIS->slices; %};
bool any_internal_region_slice_contains_line(Line* line) bool any_internal_region_fill_surface_contains_line(Line* line)
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*line); %}; %code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*line); %};
bool any_internal_region_slice_contains_polyline(Polyline* polyline) bool any_internal_region_fill_surface_contains_polyline(Polyline* polyline)
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*polyline); %}; %code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*polyline); %};
}; };