Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/CuraEngine.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasper Lamboo <c.lamboo@ultimaker.com>2022-05-03 11:39:07 +0300
committerGitHub <noreply@github.com>2022-05-03 11:39:07 +0300
commit69e1c738e56b1c932e538cdc414ac94daa26619e (patch)
treeef677f104835058ef772b792382a1e27c48a7a05
parente0f479420d5dedba0243e17cb1905ee4a246a0df (diff)
parent4d6719d52d5edae240aa9ea00558096ae6c049f7 (diff)
Merge pull request #1656 from Ultimaker/CURA-9206_slicing_error
[CURA-9206] Fix error slicing with 5.0
-rw-r--r--src/FffGcodeWriter.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp
index 4b2532743..4a8654d14 100644
--- a/src/FffGcodeWriter.cpp
+++ b/src/FffGcodeWriter.cpp
@@ -1544,21 +1544,32 @@ bool FffGcodeWriter::processMultiLayerInfill(const SliceDataStorage& storage, La
added_something = true;
setExtruder_addPrime(storage, gcode_layer, extruder_nr);
gcode_layer.setIsInside(true); // going to print stuff inside print object
+
if (!infill_polygons.empty())
{
constexpr bool force_comb_retract = false;
gcode_layer.addTravel(infill_polygons[0][0], force_comb_retract);
gcode_layer.addPolygonsByOptimizer(infill_polygons, mesh_config.infill_config[combine_idx]);
}
- std::optional<Point> near_start_location;
- if (mesh.settings.get<bool>("infill_randomize_start_location"))
+
+ if (!infill_lines.empty())
{
- srand(gcode_layer.getLayerNr());
- near_start_location = infill_lines[rand() % infill_lines.size()][0];
+ std::optional<Point> near_start_location;
+ if (mesh.settings.get<bool>("infill_randomize_start_location"))
+ {
+ srand(gcode_layer.getLayerNr());
+ near_start_location = infill_lines[rand() % infill_lines.size()][0];
+ }
+
+ const bool enable_travel_optimization = mesh.settings.get<bool>("infill_enable_travel_optimization");
+ gcode_layer.addLinesByOptimizer(infill_lines,
+ mesh_config.infill_config[combine_idx],
+ zig_zaggify_infill ? SpaceFillType::PolyLines : SpaceFillType::Lines,
+ enable_travel_optimization,
+ /*wipe_dist = */ 0,
+ /* flow = */ 1.0,
+ near_start_location);
}
- const bool enable_travel_optimization = mesh.settings.get<bool>("infill_enable_travel_optimization");
- gcode_layer.addLinesByOptimizer(infill_lines, mesh_config.infill_config[combine_idx], zig_zaggify_infill ? SpaceFillType::PolyLines : SpaceFillType::Lines, enable_travel_optimization
- , /*wipe_dist = */ 0, /* flow = */ 1.0, near_start_location);
}
}
return added_something;