mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-22 04:28:05 +08:00
Fix regression introduced with f2e1fe5241b66de5b6d80d43e5450f89001ba958
This commit is contained in:
parent
9ac92facdd
commit
c3fc6ee66b
@ -77,7 +77,10 @@ sub extrude {
|
|||||||
sub extrude_loop {
|
sub extrude_loop {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($loop, $description) = @_;
|
my ($loop, $description) = @_;
|
||||||
|
|
||||||
|
# extrude all loops ccw
|
||||||
|
$loop->polygon->make_counter_clockwise;
|
||||||
|
|
||||||
# find the point of the loop that is closest to the current extruder position
|
# find the point of the loop that is closest to the current extruder position
|
||||||
my $start_at = $loop->nearest_point_to($self->last_pos);
|
my $start_at = $loop->nearest_point_to($self->last_pos);
|
||||||
|
|
||||||
|
@ -115,7 +115,6 @@ sub make_perimeter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach my $hole (@holes) {
|
foreach my $hole (@holes) {
|
||||||
$hole->reverse;
|
|
||||||
push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->new(polygon => $hole, role => 'perimeter');
|
push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->new(polygon => $hole, role => 'perimeter');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,11 +30,6 @@ sub clone {
|
|||||||
return (ref $self)->new(map $_->clone, @$self);
|
return (ref $self)->new(map $_->clone, @$self);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub reverse {
|
|
||||||
my $self = shift;
|
|
||||||
@$self = CORE::reverse @$self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub lines {
|
sub lines {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return map Slic3r::Line->new($_), polygon_lines($self);
|
return map Slic3r::Line->new($_), polygon_lines($self);
|
||||||
@ -135,7 +130,7 @@ sub is_printable {
|
|||||||
# for a distance equal to half of the extrusion width;
|
# for a distance equal to half of the extrusion width;
|
||||||
# if no offset is possible, then polyline is not printable
|
# if no offset is possible, then polyline is not printable
|
||||||
my $p = $self->clone;
|
my $p = $self->clone;
|
||||||
@$p = CORE::reverse @$p if !Math::Clipper::is_counter_clockwise($p);
|
$p->make_counter_clockwise;
|
||||||
my $offsets = Math::Clipper::offset([$p], -(scale $Slic3r::flow_spacing / 2), $Slic3r::resolution * 100000, JT_MITER, 2);
|
my $offsets = Math::Clipper::offset([$p], -(scale $Slic3r::flow_spacing / 2), $Slic3r::resolution * 100000, JT_MITER, 2);
|
||||||
return @$offsets ? 1 : 0;
|
return @$offsets ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
@ -61,24 +61,24 @@ sub simplify {
|
|||||||
bless $_, 'Slic3r::Point' for @$self;
|
bless $_, 'Slic3r::Point' for @$self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub reverse_points {
|
sub reverse {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
@$self = reverse @$self;
|
@$self = CORE::reverse @$self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub is_counter_clockwise {
|
sub is_counter_clockwise {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return Math::Clipper::is_counter_clockwise($self->p);
|
return Math::Clipper::is_counter_clockwise($self);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub make_counter_clockwise {
|
sub make_counter_clockwise {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->reverse_points if !$self->is_counter_clockwise;
|
$self->reverse if !$self->is_counter_clockwise;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub make_clockwise {
|
sub make_clockwise {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->reverse_points if $self->is_counter_clockwise;
|
$self->reverse if $self->is_counter_clockwise;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub nearest_point_to {
|
sub nearest_point_to {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user