From 9515acf5276d809366793cd162ac18c1b9895083 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 11 Jan 2014 14:30:34 +0100 Subject: [PATCH] Put a hard limit on manually configured extrusion widths (10 * the largest nozzle diameter configured) to prevent confusion when a bad value is entered. #1691 Conflicts: lib/Slic3r/Config.pm --- lib/Slic3r/Config.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index ae166b6c5..26ced03d7 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -3,7 +3,7 @@ use strict; use warnings; use utf8; -use List::Util qw(first); +use List::Util qw(first max); # cemetery of old config settings our @Ignore = qw(duplicate_x duplicate_y multiply_x multiply_y support_material_tool acceleration @@ -319,6 +319,15 @@ sub validate { if defined first { $_ } @{ $self->retract_layer_change }; } + # extrusion widths + { + my $max_nozzle_diameter = max(@{ $self->nozzle_diameter }); + die "Invalid extrusion width (too large)\n" + if defined first { $_ > 10 * $max_nozzle_diameter } + map $self->get("${_}_extrusion_width"), + qw(perimeter infill solid_infill top_infill support_material first_layer); + } + # general validation, quick and dirty foreach my $opt_key (@{$self->get_keys}) { my $opt = $Options->{$opt_key};