Skip to content

Commit

Permalink
Fix tree support fake roof (#1983)
Browse files Browse the repository at this point in the history
  • Loading branch information
casperlamboo authored Nov 22, 2023
2 parents bcfd053 + 18ebef6 commit 5f80ab9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 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
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 5f80ab9

Please sign in to comment.