mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 22:14:00 -06:00
Remove features that are too small to be printed
This commit is contained in:
parent
081f65852d
commit
c2a62891da
3 changed files with 28 additions and 2 deletions
|
@ -304,4 +304,23 @@ sub merge_contiguous_surfaces {
|
|||
}
|
||||
}
|
||||
|
||||
sub remove_small_features {
|
||||
my $self = shift;
|
||||
|
||||
# for each perimeter, try to get an inwards offset
|
||||
# for a distance equal to half of the extrusion width;
|
||||
# if no offset is possible, then feature is not printable
|
||||
my @good_perimeters = ();
|
||||
foreach my $loop (@{$self->perimeters}) {
|
||||
my $p = $loop->p;
|
||||
@$p = reverse @$p if !is_counter_clockwise($p);
|
||||
my $offsets = offset([$p], -($Slic3r::flow_width / 2 / $Slic3r::resolution), 100, JT_MITER, 2);
|
||||
push @good_perimeters, $loop if @$offsets;
|
||||
}
|
||||
Slic3r::debugf "removed %d unprintable perimeters\n", (@{$self->perimeters} - @good_perimeters)
|
||||
if @good_perimeters != @{$self->perimeters};
|
||||
|
||||
@{$self->perimeters} = @good_perimeters;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue