Fix of G-code path planning: Infill lines were incorrectly ordered

for islands with another islands in their holes.

Improvement of chaining of infill lines for 3D honeycomb, Gyroid and
Honeycomb infill: New TSP chaining algorithm is used.
This commit is contained in:
bubnikv 2019-09-27 09:51:07 +02:00
parent d06831076d
commit e65ab90c16
9 changed files with 58 additions and 46 deletions

View file

@ -1,5 +1,5 @@
#include "../ClipperUtils.hpp"
#include "../PolylineCollection.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include <cmath>
#include <algorithm>
@ -166,11 +166,8 @@ void FillGyroid::_fill_surface_single(
std::swap(expolygon_off, expolygons_off.front());
}
}
Polylines chained = PolylineCollection::chained_path_from(
std::move(polylines),
PolylineCollection::leftmost_point(polylines), false); // reverse allowed
bool first = true;
for (Polyline &polyline : chained) {
for (Polyline &polyline : chain_infill_polylines(std::move(polylines))) {
if (! first) {
// Try to connect the lines.
Points &pts_end = polylines_out.back().points;