Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2013-09-16 12:33:30 +0400
committerAlessandro Ranellucci <aar@cpan.org>2013-09-16 12:33:30 +0400
commitaef5c05c57db87d2c78fbdbfcf7c81e3cad5b472 (patch)
treed120f42205fefdc431db5241282448259c94f63d /t/skirt_brim.t
parent5a9c163a2e65d46b952366a0f97fc4b4fd86c83f (diff)
Update brim generation code. Includes regression test. #1440
Diffstat (limited to 't/skirt_brim.t')
-rw-r--r--t/skirt_brim.t27
1 files changed, 26 insertions, 1 deletions
diff --git a/t/skirt_brim.t b/t/skirt_brim.t
index e73ccc620..8c616d98a 100644
--- a/t/skirt_brim.t
+++ b/t/skirt_brim.t
@@ -1,4 +1,4 @@
-use Test::More tests => 1;
+use Test::More tests => 2;
use strict;
use warnings;
@@ -43,4 +43,29 @@ use Slic3r::Test;
ok $test->(), "skirt_height is honored when printing multiple objects too";
}
+{
+ my $config = Slic3r::Config->new_from_defaults;
+ $config->set('skirts', 0);
+ $config->set('perimeters', 0);
+ $config->set('top_solid_layers', 0); # to prevent solid shells and their speeds
+ $config->set('bottom_solid_layers', 0); # to prevent solid shells and their speeds
+ $config->set('brim_width', 5);
+ $config->set('cooling', 0); # to prevent speeds to be altered
+ $config->set('first_layer_speed', '100%'); # to prevent speeds to be altered
+
+ my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
+
+ my %layers_with_brim = (); # Z => $count
+ Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
+ my ($self, $cmd, $args, $info) = @_;
+
+ if (defined $self->Z) {
+ $layers_with_brim{$self->Z} //= 0;
+ $layers_with_brim{$self->Z} = 1
+ if $info->{extruding} && $info->{dist_XY} > 0 && ($args->{F} // $self->F) != $config->infill_speed*60;
+ }
+ });
+ is scalar(grep $_, values %layers_with_brim), 1, "brim is generated";
+}
+
__END__