mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 13:17:54 -06:00
Get rid of the ExtrusionLoop objects in concentric filler
This commit is contained in:
parent
20e73face2
commit
cec7bf815c
5 changed files with 60 additions and 53 deletions
|
@ -51,13 +51,13 @@ sub fill_surface {
|
|||
($bounding_box->[X1] + $bounding_box->[X2]) / 2,
|
||||
($bounding_box->[Y1] + $bounding_box->[Y2]) / 2,
|
||||
);
|
||||
foreach my $loop (map Slic3r::ExtrusionLoop->new(polygon => $_, role => EXTR_ROLE_FILL), @loops) {
|
||||
foreach my $loop (@loops) {
|
||||
# extrude all loops ccw
|
||||
$loop->polygon->make_counter_clockwise;
|
||||
$loop->make_counter_clockwise;
|
||||
|
||||
# find the point of the loop that is closest to the current extruder position
|
||||
my $index = $loop->nearest_point_index_to($cur_pos);
|
||||
$cur_pos = $loop->polygon->[0];
|
||||
$cur_pos = $loop->[0];
|
||||
|
||||
# split the loop at the starting point and make a path
|
||||
my $path = $loop->split_at_index($index);
|
||||
|
@ -65,7 +65,7 @@ sub fill_surface {
|
|||
# clip the path to avoid the extruder to get exactly on the first point of the loop
|
||||
$path->clip_end(scale $flow_spacing * &Slic3r::LOOP_CLIPPING_LENGTH_OVER_SPACING);
|
||||
|
||||
push @paths, $path->points if @{$path->points};
|
||||
push @paths, $path if @$path;
|
||||
}
|
||||
|
||||
return { flow_spacing => $flow_spacing }, @paths;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue