mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 15:13:58 -06: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:
parent
0feef890b1
commit
dc0f706789
3 changed files with 22 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue