mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 10:17:55 -06:00
Fixes by @supermerill from pull request "ShortestPath fix" #3306
This commit is contained in:
parent
e649a28ffc
commit
b061904ad8
1 changed files with 2 additions and 1 deletions
|
@ -43,6 +43,7 @@ std::vector<std::pair<size_t, bool>> chain_segments_closest_point(std::vector<En
|
||||||
assert(next_idx < end_points.size());
|
assert(next_idx < end_points.size());
|
||||||
EndPointType &end_point = end_points[next_idx];
|
EndPointType &end_point = end_points[next_idx];
|
||||||
end_point.chain_id = 1;
|
end_point.chain_id = 1;
|
||||||
|
out.emplace_back(next_idx / 2, (next_idx & 1) != 0);
|
||||||
this_idx = next_idx ^ 1;
|
this_idx = next_idx ^ 1;
|
||||||
}
|
}
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
@ -72,7 +73,7 @@ std::vector<std::pair<size_t, bool>> chain_segments_greedy_constrained_reversals
|
||||||
else if (num_segments == 1)
|
else if (num_segments == 1)
|
||||||
{
|
{
|
||||||
// Just sort the end points so that the first point visited is closest to start_near.
|
// Just sort the end points so that the first point visited is closest to start_near.
|
||||||
out.emplace_back(0, start_near != nullptr &&
|
out.emplace_back(0, could_reverse_func(0) && start_near != nullptr &&
|
||||||
(end_point_func(0, true) - *start_near).template cast<double>().squaredNorm() < (end_point_func(0, false) - *start_near).template cast<double>().squaredNorm());
|
(end_point_func(0, true) - *start_near).template cast<double>().squaredNorm() < (end_point_func(0, false) - *start_near).template cast<double>().squaredNorm());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue