From 68cc5c594a988eddcc73a6aeb444f207bac8e9e9 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Mon, 26 Feb 2024 12:31:09 +0100 Subject: [PATCH] Fix travel length regression CURA-11653 --- src/FffGcodeWriter.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index d9803c93be..0db1fc54f1 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -1775,12 +1775,15 @@ void FffGcodeWriter::addMeshLayerToGCode( PathOrderOptimizer part_order_optimizer(gcode_layer.getLastPlannedPositionOrStartingPosition(), z_seam_config); for (const SliceLayerPart& part : layer.parts) { + if (part.outline.empty()) + { + continue; + } part_order_optimizer.addPolygon(&part); } - if (part_order_optimizer.vertices_to_paths_.size() > 1) - { - part_order_optimizer.optimize(false); - } + + part_order_optimizer.optimize(false); + for (const PathOrdering& path : part_order_optimizer.paths_) { addMeshPartToGCode(storage, mesh, extruder_nr, mesh_config, *path.vertices_, gcode_layer);