mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-31 00:52:51 +00:00
Thin walls. #24
This commit is contained in:
@@ -30,6 +30,10 @@ has 'slices' => (
|
||||
default => sub { [] },
|
||||
);
|
||||
|
||||
# collection of polygons or polylines representing thin walls contained
|
||||
# in the original geometry
|
||||
has 'thin_walls' => (is => 'rw', default => sub { [] });
|
||||
|
||||
# collection of surfaces generated by offsetting the innermost perimeter(s)
|
||||
# they represent boundaries of areas to fill
|
||||
has 'fill_boundaries' => (
|
||||
@@ -160,6 +164,19 @@ sub make_surfaces {
|
||||
($_, surface_type => 'internal'),
|
||||
$surface->expolygon->offset_ex(-$distance);
|
||||
}
|
||||
|
||||
# now detect thin walls by re-outgrowing offsetted surfaces and subtracting
|
||||
# them from the original slices
|
||||
my $outgrown = Math::Clipper::offset([ map $_->p, @{$self->slices} ], $distance);
|
||||
my $diff = diff_ex(
|
||||
[ map $_->p, @surfaces ],
|
||||
$outgrown,
|
||||
);
|
||||
|
||||
push @{$self->thin_walls},
|
||||
grep $_,
|
||||
map $_->medial_axis(scale $Slic3r::flow_width),
|
||||
@$diff;
|
||||
}
|
||||
|
||||
if (0) {
|
||||
|
||||
Reference in New Issue
Block a user