mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -06:00
Some incomplete work for cleaner infill logic
This commit is contained in:
parent
a9df56670f
commit
d928f005e6
2 changed files with 9 additions and 29 deletions
|
@ -52,7 +52,9 @@ sub make_fill {
|
|||
|
||||
Slic3r::debugf "Filling layer %d:\n", $layerm->id;
|
||||
|
||||
# merge overlapping surfaces
|
||||
# merge adjacent surfaces
|
||||
# in case of bridge surfaces, the ones with defined angle will be attached to the ones
|
||||
# without any angle (shouldn't this logic be moved to process_bridges()?)
|
||||
my @surfaces = ();
|
||||
{
|
||||
my @surfaces_with_bridge_angle = grep defined $_->bridge_angle, @{$layerm->fill_surfaces};
|
||||
|
@ -89,35 +91,10 @@ sub make_fill {
|
|||
}
|
||||
}
|
||||
|
||||
# add spacing between adjacent surfaces
|
||||
# add spacing between surfaces
|
||||
{
|
||||
my $distance = $layerm->infill_flow->scaled_spacing / 2;
|
||||
my @offsets = ();
|
||||
foreach my $surface (@surfaces) {
|
||||
my $expolygon = $surface->expolygon;
|
||||
my $diff = diff_ex(
|
||||
[ $expolygon->offset($distance) ],
|
||||
$expolygon,
|
||||
1,
|
||||
);
|
||||
push @offsets, map @$_, @$diff;
|
||||
}
|
||||
|
||||
my @new_surfaces = ();
|
||||
foreach my $surface (@surfaces) {
|
||||
my $diff = diff_ex(
|
||||
$surface->expolygon,
|
||||
[ @offsets ],
|
||||
);
|
||||
|
||||
push @new_surfaces, map Slic3r::Surface->new(
|
||||
expolygon => $_,
|
||||
surface_type => $surface->surface_type,
|
||||
bridge_angle => $surface->bridge_angle,
|
||||
depth_layers => $surface->depth_layers,
|
||||
), @$diff;
|
||||
}
|
||||
@surfaces = @new_surfaces;
|
||||
@surfaces = map $_->offset(-$distance), @surfaces;
|
||||
}
|
||||
|
||||
my @fills = ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue