Skip to content

Commit

Permalink
Fix travel length regression (#2036)
Browse files Browse the repository at this point in the history
  • Loading branch information
saumyaj3 authored Feb 26, 2024
2 parents 8df7de3 + 68cc5c5 commit 838681b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1775,12 +1775,15 @@ void FffGcodeWriter::addMeshLayerToGCode(
PathOrderOptimizer<const SliceLayerPart*> 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<const SliceLayerPart*>& path : part_order_optimizer.paths_)
{
addMeshPartToGCode(storage, mesh, extruder_nr, mesh_config, *path.vertices_, gcode_layer);
Expand Down

0 comments on commit 838681b

Please sign in to comment.