mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 22:54:08 -06:00
Ported intersect_expolygons() and subtract_expolygons() to XS
This commit is contained in:
parent
5f81292f3f
commit
761f261a68
11 changed files with 95 additions and 29 deletions
|
@ -27,22 +27,6 @@ sub clip_with_expolygon {
|
|||
$self->polyline->clip_with_expolygon($expolygon);
|
||||
}
|
||||
|
||||
sub intersect_expolygons {
|
||||
my $self = shift;
|
||||
my ($expolygons_pp) = @_;
|
||||
|
||||
return map $self->clone(polyline => Slic3r::Polyline->new(@$_)),
|
||||
@{Boost::Geometry::Utils::multi_polygon_multi_linestring_intersection($expolygons_pp, [$self->pp])};
|
||||
}
|
||||
|
||||
sub subtract_expolygons {
|
||||
my $self = shift;
|
||||
my ($expolygons_pp) = @_;
|
||||
|
||||
return map $self->clone(polyline => Slic3r::Polyline->new(@$_)),
|
||||
@{Boost::Geometry::Utils::multi_linestring_multi_polygon_difference([$self->pp], $expolygons_pp)};
|
||||
}
|
||||
|
||||
sub simplify {
|
||||
my $self = shift;
|
||||
$self->polyline($self->polyline->simplify(@_));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue