Raise the thickness threshold used for generating thin walls. TODO: don't enforce this at the segment level but consider the average thickness of an entire polyline and compare it to the total length. #2910

This commit is contained in:
Alessandro Ranellucci 2015-06-15 17:00:10 +02:00
parent bc69d6da81
commit 539cde8d7a
2 changed files with 5 additions and 7 deletions

View File

@ -24,7 +24,6 @@ has '_holes_pt' => (is => 'rw');
has '_ext_mm3_per_mm' => (is => 'rw'); has '_ext_mm3_per_mm' => (is => 'rw');
has '_mm3_per_mm' => (is => 'rw'); has '_mm3_per_mm' => (is => 'rw');
has '_mm3_per_mm_overhang' => (is => 'rw'); has '_mm3_per_mm_overhang' => (is => 'rw');
has '_thin_wall_polylines' => (is => 'rw', default => sub { [] });
# generated loops will be put here # generated loops will be put here
has 'loops' => (is => 'ro', default => sub { Slic3r::ExtrusionPath::Collection->new }); has 'loops' => (is => 'ro', default => sub { Slic3r::ExtrusionPath::Collection->new });
@ -133,7 +132,7 @@ sub process {
# the following offset2 ensures almost nothing in @thin_walls is narrower than $min_width # the following offset2 ensures almost nothing in @thin_walls is narrower than $min_width
# (actually, something larger than that still may exist due to mitering or other causes) # (actually, something larger than that still may exist due to mitering or other causes)
my $min_width = $ext_pwidth / 4; my $min_width = $ext_pwidth / 2;
@thin_walls = @{offset2_ex($diff, -$min_width/2, +$min_width/2)}; @thin_walls = @{offset2_ex($diff, -$min_width/2, +$min_width/2)};
# the maximum thickness of our thin wall area is equal to the minimum thickness of a single loop # the maximum thickness of our thin wall area is equal to the minimum thickness of a single loop
@ -145,10 +144,9 @@ sub process {
require "Slic3r/SVG.pm"; require "Slic3r/SVG.pm";
Slic3r::SVG::output( Slic3r::SVG::output(
"medial_axis.svg", "medial_axis.svg",
no_arrows => 1, no_arrows => 1,
expolygons => union_ex($diff), expolygons => \@expp,
green_polylines => [ map $_->polygon->split_at_first_point, @{$self->perimeters} ], polylines => \@thin_walls,
red_polylines => $self->_thin_wall_polylines,
); );
} }
} }

View File

@ -504,7 +504,7 @@ MedialAxis::is_valid_edge(const VD::edge_type& edge) const
//printf(" => too thin, skipping\n"); //printf(" => too thin, skipping\n");
return false; return false;
} }
return true; return true;
} }