mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
New semantics for ExtrusionLoop objects. Early processing of perimeter overhangs for paralellizing such work and making G-code export lighter. Lots of refactoring. This should fix a number of minor bugs, including reversals of perimeter overhangs.
This commit is contained in:
@@ -51,41 +51,4 @@ sub concave_points {
|
||||
-1 .. ($#points-1);
|
||||
}
|
||||
|
||||
sub clip_as_polyline {
|
||||
my ($self, $polygons) = @_;
|
||||
|
||||
my $self_pl = $self->split_at_first_point;
|
||||
|
||||
# Clipper will remove a polyline segment if first point coincides with last one.
|
||||
# Until that bug is not fixed upstream, we move one of those points slightly.
|
||||
$self_pl->[0]->translate(1, 0);
|
||||
|
||||
my @polylines = @{intersection_pl([$self_pl], $polygons)};
|
||||
if (@polylines == 1) {
|
||||
if ($polylines[0][0]->coincides_with($self_pl->[0])) {
|
||||
# compensate the above workaround for Clipper bug
|
||||
$polylines[0][0]->translate(-1, 0);
|
||||
}
|
||||
} elsif (@polylines == 2) {
|
||||
# If the split_at_first_point() call above happens to split the polygon inside the clipping area
|
||||
# we would get two consecutive polylines instead of a single one, so we use this ugly hack to
|
||||
# recombine them back into a single one in order to trigger the @edges == 2 logic below.
|
||||
# This needs to be replaced with something way better.
|
||||
if ($polylines[0][-1]->coincides_with($self_pl->[-1]) && $polylines[-1][0]->coincides_with($self_pl->[0])) {
|
||||
my $p = $polylines[0]->clone;
|
||||
$p->pop_back;
|
||||
$p->append(@{$polylines[-1]});
|
||||
return [$p];
|
||||
}
|
||||
if ($polylines[0][0]->coincides_with($self_pl->[0]) && $polylines[-1][-1]->coincides_with($self_pl->[-1])) {
|
||||
my $p = $polylines[-1]->clone;
|
||||
$p->pop_back;
|
||||
$p->append(@{$polylines[0]});
|
||||
return [$p];
|
||||
}
|
||||
}
|
||||
|
||||
return [ @polylines ];
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user