Skip to content

Commit

Permalink
Fix issue causing force initial layer diameter to be always applied f…
Browse files Browse the repository at this point in the history
…or tips placed further down because of xy overrides z
  • Loading branch information
ThomasRahm committed Apr 25, 2024
1 parent 1a7db83 commit 93f53f1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/TreeSupportTipGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2227,7 +2227,6 @@ void TreeSupportTipGenerator::generateTips(
{
continue;
}
all_cradle_areas[layer_idx] = all_cradle_areas[layer_idx].unionPolygons();
std::vector<LineInformation> overhang_lines;
Polygons polylines = ensureMaximumDistancePolyline(generateLines(remaining_overhang_part, false, layer_idx), current_tip_radius, 1, false);
// ^^^ Support_line_width to form a line here as otherwise most will be unsupported.
Expand All @@ -2253,8 +2252,8 @@ void TreeSupportTipGenerator::generateTips(
for (size_t lag_ctr = 1; lag_ctr <= max_overhang_insert_lag_ && ! overhang_lines.empty() && layer_idx - coord_t(lag_ctr) >= 1; lag_ctr++)
{
LayerIndex layer_idx_lag = layer_idx - lag_ctr;
coord_t current_tip_radius_lag = std::max(config_.min_radius, config_.recommendedMinRadius(layer_idx_lag)); // todo setting

coord_t current_tip_radius_lag
= (force_initial_layer_radius_ && config_.recommendedMinRadius(layer_idx_lag) > config_.min_radius) ? config_.recommendedMinRadius(layer_idx_lag) : config_.min_radius;
// get least restricted avoidance for layer_idx-lag_ctr
Polygons relevant_forbidden_below = volumes_.getAvoidance(
config_.getRadius(0),
Expand Down Expand Up @@ -2321,8 +2320,11 @@ void TreeSupportTipGenerator::generateTips(
{
std::optional<TreeSupportCradleLine*> cradle_line_opt
= overhang_data.cradle_->getCradleLineOfIndex(overhang_data.cradle_layer_idx_, overhang_data.cradle_line_idx_);
Polygons line = cradle_line_opt.value()->line_.offset(0);
polylines = ensureMaximumDistancePolyline(line, ! overhang_data.is_roof_ ? config_.min_radius * 2 : support_supporting_branch_distance_, 1, false);
if(cradle_line_opt)
{
Polygons line = cradle_line_opt.value()->line_.offset(0);
polylines = ensureMaximumDistancePolyline(line, ! overhang_data.is_roof_ ? config_.min_radius * 2 : support_supporting_branch_distance_, 1, false);
}
}
else
{
Expand Down

0 comments on commit 93f53f1

Please sign in to comment.