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
This commit is contained in:
Alessandro Ranellucci 2013-08-08 02:10:34 +02:00
commit b38cc2c244
60 changed files with 1432 additions and 798 deletions

View file

@ -4,9 +4,22 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 1;
use Test::More tests => 10;
my $table = Slic3r::Object::XS::ZTable->new([ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ]);
is_deeply $table->get_range(31, 61), [2, 6], 'get_layer_range';
is_deeply $table->get_range(39, 69), [2, 6], 'get_layer_range';
is_deeply $table->get_range(30, 60), [2, 5], 'get_layer_range';
# upper_bound points to the first element that is greater than argument
is $table->upper_bound(30), 3, 'upper_bound';
is $table->upper_bound(31), 3, 'upper_bound';
is $table->upper_bound(39), 3, 'upper_bound';
is $table->upper_bound(39, 4), 4, 'upper_bound with offset';
# lower_bound points to the first element that is not less than argument
is $table->lower_bound(31), 3, 'lower_bound';
is $table->lower_bound(39), 3, 'lower_bound';
is $table->lower_bound(40), 3, 'lower_bound';
__END__

View file

@ -95,9 +95,7 @@ is_deeply $expolygon->clone->pp, [$square, $hole_in_square], 'clone';
my $exp = $collection->[0];
$exp->scale(3);
### we store a copy, not the original by reference
###is_deeply $expolygon->pp, $exp->pp, 'input is stored by reference in collection';
is_deeply $collection->[0]->pp, $exp->pp, 'collection items are returned by reference';
isnt $collection->[0][0][0][0], $exp->[0][0][0], 'collection items are not returned by reference';
is_deeply $collection->[0]->clone->pp, $collection->[0]->pp, 'clone collection item';
}

View file

@ -52,7 +52,7 @@ is $surface->extra_perimeters, 2, 'extra_perimeters';
my $item = $collection->[0];
$item->surface_type(Slic3r::Surface::S_TYPE_INTERNAL);
is $item->surface_type, $collection->[0]->surface_type, 'changing item affects actual item';
isnt $item->surface_type, $collection->[0]->surface_type, 'collection returns copies of items';
}
__END__