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-08-08 04:10:34 +0400
committerAlessandro Ranellucci <aar@cpan.org>2013-08-08 04:10:34 +0400
commitb38cc2c2442dfc8abd5b24e2964246075b2b3a19 (patch)
tree99efc93e474098e9c7664b40dd36a43d36b96dd6 /t/shells.t
parentd881c5ab2f9c8f43ab72a2a5310962a89a8f9af6 (diff)
parent4438aec12ce3b90b6a4ffde680a0d2b6dc1ed7d1 (diff)
Merge branch 'master' into xsdata
Conflicts: lib/Slic3r.pm lib/Slic3r/ExPolygon.pm lib/Slic3r/Fill.pm lib/Slic3r/Fill/Rectilinear.pm lib/Slic3r/GCode.pm lib/Slic3r/GUI/Plater.pm lib/Slic3r/Geometry/Clipper.pm lib/Slic3r/Layer/Region.pm lib/Slic3r/Print.pm lib/Slic3r/Print/Object.pm lib/Slic3r/TriangleMesh.pm t/shells.t xs/MANIFEST
Diffstat (limited to 't/shells.t')
-rw-r--r--t/shells.t70
1 files changed, 69 insertions, 1 deletions
diff --git a/t/shells.t b/t/shells.t
index c24867256..6d4f0d27f 100644
--- a/t/shells.t
+++ b/t/shells.t
@@ -1,4 +1,4 @@
-use Test::More tests => 4;
+use Test::More tests => 10;
use strict;
use warnings;
@@ -84,4 +84,72 @@ use Slic3r::Test;
"correct number of top solid shells is generated in V-shaped object";
}
+{
+ my $config = Slic3r::Config->new_from_defaults;
+ # we need to check against one perimeter because this test is calibrated
+ # (shape, extrusion_width) so that perimeters cover the bottom surfaces of
+ # their lower layer - the test checks that shells are not generated on the
+ # above layers (thus 'across' the shadow perimeter)
+ # the test is actually calibrated to leave a narrow bottom region for each
+ # layer - we test that in case of fill_density = 0 such narrow shells are
+ # discarded instead of grown
+ $config->set('perimeters', 1);
+ $config->set('fill_density', 0);
+ $config->set('cooling', 0); # prevent speed alteration
+ $config->set('first_layer_speed', '100%'); # prevent speed alteration
+ $config->set('layer_height', 0.4);
+ $config->set('first_layer_height', '100%');
+ $config->set('extrusion_width', 0.5);
+ $config->set('bottom_solid_layers', 3);
+ $config->set('top_solid_layers', 0);
+ $config->set('solid_infill_speed', 99);
+
+ my $print = Slic3r::Test::init_print('V', config => $config);
+ my %layers = (); # Z => 1
+ Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
+ my ($self, $cmd, $args, $info) = @_;
+ $layers{$self->Z} = 1
+ if $info->{extruding} && ($args->{F} // $self->F) == $config->solid_infill_speed*60;
+ });
+ is scalar(keys %layers), $config->bottom_solid_layers,
+ "shells are not propagated across perimeters of the neighbor layer";
+}
+
+{
+ my $config = Slic3r::Config->new_from_defaults;
+ $config->set('spiral_vase', 1);
+ $config->set('bottom_solid_layers', 0);
+ $config->set('skirts', 0);
+ $config->set('first_layer_height', '100%');
+
+ # TODO: this needs to be tested with a model with sloping edges, where starting
+ # points of each layer are not aligned - in that case we would test that no
+ # travel moves are left to move to the new starting point - in a cube, end
+ # points coincide with next layer starting points (provided there's no clipping)
+ my $test = sub {
+ my ($model_name, $description) = @_;
+ my $print = Slic3r::Test::init_print($model_name, config => $config);
+ my $travel_moves_after_first_extrusion = 0;
+ my $started_extruding = 0;
+ my @z_steps = ();
+ Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
+ my ($self, $cmd, $args, $info) = @_;
+
+ $started_extruding = 1 if $info->{extruding};
+ push @z_steps, ($args->{Z} - $self->Z)
+ if $started_extruding && exists $args->{Z};
+ $travel_moves_after_first_extrusion++
+ if $info->{travel} && $started_extruding && !exists $args->{Z};
+ });
+ is $travel_moves_after_first_extrusion, 0, "no gaps in spiral vase ($description)";
+ ok !(grep { $_ > $config->layer_height } @z_steps), "no gaps in Z ($description)";
+ };
+
+ $test->('20mm_cube', 'solid model');
+ $test->('40x10', 'hollow model');
+
+ $config->set('z_offset', -10);
+ $test->('20mm_cube', 'solid model with negative z-offset');
+}
+
__END__