From 539cde8d7a6ad49b3a7404a7776a3c4d55f1f35f Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 15 Jun 2015 17:00:10 +0200 Subject: [PATCH] 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 --- lib/Slic3r/Layer/PerimeterGenerator.pm | 10 ++++------ xs/src/libslic3r/Geometry.cpp | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/Slic3r/Layer/PerimeterGenerator.pm b/lib/Slic3r/Layer/PerimeterGenerator.pm index 9caada38e..d77f57bdb 100644 --- a/lib/Slic3r/Layer/PerimeterGenerator.pm +++ b/lib/Slic3r/Layer/PerimeterGenerator.pm @@ -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 }); @@ -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 @@ -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, ); } } diff --git a/xs/src/libslic3r/Geometry.cpp b/xs/src/libslic3r/Geometry.cpp index 5a7b2e3dc..827029aa0 100644 --- a/xs/src/libslic3r/Geometry.cpp +++ b/xs/src/libslic3r/Geometry.cpp @@ -504,7 +504,7 @@ MedialAxis::is_valid_edge(const VD::edge_type& edge) const //printf(" => too thin, skipping\n"); return false; } - + return true; }