mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 23:23:59 -06:00
Align infill across layers regardless of first-layer-specific extrusion width. Includes a good internal API refactoring and a fix to 3D honeycomb flow
This commit is contained in:
parent
93507bfd49
commit
64061267c8
8 changed files with 67 additions and 46 deletions
|
@ -15,22 +15,15 @@ sub fill_surface {
|
|||
my $expolygon = $surface->expolygon;
|
||||
my $bounding_box = $expolygon->bounding_box;
|
||||
|
||||
my $flow = $params{flow};
|
||||
my $min_spacing = $flow->scaled_spacing;
|
||||
my $min_spacing = scale($self->spacing);
|
||||
my $distance = $min_spacing / $params{density};
|
||||
|
||||
my $flow_spacing = $flow->spacing;
|
||||
if ($params{density} == 1 && !$params{dont_adjust}) {
|
||||
$distance = $self->adjust_solid_spacing(
|
||||
width => $bounding_box->size->[X],
|
||||
distance => $distance,
|
||||
);
|
||||
$flow = Slic3r::Flow->new_from_spacing(
|
||||
spacing => unscale($distance),
|
||||
nozzle_diameter => $flow->nozzle_diameter,
|
||||
layer_height => ($params{layer_height} or die "No layer_height supplied to fill_surface()"),
|
||||
bridge => $flow->bridge,
|
||||
);
|
||||
$self->spacing(unscale $distance);
|
||||
}
|
||||
|
||||
# compensate the overlap which is good for rectilinear but harmful for concentric
|
||||
|
@ -54,12 +47,11 @@ sub fill_surface {
|
|||
}
|
||||
|
||||
# clip the paths to prevent the extruder from getting exactly on the first point of the loop
|
||||
my $clip_length = scale($flow->nozzle_diameter) * &Slic3r::LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER;
|
||||
$_->clip_end($clip_length) for @paths;
|
||||
$_->clip_end($self->loop_clipping) for @paths;
|
||||
@paths = grep $_->is_valid, @paths; # remove empty paths (too short, thus eaten by clipping)
|
||||
|
||||
# TODO: return ExtrusionLoop objects to get better chained paths
|
||||
return { flow => $flow, no_sort => 1 }, @paths;
|
||||
return @paths;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue