Skip to content

Commit

Permalink
Bugfix: small gaps were left between infill and perimeters when solid…
Browse files Browse the repository at this point in the history
… infill extrusion width was much thinner than internal infill extrusion width. #2895
  • Loading branch information
alranel committed Jun 9, 2015
1 parent 911bed8 commit 1e23b82
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/Slic3r/Fill.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package Slic3r::Fill;
use Moo;

use List::Util qw(max);
use Slic3r::ExtrusionPath ':roles';
use Slic3r::Fill::3DHoneycomb;
use Slic3r::Fill::Base;
Expand Down Expand Up @@ -143,8 +144,12 @@ sub make_fill {
# we are going to grow such regions by overlapping them with the void (if any)
# TODO: detect and investigate whether there could be narrow regions without
# any void neighbors
my $distance_between_surfaces = $infill_flow->scaled_spacing;
{
my $distance_between_surfaces = max(
$infill_flow->scaled_spacing,
$solid_infill_flow->scaled_spacing,
$top_solid_infill_flow->scaled_spacing,
);
my $collapsed = diff(
[ map @{$_->expolygon}, @surfaces ],
offset2([ map @{$_->expolygon}, @surfaces ], -$distance_between_surfaces/2, +$distance_between_surfaces/2),
Expand All @@ -163,9 +168,6 @@ sub make_fill {
)};
}

# add spacing between surfaces
@surfaces = map @{$_->offset(-$distance_between_surfaces / 2)}, @surfaces;

if (0) {
require "Slic3r/SVG.pm";
Slic3r::SVG::output("fill_" . $layerm->print_z . ".svg",
Expand Down Expand Up @@ -234,11 +236,14 @@ sub make_fill {
$f->z($layerm->print_z);
$f->angle(deg2rad($layerm->config->fill_angle));
$f->loop_clipping(scale($flow->nozzle_diameter) * &Slic3r::LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER);
my @polylines = $f->fill_surface(
$surface,

# apply half spacing using this flow's own spacing and generate infill
my @polylines = map $f->fill_surface(
$_,
density => $density/100,
layer_height => $h,
);
), @{ $surface->offset(-scale($f->spacing)/2) };

next unless @polylines;

# calculate actual flow from spacing (which might have been adjusted by the infill
Expand Down

0 comments on commit 1e23b82

Please sign in to comment.