mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 17:27:52 -06:00
Fixed a typo in extrusion ordering, pointed by @supermerill
This commit is contained in:
parent
20e59cb0c7
commit
aff5adaaa0
1 changed files with 4 additions and 4 deletions
|
@ -1000,13 +1000,13 @@ std::vector<std::pair<size_t, bool>> chain_extrusion_entities(std::vector<Extrus
|
||||||
auto segment_end_point = [&entities](size_t idx, bool first_point) -> const Point& { return first_point ? entities[idx]->first_point() : entities[idx]->last_point(); };
|
auto segment_end_point = [&entities](size_t idx, bool first_point) -> const Point& { return first_point ? entities[idx]->first_point() : entities[idx]->last_point(); };
|
||||||
auto could_reverse = [&entities](size_t idx) { const ExtrusionEntity *ee = entities[idx]; return ee->is_loop() || ee->can_reverse(); };
|
auto could_reverse = [&entities](size_t idx) { const ExtrusionEntity *ee = entities[idx]; return ee->is_loop() || ee->can_reverse(); };
|
||||||
std::vector<std::pair<size_t, bool>> out = chain_segments_greedy_constrained_reversals<Point, decltype(segment_end_point), decltype(could_reverse)>(segment_end_point, could_reverse, entities.size(), start_near);
|
std::vector<std::pair<size_t, bool>> out = chain_segments_greedy_constrained_reversals<Point, decltype(segment_end_point), decltype(could_reverse)>(segment_end_point, could_reverse, entities.size(), start_near);
|
||||||
for (size_t i = 0; i < entities.size(); ++ i) {
|
for (std::pair<size_t, bool> &segment : out) {
|
||||||
ExtrusionEntity *ee = entities[i];
|
ExtrusionEntity *ee = entities[segment.first];
|
||||||
if (ee->is_loop())
|
if (ee->is_loop())
|
||||||
// Ignore reversals for loops, as the start point equals the end point.
|
// Ignore reversals for loops, as the start point equals the end point.
|
||||||
out[i].second = false;
|
segment.second = false;
|
||||||
// Is can_reverse() respected by the reversals?
|
// Is can_reverse() respected by the reversals?
|
||||||
assert(entities[i]->can_reverse() || ! out[i].second);
|
assert(ee->can_reverse() || ! segment.second);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue