mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Fix integration of XS containers
This commit is contained in:
parent
9b582a11ff
commit
9458c7db97
34 changed files with 279 additions and 152 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue