mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 05:07:51 -06:00
Implement nearest point index and split at index to avoid search for point.
This commit is contained in:
parent
35fda7de23
commit
35ecd65e77
4 changed files with 31 additions and 16 deletions
|
@ -57,10 +57,11 @@ sub fill_surface {
|
|||
$loop->polygon->make_counter_clockwise;
|
||||
|
||||
# find the point of the loop that is closest to the current extruder position
|
||||
$cur_pos = $loop->nearest_point_to($cur_pos);
|
||||
my $index = $loop->nearest_point_index_to($cur_pos);
|
||||
$cur_pos = $loop->polygon->[0];
|
||||
|
||||
# split the loop at the starting point and make a path
|
||||
my $path = $loop->split_at($cur_pos);
|
||||
my $path = $loop->split_at_index($index);
|
||||
$path->deserialize;
|
||||
|
||||
# clip the path to avoid the extruder to get exactly on the first point of the loop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue