Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 2, 2023
1 parent 6631919 commit 871ea5e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion include/PrimeTower.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class PrimeTower
* \param line_width The actual line width of the extruder
* \param actual_extruder_nr The actual extruder to be used
*/
ExtrusionMoves generatePath_sparseInfill(
Polygons generatePath_sparseInfill(
const size_t first_extruder,
const size_t last_extruder,
const std::vector<coord_t>& rings_radii,
Expand Down
8 changes: 3 additions & 5 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ LayerPlan& FffGcodeWriter::processLayer(const SliceDataStorage& storage, LayerIn
// later in the print a prime tower is needed.
// - prime tower is already printed this layer (only applicable for more than 2 extruders).
// The setExtruder_addPrime takes care of this.
if (extruder_nr != extruder_order.front() || (extruder_order.size() == 1 && layer_nr >= 0) || extruder_nr == 0)
if (extruder_nr != extruder_order.front().extruder_nr || (extruder_order.size() == 1 && layer_nr >= 0) || extruder_nr == 0)
{
setExtruder_addPrime(storage, gcode_layer, extruder_nr);
}
Expand Down Expand Up @@ -1092,7 +1092,7 @@ LayerPlan& FffGcodeWriter::processLayer(const SliceDataStorage& storage, LayerIn
// Always print a prime tower before switching extruder. Unless:
// - The prime tower is already printed this layer (setExtruder_addPrime takes care of this).
// - this is the last extruder of the layer, since the next layer will start with the same extruder.
if (extruder_nr != extruder_order.back() && layer_nr >= 0)
if (extruder_nr != extruder_order.back().extruder_nr && layer_nr >= 0)
{
setExtruder_addPrime(storage, gcode_layer, extruder_nr);
}
Expand Down Expand Up @@ -1403,9 +1403,7 @@ std::vector<ExtruderUse>
// Make a temp list with the potential ordered extruders
std::vector<size_t> ordered_extruders;
ordered_extruders.push_back(start_extruder);

// The outermost prime tower extruder is always used if there is a prime tower, apart on layers with negative index (e.g. for the raft)
if (mesh_group_settings.get<bool>("prime_tower_enable") && /*layer_nr >= 0 &&*/ layer_nr <= storage.max_print_height_second_to_last_extruder)
for (size_t extruder_nr = 0; extruder_nr < extruder_count; extruder_nr++)
{
if (extruder_nr != start_extruder)
{
Expand Down
14 changes: 7 additions & 7 deletions src/PrimeTower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ void PrimeTower::generatePaths_sparseInfill(const std::vector<coord_t>& cumulati
extruders_combination |= (1 << extruder_nr);
}

std::map<size_t, ExtrusionMoves> infills_for_combination;
std::map<size_t, Polygons> infills_for_combination;
for (const ActualExtruder& actual_extruder : actual_extruders)
{
ExtrusionMoves infill = generatePath_sparseInfill(first_extruder, last_extruder, rings_radii, actual_extruder.line_width, actual_extruder.number);
Polygons infill = generatePath_sparseInfill(first_extruder, last_extruder, rings_radii, actual_extruder.line_width, actual_extruder.number);
infills_for_combination[actual_extruder.number] = infill;
}

Expand All @@ -259,7 +259,7 @@ void PrimeTower::generatePaths_sparseInfill(const std::vector<coord_t>& cumulati
}
}

PrimeTower::ExtrusionMoves PrimeTower::generatePath_sparseInfill(
Polygons PrimeTower::generatePath_sparseInfill(
const size_t first_extruder,
const size_t last_extruder,
const std::vector<coord_t>& rings_radii,
Expand All @@ -277,15 +277,15 @@ PrimeTower::ExtrusionMoves PrimeTower::generatePath_sparseInfill(
const size_t nb_rings = std::ceil(static_cast<float>(radius_delta) / max_bridging_distance);
const coord_t actual_radius_step = radius_delta / nb_rings;

ExtrusionMoves pattern;
Polygons pattern;
for (size_t i = 0; i < nb_rings; ++i)
{
const coord_t ring_inner_radius = (inner_radius + i * actual_radius_step) + semi_line_width;
const coord_t ring_outer_radius = (inner_radius + (i + 1) * actual_radius_step) - semi_line_width;

const size_t semi_nb_spokes = std::ceil((M_PI * ring_outer_radius) / max_bridging_distance);

pattern.polygons.add(PolygonUtils::makeWheel(middle, ring_inner_radius, ring_outer_radius, semi_nb_spokes, ARC_RESOLUTION));
pattern.add(PolygonUtils::makeWheel(middle, ring_inner_radius, ring_outer_radius, semi_nb_spokes, ARC_RESOLUTION));
}

return pattern;
Expand Down Expand Up @@ -479,12 +479,12 @@ void PrimeTower::addToGcode_optimizedInfill(LayerPlan& gcode_layer, const std::v
auto iterator_combination = sparse_pattern_per_extruders.find(mask);
if (iterator_combination != sparse_pattern_per_extruders.end())
{
const std::map<size_t, ExtrusionMoves>& infill_for_combination = iterator_combination->second;
const std::map<size_t, Polygons>& infill_for_combination = iterator_combination->second;

auto iterator_extruder_nr = infill_for_combination.find(current_extruder);
if (iterator_extruder_nr != infill_for_combination.end())
{
gcode_layer.addPolygonsByOptimizer(iterator_extruder_nr->second.polygons, config);
gcode_layer.addPolygonsByOptimizer(iterator_extruder_nr->second, config);
}
else
{
Expand Down

0 comments on commit 871ea5e

Please sign in to comment.