From eb33c03926eda04d4dbf5c0e4c1572056d7c123e Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 30 Jan 2012 14:03:12 +0100 Subject: [PATCH] Bugfix: flow wasn't adjusted for first layer according to its height setting. #182 --- lib/Slic3r/Extruder.pm | 2 +- lib/Slic3r/Layer.pm | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Extruder.pm b/lib/Slic3r/Extruder.pm index 4c88b97b89..9711e0c3c1 100644 --- a/lib/Slic3r/Extruder.pm +++ b/lib/Slic3r/Extruder.pm @@ -128,7 +128,7 @@ sub extrude_path { # calculate extrusion length per distance unit my $s = $path->flow_spacing || $Slic3r::flow_spacing; - my $h = $path->depth_layers * $Slic3r::layer_height; + my $h = $path->depth_layers * $self->layer->height; my $w = ($s - $Slic3r::min_flow_spacing * $Slic3r::overlap_factor) / (1 - $Slic3r::overlap_factor); my $area; diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index d03365b76d..9b6fb56040 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -91,6 +91,13 @@ sub print_z { + ($self->id * $Slic3r::layer_height)) / $Slic3r::resolution; } +sub height { + my $self = shift; + return $self->id == 0 + ? ($Slic3r::layer_height * $Slic3r::first_layer_height_ratio) + : $Slic3r::layer_height; +} + sub add_line { my $self = shift; my ($line) = @_;