Skip to content

Commit e1fb57a

Browse files
committed
Do not use small width area when generating bridging lines
CURA-12833 This makes sure the bridging lines will anchor as deep as possible inside the mesh, instead of sometimes generating a tiny concentric area on the borders.
1 parent 1ef3e9e commit e1fb57a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

include/FffGcodeWriter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ class FffGcodeWriter : public NoCopy
592592
* minimise travel moves (``false``).
593593
* \param[out] added_something Whether this function added anything to the layer plan
594594
* \param fan_speed fan speed override for this skin area
595+
* \param forced_small_area_width A specific value to be used for small_area_width when generating the infill, or nullopt to use the normal value
595596
*/
596597
void processSkinPrintFeature(
597598
const SliceDataStorage& storage,
@@ -607,7 +608,8 @@ class FffGcodeWriter : public NoCopy
607608
const LinesOrderingMethod ordering,
608609
const bool is_roofing_flooring,
609610
bool& added_something,
610-
double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT) const;
611+
double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT,
612+
std::optional<coord_t> forced_small_area_width = std::nullopt) const;
611613

612614
/*!
613615
* see if we can avoid printing a lines or zig zag style skin part in multiple segments by moving to

src/FffGcodeWriter.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,6 +3577,7 @@ void FffGcodeWriter::processTopBottom(
35773577
const bool bridge_enable_more_layers = bridge_settings_enabled && mesh.settings.get<bool>("bridge_enable_more_layers");
35783578
const Ratio support_threshold = bridge_settings_enabled ? mesh.settings.get<Ratio>("bridge_skin_support_threshold") : 0.0_r;
35793579
const size_t bottom_layers = mesh.settings.get<size_t>("bottom_layers");
3580+
std::optional<coord_t> forced_small_area_width;
35803581

35813582
// if support is enabled, consider the support outlines so we don't generate bridges over support
35823583

@@ -3634,6 +3635,7 @@ void FffGcodeWriter::processTopBottom(
36343635
break;
36353636
}
36363637
}
3638+
forced_small_area_width = 0;
36373639
pattern = EFillMethod::LINES; // force lines pattern when bridging
36383640
if (bridge_settings_enabled)
36393641
{
@@ -3733,7 +3735,8 @@ void FffGcodeWriter::processTopBottom(
37333735
ordering,
37343736
is_roofing_flooring,
37353737
added_something,
3736-
fan_speed);
3738+
fan_speed,
3739+
forced_small_area_width);
37373740
}
37383741

37393742
void FffGcodeWriter::processSkinPrintFeature(
@@ -3750,7 +3753,8 @@ void FffGcodeWriter::processSkinPrintFeature(
37503753
const LinesOrderingMethod ordering,
37513754
const bool is_roofing_flooring,
37523755
bool& added_something,
3753-
double fan_speed) const
3756+
double fan_speed,
3757+
std::optional<coord_t> forced_small_area_width) const
37543758
{
37553759
Shape skin_polygons;
37563760
OpenLinesSet skin_lines;
@@ -3773,7 +3777,8 @@ void FffGcodeWriter::processSkinPrintFeature(
37733777
constexpr coord_t pocket_size = 0;
37743778
const bool small_areas_on_surface = mesh.settings.get<bool>("small_skin_on_surface");
37753779
const coord_t line_width = config.getLineWidth();
3776-
const coord_t small_area_width = (small_areas_on_surface || ! is_roofing_flooring) ? mesh.settings.get<coord_t>("small_skin_width") : line_width / 4;
3780+
const coord_t small_area_width
3781+
= forced_small_area_width.value_or((small_areas_on_surface || ! is_roofing_flooring) ? mesh.settings.get<coord_t>("small_skin_width") : line_width / 4);
37773782
const auto& current_layer = mesh.layers[gcode_layer.getLayerNr()];
37783783
const auto& exposed_to_air = current_layer.top_surface.areas.unionPolygons(current_layer.bottom_surface);
37793784

0 commit comments

Comments
 (0)