mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 19:12:38 -07:00
Bugfix: simplification of support areas could lead to complex polygons with bad orientation, thus causing wrong pattern clipping. #1032
This commit is contained in:
@@ -5,6 +5,7 @@ use warnings;
|
||||
# an ExPolygon is a polygon with holes
|
||||
|
||||
use Boost::Geometry::Utils;
|
||||
use List::Util qw(first);
|
||||
use Math::Geometry::Voronoi;
|
||||
use Slic3r::Geometry qw(X Y A B point_in_polygon same_line line_length epsilon);
|
||||
use Slic3r::Geometry::Clipper qw(union_ex JT_MITER);
|
||||
@@ -54,6 +55,13 @@ sub clipper_expolygon {
|
||||
};
|
||||
}
|
||||
|
||||
sub is_valid {
|
||||
my $self = shift;
|
||||
return (!first { !$_->is_valid } @$self)
|
||||
&& $self->contour->is_counter_clockwise
|
||||
&& (!first { $_->is_counter_clockwise } $self->holes);
|
||||
}
|
||||
|
||||
sub boost_polygon {
|
||||
my $self = shift;
|
||||
return Boost::Geometry::Utils::polygon(@$self);
|
||||
|
||||
Reference in New Issue
Block a user