Skip to content

Commit d601c83

Browse files
authored
Merge adea320 into 54a31ee
2 parents 54a31ee + adea320 commit d601c83

File tree

6 files changed

+40
-5
lines changed

6 files changed

+40
-5
lines changed

lib/Slic3r/GUI/PresetEditor.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ sub options {
454454
perimeter_acceleration infill_acceleration bridge_acceleration
455455
first_layer_acceleration default_acceleration
456456
skirts skirt_distance skirt_height min_skirt_length
457-
brim_connections_width brim_ears brim_ears_max_angle brim_width interior_brim_width
457+
brim_connections_width brim_ears brim_ears_max_angle brim_overlap brim_width interior_brim_width
458458
support_material support_material_threshold support_material_max_layers support_material_enforce_layers
459459
raft_layers
460460
support_material_pattern support_material_spacing support_material_angle
@@ -596,6 +596,7 @@ sub build {
596596
$optgroup->append_single_option_line('brim_ears');
597597
$optgroup->append_single_option_line('brim_ears_max_angle');
598598
$optgroup->append_single_option_line('interior_brim_width');
599+
$optgroup->append_single_option_line('brim_overlap');
599600
$optgroup->append_single_option_line('brim_connections_width');
600601
}
601602
}
@@ -953,6 +954,7 @@ sub _update {
953954

954955
$self->get_field('brim_ears')->toggle($have_brim);
955956
$self->get_field('brim_ears_max_angle')->toggle($have_brim && $config->brim_ears);
957+
$self->get_field('brim_overlap')->toggle($have_brim);
956958

957959
my $have_support_material = $config->support_material || $config->raft_layers > 0;
958960
my $have_support_interface = $config->support_material_interface_layers > 0;

slic3r.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ sub usage {
554554
of filament on the first layer, for each extruder (mm, 0+, default: $config->{min_skirt_length})
555555
--brim-width Width of the brim that will get added to each object to help adhesion
556556
(mm, default: $config->{brim_width})
557+
--brim-overlap Overlap between perimeter and brim to control bonding strength (%, default: $config->{brim_overlap})
557558
--brim-ears Print brim only on sharp corners.
558559
--brim-ears-max-angle Maximum angle considered for adding brim ears. (degrees, default: $config->{brim_ears_max_angle})
559560
--interior-brim-width Width of the brim that will get printed inside object holes to help adhesion

src/test/libslic3r/test_skirt_brim.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,23 @@ SCENARIO("Original Slic3r Skirt/Brim tests", "[!mayfail]") {
199199
}
200200
}
201201

202+
WHEN("brim overlap") {
203+
config->set("skirts", 0);
204+
config->set("first_layer_extrusion_width", 0.5);
205+
config->set("brim_width", 1);
206+
config->set("brim_overlap", 15);
207+
208+
Slic3r::Model model;
209+
auto print {Slic3r::Test::init_print({TestMesh::cube_20x20x20}, model, config)};
210+
print->process();
211+
212+
THEN("Gcode generates") {
213+
Slic3r::Test::gcode(gcode, print);
214+
auto exported {gcode.str()};
215+
REQUIRE(exported.size() > 0);
216+
}
217+
}
218+
202219
WHEN("Object is plated with overhang support and a brim") {
203220
config->set("layer_height", 0.4);
204221
config->set("first_layer_height", 0.4);

xs/src/libslic3r/Print.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ Print::invalidate_state_by_config(const PrintConfigBase &config)
351351
|| opt_key == "interior_brim_width"
352352
|| opt_key == "brim_ears"
353353
|| opt_key == "brim_ears_max_angle"
354+
|| opt_key == "brim_overlap"
354355
|| opt_key == "brim_connections_width") {
355356
steps.insert(psBrim);
356357
steps.insert(psSkirt);
@@ -1115,18 +1116,19 @@ Print::_make_brim()
11151116
}
11161117
}
11171118
}
1118-
1119+
11191120
Polygons loops;
11201121
const int num_loops = floor(this->config.brim_width / flow.width + 0.5);
11211122
for (int i = num_loops; i >= 1; --i) {
11221123
// JT_SQUARE ensures no vertex is outside the given offset distance
11231124
// -0.5 because islands are not represented by their centerlines
11241125
// (first offset more, then step back - reverse order than the one used for
1125-
// perimeters because here we're offsetting outwards)
1126+
// perimeters because here we're offsetting outwards)
11261127
append_to(loops, offset2(
11271128
islands,
1128-
flow.scaled_width() + flow.scaled_spacing() * (i - 1.5 + 0.5),
1129-
flow.scaled_spacing() * -0.525, // WORKAROUND for brim placement, original 0.5 leaves too much of a gap.
1129+
(flow.scaled_width() * 0.5 + flow.scaled_spacing() *
1130+
(i - 0.5 - this->config.brim_overlap.get_abs_value(1.0))),
1131+
flow.scaled_spacing() * -0.5,
11301132
100000,
11311133
ClipperLib::jtSquare
11321134
));

xs/src/libslic3r/PrintConfig.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,17 @@ PrintConfigDef::PrintConfigDef()
177177
def->max = 180;
178178
def->default_value = new ConfigOptionFloat(125);
179179

180+
def = this->add("brim_overlap", coPercent);
181+
def->label = __TRANS("Brim/perimeter overlap");
182+
def->gui_type = "f_enum_open";
183+
def->category = __TRANS("Skirt and brim");
184+
def->tooltip = __TRANS("Overlap between the perimeter and brim. Positive values stregthen and negative values weaken bonding.");
185+
def->sidetext = "%";
186+
def->cli = "brim-overlap=s";
187+
def->enum_values.push_back("-3.13%");
188+
def->enum_labels.push_back("default");
189+
def->default_value = new ConfigOptionPercent(-3.13);
190+
180191
def = this->add("brim_width", coFloat);
181192
def->label = __TRANS("Exterior brim width");
182193
def->category = __TRANS("Skirt and brim");

xs/src/libslic3r/PrintConfig.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ class PrintConfig : public GCodeConfig
437437
ConfigOptionFloat brim_connections_width;
438438
ConfigOptionBool brim_ears;
439439
ConfigOptionFloat brim_ears_max_angle;
440+
ConfigOptionPercent brim_overlap;
440441
ConfigOptionFloat brim_width;
441442
ConfigOptionBool complete_objects;
442443
ConfigOptionBool cooling;
@@ -501,6 +502,7 @@ class PrintConfig : public GCodeConfig
501502
OPT_PTR(brim_connections_width);
502503
OPT_PTR(brim_ears);
503504
OPT_PTR(brim_ears_max_angle);
505+
OPT_PTR(brim_overlap);
504506
OPT_PTR(brim_width);
505507
OPT_PTR(complete_objects);
506508
OPT_PTR(cooling);

0 commit comments

Comments
 (0)