Skip to content

Commit

Permalink
[CURA-8076] Split off Seam Overhang Angle from Wall Overhang Angle, (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
HellAholic authored Jun 13, 2024
2 parents 5004896 + d999c08 commit e77eb50
Show file tree
Hide file tree
Showing 63 changed files with 96 additions and 12 deletions.
12 changes: 10 additions & 2 deletions include/LayerPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class LayerPlan : public NoCopy
coord_t comb_move_inside_distance_; //!< Whenever using the minimum boundary for combing it tries to move the coordinates inside by this distance after calculating the combing.
Shape bridge_wall_mask_; //!< The regions of a layer part that are not supported, used for bridging
Shape overhang_mask_; //!< The regions of a layer part where the walls overhang
Shape seam_overhang_mask_; //!< The regions of a layer part where the walls overhang, specifically as defined for the seam
Shape roofing_mask_; //!< The regions of a layer part where the walls are exposed to the air

bool min_layer_time_used = false; //!< Wether or not the minimum layer time (cool_min_layer_time) was actually used in this layerplan.
Expand Down Expand Up @@ -283,6 +284,13 @@ class LayerPlan : public NoCopy
*/
void setOverhangMask(const Shape& polys);

/*!
* Set seam_overhang_mask.
*
* \param polys The overhung areas of the part currently being processed that will require modified print settings w.r.t. seams
*/
void setSeamOverhangMask(const Shape& polys);

/*!
* Set roofing_mask.
*
Expand Down Expand Up @@ -671,12 +679,12 @@ class LayerPlan : public NoCopy
template<typename T>
unsigned locateFirstSupportedVertex(const T& wall, const unsigned start_idx) const
{
if (bridge_wall_mask_.empty() && overhang_mask_.empty())
if (bridge_wall_mask_.empty() && seam_overhang_mask_.empty())
{
return start_idx;
}

const auto air_below = bridge_wall_mask_.unionPolygons(overhang_mask_);
const auto air_below = bridge_wall_mask_.unionPolygons(seam_overhang_mask_);

unsigned curr_idx = start_idx;

Expand Down
21 changes: 11 additions & 10 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2692,22 +2692,21 @@ bool FffGcodeWriter::processInsets(
gcode_layer.setBridgeWallMask(Shape());
}

const AngleDegrees overhang_angle = mesh.settings.get<AngleDegrees>("wall_overhang_angle");
if (overhang_angle >= 90)
{
// clear to disable overhang detection
gcode_layer.setOverhangMask(Shape());
}
else
const auto get_overhang_region = [&](const AngleDegrees overhang_angle) -> Shape
{
if (overhang_angle >= 90)
{
return Shape(); // keep empty to disable overhang detection
}
// the overhang mask is set to the area of the current part's outline minus the region that is considered to be supported
// the supported region is made up of those areas that really are supported by either model or support on the layer below
// expanded to take into account the overhang angle, the greater the overhang angle, the larger the supported area is
// considered to be
const coord_t overhang_width = layer_height * std::tan(overhang_angle / (180 / std::numbers::pi));
Shape overhang_region = part.outline.offset(-half_outer_wall_width).difference(outlines_below.offset(10 + overhang_width - half_outer_wall_width)).offset(10);
gcode_layer.setOverhangMask(overhang_region);
}
return part.outline.offset(-half_outer_wall_width).difference(outlines_below.offset(10 + overhang_width - half_outer_wall_width)).offset(10);
};
gcode_layer.setOverhangMask(get_overhang_region(mesh.settings.get<AngleDegrees>("wall_overhang_angle")));
gcode_layer.setSeamOverhangMask(get_overhang_region(mesh.settings.get<AngleDegrees>("seam_overhang_angle")));

const auto roofing_mask_fn = [&]() -> Shape
{
Expand Down Expand Up @@ -2739,6 +2738,8 @@ bool FffGcodeWriter::processInsets(
gcode_layer.setBridgeWallMask(Shape());
// clear to disable overhang detection
gcode_layer.setOverhangMask(Shape());
// clear to disable overhang detection
gcode_layer.setSeamOverhangMask(Shape());
// clear to disable use of roofing settings
gcode_layer.setRoofingMask(Shape());
}
Expand Down
5 changes: 5 additions & 0 deletions src/LayerPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2689,6 +2689,11 @@ void LayerPlan::setOverhangMask(const Shape& polys)
overhang_mask_ = polys;
}

void LayerPlan::setSeamOverhangMask(const Shape& polys)
{
seam_overhang_mask_ = polys;
}

void LayerPlan::setRoofingMask(const Shape& polys)
{
roofing_mask_ = polys;
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/001.settings
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ infill_support_angle=40
cool_fan_speed_max=100
cool_fan_enabled=False
wall_overhang_angle=90
seam_overhang_angle=30
cool_min_speed=9
wipe_retraction_speed=5
retraction_amount=0.75
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/002.settings
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ support_xy_distance_overhang=0.4
retract_at_layer_change=False
wall_transition_length=0.4
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_enabled=True
cool_fan_speed_max=100.0
min_skin_width_for_expansion=4.898587196589413e-17
Expand Down Expand Up @@ -881,6 +882,7 @@ roofing_material_flow=100
meshfix_maximum_deviation=0.025
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_speed_max=100
speed_prime_tower=25.0
infill=0
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/003.settings
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ support_xy_distance_overhang=0.42
retract_at_layer_change=False
wall_transition_length=0.4
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_enabled=True
cool_fan_speed_max=100.0
min_skin_width_for_expansion=5.143516556418883e-17
Expand Down Expand Up @@ -882,6 +883,7 @@ roofing_material_flow=95.0
meshfix_maximum_deviation=0.025
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_speed_max=100
speed_prime_tower=25.0
infill=0
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/004.settings
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ support_xy_distance_overhang=0.4
retract_at_layer_change=False
wall_transition_length=0.4
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_enabled=True
cool_fan_speed_max=100.0
min_skin_width_for_expansion=4.898587196589413e-17
Expand Down Expand Up @@ -882,6 +883,7 @@ roofing_material_flow=100
meshfix_maximum_deviation=0.025
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_speed_max=100
speed_prime_tower=20
infill=0
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/005.settings
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ support_xy_distance_overhang=0.4
retract_at_layer_change=False
wall_transition_length=0.4
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_enabled=True
cool_fan_speed_max=100.0
min_skin_width_for_expansion=4.898587196589413e-17
Expand Down Expand Up @@ -883,6 +884,7 @@ roofing_material_flow=100
meshfix_maximum_deviation=0.025
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_speed_max=100
speed_prime_tower=25.0
infill=0
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/006.settings
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ support_xy_distance_overhang=0.4
retract_at_layer_change=False
wall_transition_length=0.4
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_enabled=True
cool_fan_speed_max=100.0
min_skin_width_for_expansion=4.898587196589413e-17
Expand Down Expand Up @@ -883,6 +884,7 @@ roofing_material_flow=100
meshfix_maximum_deviation=0.025
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_speed_max=100
speed_prime_tower=25.0
infill=0
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/007.settings
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ support_xy_distance_overhang=0.4
retract_at_layer_change=False
wall_transition_length=0.4
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_enabled=True
cool_fan_speed_max=100.0
min_skin_width_for_expansion=4.898587196589413e-17
Expand Down Expand Up @@ -883,6 +884,7 @@ roofing_material_flow=100
meshfix_maximum_deviation=0.025
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_speed_max=100
speed_prime_tower=40.0
infill=0
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/008.settings
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ retraction_retract_speed=45
cool_fan_speed_max=100
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
infill_wall_line_count=0
support_supported_skin_fan_speed=100
brim_width=3
Expand Down Expand Up @@ -920,6 +921,7 @@ acceleration_wall_0=1500
cool_fan_speed_max=100
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
acceleration_ironing=1000
prime_tower_flow=100
top_skin_expand_distance=0.8
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/009.settings
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ retraction_retract_speed=45
cool_fan_speed_max=100
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
infill_wall_line_count=0
support_supported_skin_fan_speed=100
brim_width=3
Expand Down Expand Up @@ -920,6 +921,7 @@ acceleration_wall_0=1500
cool_fan_speed_max=100
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
acceleration_ironing=1000
prime_tower_flow=100
top_skin_expand_distance=0.8
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/010.settings
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ retraction_retract_speed=45
cool_fan_speed_max=100
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
infill_wall_line_count=0
support_supported_skin_fan_speed=100
brim_width=3
Expand Down Expand Up @@ -920,6 +921,7 @@ acceleration_wall_0=1500
cool_fan_speed_max=100
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
acceleration_ironing=1000
prime_tower_flow=100
top_skin_expand_distance=0.8
Expand Down
2 changes: 2 additions & 0 deletions stress_benchmark/resources/011.settings
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ support_xy_distance_overhang=0.2
retract_at_layer_change=False
wall_transition_length=0.4
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_enabled=True
cool_fan_speed_max=100.0
min_skin_width_for_expansion=4.898587196589413e-17
Expand Down Expand Up @@ -883,6 +884,7 @@ roofing_material_flow=100
meshfix_maximum_deviation=0.025
cool_fan_enabled=True
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_speed_max=100
speed_prime_tower=60
infill=0
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/012.settings
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ gradual_infill_step_height=1.5
cool_min_speed=9
cool_fan_enabled=False
wall_overhang_angle=90
seam_overhang_angle=30
cool_fan_speed_max=100
support_skip_some_zags=False
layer_start_y=0.0
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/013.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=12
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=8
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/014.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=8
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/015.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=20
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/016.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=8
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/017.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=12.0
wall_overhang_speed_factor=100
support_roof_line_width=0.42
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/018.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=8
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/019.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=8
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/020.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=20
wall_overhang_speed_factor=100
support_roof_line_width=0.8
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/021.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=4
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=30
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/022.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=20
wall_overhang_speed_factor=100
support_roof_line_width=0.42000000000000004
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/024.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=10.0
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=8
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/025.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=20
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/026.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=5
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=20
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/027.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=6
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=20
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/028.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100.0
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=20
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
1 change: 1 addition & 0 deletions stress_benchmark/resources/029.settings
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ cool_min_speed=10
cool_fan_enabled=True
cool_fan_speed_max=100
wall_overhang_angle=90
seam_overhang_angle=30
jerk_support_infill=20
wall_overhang_speed_factor=100
support_roof_line_width=0.4
Expand Down
Loading

0 comments on commit e77eb50

Please sign in to comment.