mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -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
|
@ -81,12 +81,22 @@ sub group {
|
|||
|
||||
sub offset {
|
||||
my $self = shift;
|
||||
return map {
|
||||
(ref $self)->new(
|
||||
expolygon => $_,
|
||||
map { $_ => $self->$_ } qw(surface_type depth_layers bridge_angle),
|
||||
)
|
||||
} $self->expolygon->offset_ex(@_);
|
||||
return map $self->_inflate_expolygon($_), $self->expolygon->offset_ex(@_);
|
||||
}
|
||||
|
||||
sub simplify {
|
||||
my $self = shift;
|
||||
return map $self->_inflate_expolygon($_), $self->expolygon->simplify(@_);
|
||||
}
|
||||
|
||||
sub _inflate_expolygon {
|
||||
my $self = shift;
|
||||
my ($expolygon) = @_;
|
||||
|
||||
return (ref $self)->new(
|
||||
expolygon => $expolygon,
|
||||
map { $_ => $self->$_ } qw(surface_type depth_layers bridge_angle),
|
||||
);
|
||||
}
|
||||
|
||||
sub clipper_polygon {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue