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
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2011-11-19 19:08:00 +0400
committerAlessandro Ranellucci <aar@cpan.org>2011-11-19 19:44:24 +0400
commita1c766cc524fbfacd570d14bf9b6d761258e96b7 (patch)
tree4eb441d4ac6241579b865fb4ec386a5277c8d5a9 /lib/Slic3r/Print.pm
parent1ef4d006a0e29ce51174a1c18189ec6ca46ca6ba (diff)
New bridging logic, more robust. #58
Diffstat (limited to 'lib/Slic3r/Print.pm')
-rw-r--r--lib/Slic3r/Print.pm22
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm
index 95f00f0f4..a570aa364 100644
--- a/lib/Slic3r/Print.pm
+++ b/lib/Slic3r/Print.pm
@@ -109,6 +109,23 @@ sub detect_surfaces_type {
my $upper_surfaces = [ grep { $_->expolygon->contour->area > $min_area } @{$upper_layer->surfaces} ];
@top = $surface_difference->($layer->surfaces, $upper_surfaces, 'top');
+
+ # now check whether each resulting top surfaces is large enough to have its
+ # own perimeters or whether it may be sufficient to use the lower layer's
+ # perimeters
+ # offset upper layer's surfaces
+ my $upper_surfaces_offsetted;
+ {
+ my $distance = $Slic3r::flow_width * ($Slic3r::perimeters) / $Slic3r::resolution;
+ $upper_surfaces_offsetted = offset([ map $_->p, @{$upper_layer->surfaces} ], $distance, 100, JT_MITER, 2);
+ }
+
+ @top = grep {
+ my $surface = $_;
+ my $diff = diff_ex([ map $_->p, $surface ], $upper_surfaces_offsetted);
+ @$diff;
+ } @top;
+
} else {
# if no upper layer, all surfaces of this one are solid
@top = @{$layer->surfaces};
@@ -276,8 +293,6 @@ sub extrude_perimeters {
foreach my $layer (@{ $self->layers }) {
$layer->detect_perimeter_surfaces;
$perimeter_extruder->make_perimeter($layer);
- Slic3r::debugf " generated paths: %s\n",
- join ' ', map $_->id, @{ $layer->perimeters } if $Slic3r::debug;
}
}
@@ -374,9 +389,6 @@ sub extrude_fills {
foreach my $layer (@{ $self->layers }) {
$fill_extruder->make_fill($layer);
- Slic3r::debugf " generated %d paths: %s\n",
- scalar @{ $layer->fills },
- join ' ', map $_->id, map @{$_->paths}, @{ $layer->fills } if $Slic3r::debug;
}
}