Skip to content

Commit

Permalink
Merge branch '5.6' of github.com:Ultimaker/CuraEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
nallath committed Nov 27, 2023
2 parents bad8af4 + 1d7038b commit 574c4b9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/SupportInfillPart.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SupportInfillPart
// for infill_areas[x][n], x means the density level and n means the thickness
std::vector<VariableWidthLines> wall_toolpaths; //!< Any walls go here, not in the areas, where they could be combined vertically (don't combine walls). Binned by inset_idx.

coord_t custom_line_distance;
coord_t custom_line_distance; //!< The distance between support infill lines. 0 means use the default line distance instead.
bool use_fractional_config; //!< Request to use the configuration used to fill a partial layer height here, instead of the normal full layer height configuration.

SupportInfillPart(const PolygonsPart& outline, coord_t support_line_width, bool use_fractional_config, int inset_count_to_generate = 0, coord_t custom_line_distance = 0);
Expand Down
4 changes: 3 additions & 1 deletion include/sliceDataStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,16 @@ class SupportLayer
* \param wall_line_count Wall-line count around the fill.
* \param grow_layer_above (optional, default to 0) In cases where support shrinks per layer up, an appropriate offset may be nescesary.
* \param unionAll (optional, default to false) Wether to 'union all' for the split into parts bit.
* \param custom_line_distance (optional, default to 0) Distance between lines of the infill pattern. custom_line_distance of 0 means use the default instead.
*/
void fillInfillParts(
const LayerIndex layer_nr,
const std::vector<Polygons>& support_fill_per_layer,
const coord_t support_line_width,
const coord_t wall_line_count,
const coord_t grow_layer_above = 0,
const bool unionAll = false);
const bool unionAll = false,
const coord_t custom_line_distance = 0);
};

class SupportStorage
Expand Down
28 changes: 27 additions & 1 deletion src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,9 +929,35 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage)
skip_some_zags,
zag_skip_count,
pocket_size);

std::vector<VariableWidthLines> raft_paths; // Should remain empty, since we have no walls.
infill_comp.generate(raft_paths, raft_polygons, raft_lines, surface_settings, layer_nr, SectionType::ADHESION);
gcode_layer.addLinesByOptimizer(raft_lines, gcode_layer.configs_storage.raft_surface_config, SpaceFillType::Lines, false, 0, 1.0, last_planned_position);

const auto wipe_dist = 0;
const auto spiralize = false;
const auto flow_ratio = 1.0_r;
const auto enable_travel_optimization = false;
const auto always_retract = false;
const auto reverse_order = false;

gcode_layer.addLinesByOptimizer(
raft_lines,
gcode_layer.configs_storage.raft_surface_config,
SpaceFillType::Lines,
enable_travel_optimization,
wipe_dist,
flow_ratio,
last_planned_position);
gcode_layer.addPolygonsByOptimizer(
raft_polygons,
gcode_layer.configs_storage.raft_surface_config,
ZSeamConfig(),
wipe_dist,
spiralize,
flow_ratio,
always_retract,
reverse_order,
gcode_layer.getLastPlannedPositionOrStartingPosition());

raft_polygons.clear();
raft_lines.clear();
Expand Down
2 changes: 1 addition & 1 deletion src/TreeSupportTipGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ void TreeSupportTipGenerator::generateTips(
if (use_fake_roof)
{
storage.support.supportLayers[layer_idx]
.fillInfillParts(layer_idx, support_roof_drawn, config.support_line_width, support_roof_line_distance, config.maximum_move_distance);
.fillInfillParts(layer_idx, support_roof_drawn, config.support_line_width, 0, config.maximum_move_distance, false, support_roof_line_distance);
placed_support_lines_support_areas[layer_idx].add(TreeSupportUtils::generateSupportInfillLines(
support_roof_drawn[layer_idx],
config,
Expand Down
5 changes: 3 additions & 2 deletions src/sliceDataStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,8 @@ void SupportLayer::fillInfillParts(
const coord_t support_line_width,
const coord_t wall_line_count,
const coord_t grow_layer_above /*has default 0*/,
const bool unionAll /*has default false*/)
const bool unionAll /*has default false*/,
const coord_t custom_line_distance /*has default 0*/)
{
const Polygons& support_this_layer = support_fill_per_layer[layer_nr];
const Polygons& support_layer_above
Expand All @@ -732,7 +733,7 @@ void SupportLayer::fillInfillParts(
{
for (const PolygonsPart& island_outline : support_areas.splitIntoParts(unionAll))
{
support_infill_parts.emplace_back(island_outline, support_line_width, use_fractional_config, wall_line_count);
support_infill_parts.emplace_back(island_outline, support_line_width, use_fractional_config, wall_line_count, custom_line_distance);
}
use_fractional_config = false;
}
Expand Down

0 comments on commit 574c4b9

Please sign in to comment.