Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2013-07-26 02:13:24 +0400
committerAlessandro Ranellucci <aar@cpan.org>2013-07-26 02:13:24 +0400
commit37bf0fa53ba19f36db3208881aabb16faf62ce36 (patch)
tree0b88825732b79d60e9ae0f2c2d21922194621f65 /lib
parent8fe228fceeca212242a8b572260e8a50efdb0842 (diff)
Bugfix: medial axis thin wall detection was triggered when not needed
Diffstat (limited to 'lib')
-rw-r--r--lib/Slic3r/Layer/Region.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Slic3r/Layer/Region.pm b/lib/Slic3r/Layer/Region.pm
index 9e76f09f1..16baf95d9 100644
--- a/lib/Slic3r/Layer/Region.pm
+++ b/lib/Slic3r/Layer/Region.pm
@@ -93,21 +93,21 @@ sub make_surfaces {
# detect thin walls by offsetting slices by half extrusion inwards
if ($Slic3r::Config->thin_walls) {
- my $width = $self->perimeter_flow->scaled_width;
+ $self->thin_walls([]);
+ # we use spacing here because there could be a case where
+ # the slice collapses with width but doesn't collapse with spacing,
+ # thus causing both perimeters and medial axis to be generated
+ my $width = $self->perimeter_flow->scaled_spacing;
my $diff = diff_ex(
[ map $_->p, @{$self->slices} ],
- [ offset2([ map @$_, map $_->expolygon, @{$self->slices} ], -$width, +$width) ],
+ [ offset2([ map $_->p, @{$self->slices} ], -$width*0.5, +$width*0.5) ],
1,
);
- $self->thin_walls([]);
- if (@$diff) {
- my $area_threshold = $self->perimeter_flow->scaled_spacing ** 2;
- @$diff = grep $_->area > ($area_threshold), @$diff;
-
- @{$self->thin_walls} = map $_->medial_axis($self->perimeter_flow->scaled_width), @$diff;
-
- Slic3r::debugf " %d thin walls detected\n", scalar(@{$self->thin_walls}) if @{$self->thin_walls};
+ my $area_threshold = $width ** 2;
+ if (@$diff = grep { $_->area > $area_threshold } @$diff) {
+ @{$self->thin_walls} = map $_->medial_axis($width), @$diff;
+ Slic3r::debugf " %d thin walls detected\n", scalar(@{$self->thin_walls});
}
}