Skip to content

Commit

Permalink
Last tests and code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 8, 2023
1 parent 0011c1d commit a1b3e66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
30 changes: 13 additions & 17 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,19 @@ std::vector<ExtruderUse>
std::vector<bool> extruder_is_used_on_this_layer = storage.getExtrudersUsed(layer_nr);
PrimeTowerMethod method = mesh_group_settings.get<PrimeTowerMethod>("prime_tower_mode");

// check if we are on the first layer
if (layer_nr == -static_cast<LayerIndex>(Raft::getTotalExtraLayers()))
{
// check if we need prime blob on the first layer
for (size_t used_idx = 0; used_idx < extruder_is_used_on_this_layer.size(); used_idx++)
{
if (getExtruderNeedPrimeBlobDuringFirstLayer(storage, used_idx))
{
extruder_is_used_on_this_layer[used_idx] = true;
}
}
}

// Make a temp list with the potential ordered extruders
std::vector<size_t> ordered_extruders;
ordered_extruders.push_back(start_extruder);
Expand Down Expand Up @@ -1465,23 +1478,6 @@ std::vector<ExtruderUse>
ret.front().prime = ExtruderPrime::Sparse;
}

#warning restore this
#if 0
// check if we are on the first layer
if ((mesh_group_settings.get<EPlatformAdhesion>("adhesion_type") == EPlatformAdhesion::RAFT && layer_nr == -static_cast<LayerIndex>(Raft::getTotalExtraLayers()))
|| (mesh_group_settings.get<EPlatformAdhesion>("adhesion_type") != EPlatformAdhesion::RAFT && layer_nr == 0))
{
// check if we need prime blob on the first layer
for (size_t used_idx = 0; used_idx < extruder_is_used_on_this_layer.size(); used_idx++)
{
if (getExtruderNeedPrimeBlobDuringFirstLayer(storage, used_idx))
{
extruder_is_used_on_this_layer[used_idx] = true;
}
}
}
#endif

assert(ret.size() <= (size_t)extruder_count && "Not more extruders may be planned in a layer than there are extruders!");
return ret;
}
Expand Down
2 changes: 0 additions & 2 deletions src/PrimeTower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ void PrimeTower::generateStartLocations()
// so use the same start and end segments for this.
PolygonsPointIndex segment_start = PolygonsPointIndex(&outer_poly, 0, 0);
PolygonsPointIndex segment_end = segment_start;

#warning Generate dots that are forcibly over a segment, even on sparse infill
PolygonUtils::spreadDots(segment_start, segment_end, number_of_prime_tower_start_locations, prime_tower_start_locations);
}

Expand Down

0 comments on commit a1b3e66

Please sign in to comment.