Skip to content

Commit

Permalink
Raise the thickness threshold used for generating thin walls. TODO: d…
Browse files Browse the repository at this point in the history
…on't enforce this at the segment level but consider the average thickness of an entire polyline and compare it to the total length. #2910
  • Loading branch information
alranel committed Jun 15, 2015
1 parent bc69d6d commit 539cde8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions lib/Slic3r/Layer/PerimeterGenerator.pm
Expand Up @@ -24,7 +24,6 @@ has '_holes_pt' => (is => 'rw');
has '_ext_mm3_per_mm' => (is => 'rw');
has '_mm3_per_mm' => (is => 'rw');
has '_mm3_per_mm_overhang' => (is => 'rw');
has '_thin_wall_polylines' => (is => 'rw', default => sub { [] });

# generated loops will be put here
has 'loops' => (is => 'ro', default => sub { Slic3r::ExtrusionPath::Collection->new });
Expand Down Expand Up @@ -133,7 +132,7 @@ sub process {

# 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)
my $min_width = $ext_pwidth / 4;
my $min_width = $ext_pwidth / 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
Expand All @@ -145,10 +144,9 @@ sub process {
require "Slic3r/SVG.pm";
Slic3r::SVG::output(
"medial_axis.svg",
no_arrows => 1,
expolygons => union_ex($diff),
green_polylines => [ map $_->polygon->split_at_first_point, @{$self->perimeters} ],
red_polylines => $self->_thin_wall_polylines,
no_arrows => 1,
expolygons => \@expp,
polylines => \@thin_walls,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion xs/src/libslic3r/Geometry.cpp
Expand Up @@ -504,7 +504,7 @@ MedialAxis::is_valid_edge(const VD::edge_type& edge) const
//printf(" => too thin, skipping\n");
return false;
}

return true;
}

Expand Down

0 comments on commit 539cde8

Please sign in to comment.