diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 5554355ba3..8f7d993811 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -143,28 +143,28 @@ void FffGcodeWriter::writeGCode(SliceDataStorage& storage, TimeKeeper& time_keep findLayerSeamsForSpiralize(storage, total_layers); } - // int process_layer_starting_layer_nr = 0; + int process_layer_starting_layer_nr = 0; const bool has_raft = scene.current_mesh_group->settings.get("adhesion_type") == EPlatformAdhesion::RAFT; if (has_raft) { processRaft(storage); // process filler layers to fill the airgap with helper object (support etc) so that they stick better to the raft. // only process the filler layers if there is anything to print in them. - /*for (bool extruder_is_used_in_filler_layers : storage.getExtrudersUsed(-1)) + for (bool extruder_is_used_in_filler_layers : storage.getExtrudersUsed(-1)) { if (extruder_is_used_in_filler_layers) { process_layer_starting_layer_nr = -Raft::getFillerLayerCount(); break; } - }*/ + } } run_multiple_producers_ordered_consumer( - // process_layer_starting_layer_nr, - -Raft::getTotalExtraLayers(), - // total_layers + Raft::getFillerLayerCount() - 1, - total_layers, + process_layer_starting_layer_nr, + //-Raft::getTotalExtraLayers(), + total_layers + Raft::getFillerLayerCount() - 1, + // total_layers, [&storage, total_layers, this](int layer_nr) { return &processLayer(storage, layer_nr, total_layers); diff --git a/src/PrimeTower.cpp b/src/PrimeTower.cpp index 316be75b3a..9845eff054 100644 --- a/src/PrimeTower.cpp +++ b/src/PrimeTower.cpp @@ -149,22 +149,24 @@ void PrimeTower::generatePaths_denseInfill() else { // Generate the pattern for the first layer. - coord_t line_width_layer0 = line_width * scene.extruders[extruder_nr].settings.get("initial_layer_line_width_factor"); + const coord_t line_width_layer0 = scene.extruders[extruder_nr].settings.get("raft_base_line_width"); ExtrusionMoves& pattern_layer0 = pattern_per_extruder_layer0[extruder_nr]; // Generate a concentric infill pattern in the form insets for the prime tower's first layer instead of using // the infill pattern because the infill pattern tries to connect polygons in different insets which causes the // first layer of the prime tower to not stick well. - Polygons inset = outer_poly.offset(-(-cumulative_inset - line_width_layer0 / 2)); - /*while (! inset.empty()) + Polygons inset = outer_poly.offset(-cumulative_inset - line_width_layer0 / 2); + while (! inset.empty()) { pattern_layer0.polygons.add(inset); inset = inset.offset(-line_width_layer0); - }*/ + } + + Polygons outset = outer_poly.offset(cumulative_inset + line_width_layer0 / 2); for (int i = 0; i < 15; ++i) { - pattern_layer0.polygons.add(inset); - inset = inset.offset(line_width_layer0); + pattern_layer0.polygons.add(outset); + outset = outset.offset(line_width_layer0); } } cumulative_inset += wall_nr * line_width; @@ -230,19 +232,27 @@ void PrimeTower::addToGcode(const SliceDataStorage& storage, LayerPlan& gcode_la void PrimeTower::addToGcode_denseInfill(LayerPlan& gcode_layer, const size_t extruder_nr) const { - const GCodePathConfig& config = gcode_layer.configs_storage.prime_tower_config_per_extruder[extruder_nr]; + const GCodePathConfig& config + = gcode_layer.getLayerNr() < 0 ? gcode_layer.configs_storage.raft_base_config : gcode_layer.configs_storage.prime_tower_config_per_extruder[extruder_nr]; - const ExtrusionMoves& pattern = pattern_per_extruder[extruder_nr]; - gcode_layer.addPolygonsByOptimizer(pattern.polygons, config); - gcode_layer.addLinesByOptimizer(pattern.lines, config, SpaceFillType::Lines); // if (gcode_layer.getLayerNr() == -static_cast(Raft::getTotalExtraLayers())) if (gcode_layer.getLayerNr() < 0 && extruder_nr == 0) { + const GCodePathConfig& config = gcode_layer.configs_storage.raft_base_config; + const ExtrusionMoves& pattern0 = pattern_per_extruder_layer0[extruder_nr]; gcode_layer.addPolygonsByOptimizer(pattern0.polygons, config); gcode_layer.addLinesByOptimizer(pattern0.lines, config, SpaceFillType::Lines); } + else + { + const GCodePathConfig& config = gcode_layer.configs_storage.prime_tower_config_per_extruder[extruder_nr]; + + const ExtrusionMoves& pattern = pattern_per_extruder[extruder_nr]; + gcode_layer.addPolygonsByOptimizer(pattern.polygons, config); + gcode_layer.addLinesByOptimizer(pattern.lines, config, SpaceFillType::Lines); + } } void PrimeTower::subtractFromSupport(SliceDataStorage& storage) diff --git a/src/gcodeExport.cpp b/src/gcodeExport.cpp index caff200811..799ac84e0c 100644 --- a/src/gcodeExport.cpp +++ b/src/gcodeExport.cpp @@ -1498,7 +1498,7 @@ void GCodeExport::writeTemperatureCommand(const size_t extruder, const Temperatu *output_stream << " T" << extruder; } #ifdef ASSERT_INSANE_OUTPUT - assert(temperature >= 0); + // assert(temperature >= 0); #endif // ASSERT_INSANE_OUTPUT *output_stream << " S" << PrecisionedDouble{ 1, temperature } << new_line; if (extruder != current_extruder && always_write_active_tool) diff --git a/src/raft.cpp b/src/raft.cpp index 16134f55bc..384958afc4 100644 --- a/src/raft.cpp +++ b/src/raft.cpp @@ -113,7 +113,15 @@ coord_t Raft::getFillerLayerHeight() const coord_t normal_layer_height = mesh_group_settings.get("layer_height"); return normal_layer_height; } - return round_divide(getZdiffBetweenRaftAndLayer0(), getFillerLayerCount()); + + if (getFillerLayerCount() != 0) + { + return round_divide(getZdiffBetweenRaftAndLayer0(), getFillerLayerCount()); + } + else + { + return mesh_group_settings.get("layer_height"); + } }