diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index e578b5494..20756bdd4 100644 --- a/lib/Slic3r/Fill.pm +++ b/lib/Slic3r/Fill.pm @@ -135,8 +135,7 @@ sub make_fill { $filler = $Slic3r::Config->solid_fill_pattern; if ($is_bridge) { $filler = 'rectilinear'; - my $width = sqrt($Slic3r::Config->bridge_flow_ratio * ($layer->infill_flow->nozzle_diameter**2)); - $flow_spacing = $width + &Slic3r::OVERLAP_FACTOR * ($width * PI / 4 - $width); # this should be moved to Flow.pm + $flow_spacing = $layer->infill_flow->bridge_spacing; } elsif ($surface->surface_type == S_TYPE_INTERNALSOLID) { $filler = 'rectilinear'; } @@ -157,6 +156,9 @@ sub make_fill { } my $params = shift @paths; + # ugly hack(tm) to get the right amount of flow (GCode.pm should be fixed) + $params->{flow_spacing} = $layer->infill_flow->bridge_width if $is_bridge; + # save into layer next unless @paths; push @fills, Slic3r::ExtrusionPath::Collection->new( diff --git a/lib/Slic3r/Flow.pm b/lib/Slic3r/Flow.pm index a035b9d37..01992e788 100644 --- a/lib/Slic3r/Flow.pm +++ b/lib/Slic3r/Flow.pm @@ -8,6 +8,8 @@ has 'layer_height' => (is => 'ro', default => sub { $Slic3r::Config->layer_ has 'width' => (is => 'rwp', builder => 1); has 'spacing' => (is => 'lazy'); +has 'bridge_width' => (is => 'lazy'); +has 'bridge_spacing' => (is => 'lazy'); has 'scaled_width' => (is => 'lazy'); has 'scaled_spacing' => (is => 'lazy'); @@ -67,6 +69,17 @@ sub clone { ); } +sub _build_bridge_width { + my $self = shift; + return sqrt($Slic3r::Config->bridge_flow_ratio * ($self->nozzle_diameter**2)); +} + +sub _build_bridge_spacing { + my $self = shift; + my $width = $self->bridge_width; + return $width + &Slic3r::OVERLAP_FACTOR * ($width * PI / 4 - $width); +} + sub _build_scaled_width { my $self = shift; return scale $self->width;