mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-05 04:54:08 -06:00
Always fix self-intersecting polygons that Douglas-Peucker might return
This commit is contained in:
parent
dc0f706789
commit
33b40eda18
14 changed files with 85 additions and 55 deletions
|
@ -172,8 +172,13 @@ sub clip_line {
|
|||
|
||||
sub simplify {
|
||||
my $self = shift;
|
||||
$_->simplify(@_) for @$self;
|
||||
$self;
|
||||
my ($tolerance) = @_;
|
||||
|
||||
# it would be nice to have a multilinestring_simplify method in B::G::U
|
||||
my @simplified = Slic3r::Geometry::Clipper::simplify_polygons(
|
||||
[ map Boost::Geometry::Utils::linestring_simplify($_, $tolerance), @$self ],
|
||||
);
|
||||
return @{ Slic3r::Geometry::Clipper::union_ex([ @simplified ]) };
|
||||
}
|
||||
|
||||
sub scale {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue