From 61047f0df5eb1099162cf7d18d667919dd110cc3 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 30 Oct 2012 14:21:59 +0100 Subject: [PATCH] Define perimeter/infill overlap over spacing instead of width and increase it slightly to compensate --- lib/Slic3r.pm | 2 +- lib/Slic3r/Fill/Honeycomb.pm | 2 +- lib/Slic3r/Fill/Rectilinear.pm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index f7ffc3af8..3b99ab9e5 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -61,7 +61,7 @@ use constant RESOLUTION => 0.01; use constant OVERLAP_FACTOR => 0.5; use constant SMALL_PERIMETER_LENGTH => (6.5 / SCALING_FACTOR) * 2 * PI; use constant LOOP_CLIPPING_LENGTH_OVER_SPACING => 0.15; -use constant PERIMETER_INFILL_OVERLAP_OVER_WIDTH => 0.4; +use constant PERIMETER_INFILL_OVERLAP_OVER_SPACING => 0.45; # The following variables hold the objects used throughout the slicing # process. They should belong to the Print object, but we are keeping diff --git a/lib/Slic3r/Fill/Honeycomb.pm b/lib/Slic3r/Fill/Honeycomb.pm index ccbe89956..6698fb8e6 100644 --- a/lib/Slic3r/Fill/Honeycomb.pm +++ b/lib/Slic3r/Fill/Honeycomb.pm @@ -21,7 +21,7 @@ sub fill_surface { # infill math my $min_spacing = scale $params{flow_spacing}; my $distance = $min_spacing / $params{density}; - my $overlap_distance = ($self->layer ? $self->layer->flow->scaled_width : $Slic3r::flow->scaled_width) * &Slic3r::PERIMETER_INFILL_OVERLAP_OVER_WIDTH; + my $overlap_distance = scale $params{flow_spacing} * &Slic3r::PERIMETER_INFILL_OVERLAP_OVER_SPACING; my $cache_id = sprintf "d%s_s%s_a%s", $params{density}, $params{flow_spacing}, $rotate_vector->[0][0]; diff --git a/lib/Slic3r/Fill/Rectilinear.pm b/lib/Slic3r/Fill/Rectilinear.pm index 37de1521c..52737cb82 100644 --- a/lib/Slic3r/Fill/Rectilinear.pm +++ b/lib/Slic3r/Fill/Rectilinear.pm @@ -31,7 +31,7 @@ sub fill_surface { $flow_spacing = unscale $distance_between_lines; } - my $overlap_distance = ($self->layer ? $self->layer->flow->scaled_width : $Slic3r::flow->scaled_width) * &Slic3r::PERIMETER_INFILL_OVERLAP_OVER_WIDTH; + my $overlap_distance = scale $params{flow_spacing} * &Slic3r::PERIMETER_INFILL_OVERLAP_OVER_SPACING; my $x = $bounding_box->[X1]; my $is_line_pattern = $self->isa('Slic3r::Fill::Line');