Fix integration of XS containers

This commit is contained in:
Alessandro Ranellucci 2013-07-16 17:13:01 +02:00
parent 9b582a11ff
commit 9458c7db97
34 changed files with 279 additions and 152 deletions

View file

@ -87,9 +87,9 @@ sub encloses_line {
my $clip = $self->clip_line($line);
if (!defined $tolerance) {
# optimization
return @$clip == 1 && same_line($clip->[0], $line);
return @$clip == 1 && same_line($clip->[0]->pp, $line->pp);
} else {
return @$clip == 1 && abs(Boost::Geometry::Utils::linestring_length($clip->[0]) - $line->length) < $tolerance;
return @$clip == 1 && abs(Boost::Geometry::Utils::linestring_length($clip->[0]->pp) - $line->length) < $tolerance;
}
}
@ -102,7 +102,10 @@ sub clip_line {
my $self = shift;
my ($line) = @_; # line must be a Slic3r::Line object
return Boost::Geometry::Utils::polygon_multi_linestring_intersection($self->pp, [$line->pp]);
return [
map Slic3r::Line->new(@$_),
@{Boost::Geometry::Utils::polygon_multi_linestring_intersection($self->pp, [$line->pp])}
];
}
sub simplify {