Skip to content

Commit 2b8811c

Browse files
committed
split interface pattern into top and bottom
2 parents 512b568 + 8822851 commit 2b8811c

File tree

12 files changed

+97
-40
lines changed

12 files changed

+97
-40
lines changed

resources/ui_layout/default/print.ui

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,17 @@ group:Options for support material and raft
320320
group:Options for support material interface
321321
setting:support_material_interface_layer_height
322322
line:Pattern
323-
setting:support_material_interface_pattern
324-
setting:label$Interface spacing:support_material_interface_spacing
323+
setting:label$Top:support_material_top_interface_pattern
324+
setting:label$Bottom:support_material_bottom_interface_pattern
325+
setting:label$Spacing:support_material_interface_spacing
325326
end_line
326327
line:Pattern Angle
327328
setting:label$_:support_material_interface_angle
328329
setting:label$Increment:support_material_interface_angle_increment
329330
end_line
330331
line:Layer count
331-
setting:support_material_interface_layers
332-
setting:support_material_bottom_interface_layers
332+
setting:label$Top:support_material_interface_layers
333+
setting:label$Bottom:support_material_bottom_interface_layers
333334
end_line
334335
setting:support_material_interface_contact_loops
335336

src/libslic3r/Format/BBConfig.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void init()
219219
key_translation_map["sparse_infill_pattern"] = "fill_pattern";
220220
key_translation_map["filename_format"] = "output_filename_format";
221221
key_translation_map["support_base_pattern"] = "support_material_pattern";
222-
key_translation_map["support_interface_pattern"] = "support_material_interface_pattern";
222+
key_translation_map["support_interface_pattern"] = "support_material_top_interface_pattern";
223223
key_translation_map["top_surface_pattern"] = "top_fill_pattern";
224224
key_translation_map["support_object_xy_distance"] = "support_material_xy_spacing";
225225
key_translation_map["fuzzy_skin_point_distance"] = "fuzzy_skin_point_dist";
@@ -425,7 +425,7 @@ void init()
425425
//key_translation_map["single"]="retract_lift_above";
426426
//key_translation_map["single"]="retract_lift_below";
427427
//key_translation_map["single"]="wipe";
428-
//patern
428+
//pattern
429429
value_translation_map["fill_pattern"]["monotonicline"] = "monotoniclines"; //2.7
430430
value_translation_map["fill_pattern"]["zig-zag"] = "rectilinear";
431431
value_translation_map["fill_pattern"]["tri-hexagon"] = "stars";
@@ -435,15 +435,17 @@ void init()
435435
value_translation_map["solid_fill_pattern"] = value_translation_map["fill_pattern"];
436436
value_translation_map["brim_ears_pattern"] = value_translation_map["fill_pattern"];
437437
value_translation_map["bridge_fill_pattern"] = value_translation_map["fill_pattern"];
438-
value_translation_map["support_material_interface_pattern"] = value_translation_map["fill_pattern"];
438+
value_translation_map["support_material_top_interface_pattern"] = value_translation_map["fill_pattern"];
439+
value_translation_map["support_material_bottom_interface_pattern"] = value_translation_map["fill_pattern"];
439440
//specific
440441
value_translation_map["fill_pattern"]["default"] = "gyroid";
441442
value_translation_map["top_fill_pattern"]["default"] = "monotonic";
442443
value_translation_map["bottom_fill_pattern"]["default"] = "monotonic";
443444
value_translation_map["solid_fill_pattern"]["default"] = "rectilinear";
444445
value_translation_map["brim_ears_pattern"]["default"] = "concentric";
445446
value_translation_map["bridge_fill_pattern"]["default"] = "rectilinear";
446-
value_translation_map["support_material_interface_pattern"]["default"] = "auto";
447+
value_translation_map["support_material_top_interface_pattern"]["default"] = "auto";
448+
value_translation_map["support_material_bottom_interface_pattern"]["default"] = "auto";
447449
//value_translation_map["support_material_interface_pattern"]["rectilinear_interlaced"] = "???"; //can't convert let the config_substitutions emit the warning
448450

449451
//others
@@ -508,8 +510,12 @@ void complicated_convert(t_config_option_key &opt_key, std::string &value, const
508510
value = "1";
509511
}
510512
}
511-
if ("enable_overhang_speed") {
512-
513+
//if ("enable_overhang_speed") {
514+
//
515+
//}
516+
if ("support_material_top_interface_pattern" == opt_key || "support_interface_pattern" == opt_key) {
517+
output["support_material_top_interface_pattern"] = value;
518+
output["support_material_bottom_interface_pattern"] = value;
513519
}
514520
}
515521

src/libslic3r/Geometry/MedialAxis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3120,7 +3120,7 @@ unsafe_variable_width(const ThickPolyline& polyline, const ExtrusionRole role, c
31203120
const coordf_t new_length = prev_line.a.distance_to(line.b);
31213121
assert(sum_length - new_length > -0.0000000001);
31223122
// only merge if the distance is almost the sum (90° = 0.707)
3123-
if(new_length < sum_length * 0.9)
3123+
if(new_length < std::max(sum_length * 0.9, std::max(prev_line_len + line_len/2 , prev_line_len /2 + line_len)))
31243124
continue;
31253125
assert(new_length > prev_line_len && new_length > line_len);
31263126
coordf_t width = prev_line_len * (prev_line.a_width + prev_line.b_width) / 2;

src/libslic3r/Preset.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ static std::vector<std::string> s_Preset_print_options {
621621
"support_material_angle",
622622
"support_material_angle_height",
623623
"support_material_interface_layers", "support_material_bottom_interface_layers",
624-
"support_material_interface_pattern",
624+
"support_material_top_interface_pattern",
625+
"support_material_bottom_interface_pattern",
625626
"support_material_interface_angle",
626627
"support_material_interface_angle_increment",
627628
"support_material_interface_spacing",

src/libslic3r/PrintConfig.cpp

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5766,11 +5766,36 @@ void PrintConfigDef::init_fff_params()
57665766
def->mode = comAdvancedE | comPrusa;
57675767
def->set_default_value(new ConfigOptionEnum<SupportMaterialPattern>(smpRectilinear));
57685768

5769-
def = this->add("support_material_interface_pattern", coEnum);
5770-
def->label = L("Pattern");
5771-
def->full_label = L("Support interface pattern");
5769+
def = this->add("support_material_bottom_interface_pattern", coEnum);
5770+
def->label = L("Bottom Pattern");
5771+
def->full_label = L("Support bottom interface pattern");
5772+
def->category = OptionCategory::support;
5773+
def->tooltip = L("Pattern for the bottom interface layers (the ones that start on the object)."
5774+
"\nDefault pattern is the same as the top interface, unless it's Hilbert Curve or Ironing."
5775+
"\nNote that 'Hilbert', 'Ironing' , '(filled)' patterns are really discouraged, and meant to be used with soluble supports and 100% fill interface layer.");
5776+
def->enum_keys_map = &ConfigOptionEnum<InfillPattern>::get_enum_values();
5777+
def->enum_values.push_back("auto");
5778+
def->enum_values.push_back("rectilinear");
5779+
def->enum_values.push_back("monotonic");
5780+
def->enum_values.push_back("concentric");
5781+
def->enum_values.push_back("hilbertcurve");
5782+
def->enum_values.push_back("concentricgapfill");
5783+
def->enum_values.push_back("smooth");
5784+
def->enum_labels.push_back(L("Default"));
5785+
def->enum_labels.push_back(L("Rectilinear"));
5786+
def->enum_labels.push_back(L("Monotonic"));
5787+
def->enum_labels.push_back(L("Concentric"));
5788+
def->enum_labels.push_back(L("Hilbert Curve"));
5789+
def->enum_labels.push_back(L("Concentric (filled)"));
5790+
def->enum_labels.push_back(L("Ironing"));
5791+
def->mode = comAdvancedE | comSuSi;
5792+
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipAuto));
5793+
5794+
def = this->add("support_material_top_interface_pattern", coEnum);
5795+
def->label = L("Top Pattern");
5796+
def->full_label = L("Support top interface pattern");
57725797
def->category = OptionCategory::support;
5773-
def->tooltip = L("Pattern for interface layers."
5798+
def->tooltip = L("Pattern for the top interface layers."
57745799
"\nNote that 'Hilbert', 'Ironing' and '(filled)' patterns are meant to be used with soluble supports and 100% fill interface layer.");
57755800
def->enum_keys_map = &ConfigOptionEnum<InfillPattern>::get_enum_values();
57765801
def->enum_values.push_back("auto");
@@ -5791,6 +5816,7 @@ void PrintConfigDef::init_fff_params()
57915816
def->enum_labels.push_back(L("Ironing"));
57925817
def->mode = comAdvancedE | comPrusa;
57935818
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipRectilinear));
5819+
def->aliases = {"support_material_interface_pattern"};
57945820

57955821
def = this->add("support_material_layer_height", coFloatOrPercent);
57965822
def->label = L("Support layer height");
@@ -7923,7 +7949,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
79237949
// some changes has occurs between rectilineargapfill and monotonicgapfill. Set them at the right value for each type
79247950
if (value == "rectilineargapfill" && (opt_key == "top_fill_pattern" || opt_key == "bottom_fill_pattern") )
79257951
value = "monotonicgapfill";
7926-
if (opt_key == "fill_pattern" || opt_key == "support_material_interface_pattern") {
7952+
if (opt_key == "fill_pattern" || opt_key == "support_material_interface_pattern" || opt_key == "support_material_top_interface_pattern" || opt_key == "support_material_bottom_interface_pattern") {
79277953
if (value == "rectilineargapfill") {
79287954
value = "rectilinear";
79297955
} else if (value == "monotonicgapfill") {
@@ -8540,7 +8566,7 @@ std::unordered_set<std::string> prusa_export_to_remove_keys = {
85408566
"support_material_interface_angle_increment",
85418567
"support_material_interface_fan_speed",
85428568
"support_material_interface_layer_height",
8543-
"support_material_interface_pattern",
8569+
"support_material_bottom_interface_pattern",
85448570
"support_material_layer_height",
85458571
"thin_perimeters_all",
85468572
"thin_perimeters",
@@ -8622,6 +8648,9 @@ std::map<std::string, std::string> PrintConfigDef::to_prusa(t_config_option_key&
86228648
&& ("fill_pattern" == opt_key || "top_fill_pattern" == opt_key)) {
86238649
value = "alignedrectilinear";
86248650
}
8651+
if ("support_material_top_interface_pattern" == opt_key) {
8652+
opt_key = "support_material_interface_pattern";
8653+
}
86258654
} else if ("seam_position" == opt_key) {
86268655
if ("cost" == value) {
86278656
value = "nearest";

src/libslic3r/PrintConfig.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ PRINT_CONFIG_CLASS_DEFINE(
784784
((ConfigOptionFloatOrPercent, support_material_contact_distance))
785785
// support_material_bottom_contact_distance (PS 2.4) == support_material_contact_distance_bottom (SuSi 2.3 &-)
786786
((ConfigOptionFloatOrPercent, support_material_bottom_contact_distance))
787+
((ConfigOptionEnum<InfillPattern>, support_material_bottom_interface_pattern))
787788
((ConfigOptionInt, support_material_enforce_layers))
788789
((ConfigOptionInt, support_material_extruder))
789790
((ConfigOptionFloatOrPercent, support_material_extrusion_width))
@@ -797,7 +798,6 @@ PRINT_CONFIG_CLASS_DEFINE(
797798
// Spacing between interface lines (the hatching distance). Set zero to get a solid interface.
798799
((ConfigOptionFloat, support_material_interface_spacing))
799800
((ConfigOptionFloatOrPercent, support_material_interface_speed))
800-
((ConfigOptionEnum<InfillPattern>, support_material_interface_pattern))
801801
((ConfigOptionEnum<SupportMaterialPattern>, support_material_pattern))
802802
// Morphological closing of support areas. Only used for "sung" supports.
803803
((ConfigOptionFloat, support_material_closing_radius))
@@ -809,6 +809,7 @@ PRINT_CONFIG_CLASS_DEFINE(
809809
((ConfigOptionBool, support_material_synchronize_layers))
810810
// Overhang angle threshold.
811811
((ConfigOptionInt, support_material_threshold))
812+
((ConfigOptionEnum<InfillPattern>, support_material_top_interface_pattern))
812813
((ConfigOptionBool, support_material_with_sheath))
813814
((ConfigOptionFloatOrPercent, support_material_xy_spacing))
814815
((ConfigOptionBool, thin_walls_merge))

src/libslic3r/PrintObject.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,14 +838,15 @@ FillLightning::GeneratorPtr PrintObject::prepare_lightning_infill_data()
838838
|| opt_key == "support_material_extrusion_width"
839839
|| opt_key == "support_material_interface_layers"
840840
|| opt_key == "support_material_bottom_interface_layers"
841+
|| opt_key == "support_material_bottom_interface_pattern"
841842
|| opt_key == "support_material_interface_angle"
842843
|| opt_key == "support_material_interface_angle_increment"
843844
|| opt_key == "support_material_interface_contact_loops"
844845
|| opt_key == "support_material_interface_extruder"
845-
|| opt_key == "support_material_interface_pattern"
846846
|| opt_key == "support_material_interface_spacing"
847847
|| opt_key == "support_material_pattern"
848848
|| opt_key == "support_material_style"
849+
|| opt_key == "support_material_top_interface_pattern"
849850
|| opt_key == "support_material_xy_spacing"
850851
|| opt_key == "support_material_spacing"
851852
|| opt_key == "support_material_closing_radius"

src/libslic3r/SupportMaterial.cpp

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,26 @@ PrintObjectSupportMaterial::PrintObjectSupportMaterial(const PrintObject *object
427427
support_pattern == smpHoneycomb ? ipHoneycomb :
428428
m_support_params.support_density > 0.95 || m_support_params.with_sheath ? ipRectilinear : ipSupportBase;
429429
m_support_params.interface_fill_pattern = (m_support_params.interface_density > 0.95 ? ipRectilinear : ipSupportBase);
430-
m_support_params.contact_fill_pattern = m_object_config->support_material_interface_pattern;
431-
if (m_support_params.contact_fill_pattern == ipAuto)
430+
m_support_params.contact_top_fill_pattern = m_object_config->support_material_top_interface_pattern;
431+
m_support_params.contact_bottom_fill_pattern = m_object_config->support_material_bottom_interface_pattern;
432+
if (m_support_params.contact_top_fill_pattern == ipAuto)
432433
if (m_slicing_params->soluble_interface)
433-
m_support_params.contact_fill_pattern = ipConcentric;
434+
m_support_params.contact_top_fill_pattern = ipConcentric;
434435
else if (m_support_params.interface_density > 0.95)
435-
m_support_params.contact_fill_pattern = ipRectilinear;
436+
m_support_params.contact_top_fill_pattern = ipRectilinear;
436437
else
437-
m_support_params.contact_fill_pattern = ipSupportBase;
438+
m_support_params.contact_top_fill_pattern = ipSupportBase;
439+
if (m_support_params.contact_bottom_fill_pattern == ipAuto)
440+
if(m_support_params.contact_top_fill_pattern != ipHilbertCurve
441+
&& m_support_params.contact_top_fill_pattern != ipSmooth
442+
&& m_support_params.contact_top_fill_pattern != ipSawtooth)
443+
m_support_params.contact_bottom_fill_pattern = m_support_params.contact_top_fill_pattern;
444+
else if (m_slicing_params->soluble_interface)
445+
m_support_params.contact_bottom_fill_pattern = ipConcentric;
446+
else if (m_support_params.interface_density > 0.95)
447+
m_support_params.contact_bottom_fill_pattern = ipRectilinear;
448+
else
449+
m_support_params.contact_bottom_fill_pattern = ipSupportBase;
438450
}
439451

440452
// Using the std::deque as an allocator.
@@ -4167,16 +4179,16 @@ void PrintObjectSupportMaterial::generate_toolpaths(
41674179
SupportLayer &support_layer = *support_layers[support_layer_id];
41684180
assert(support_layer.support_fills.entities().empty());
41694181
MyLayer &raft_layer = *raft_layers[support_layer_id];
4170-
4171-
std::unique_ptr<Fill> filler_interface = std::unique_ptr<Fill>(Fill::new_from_type(m_support_params.contact_fill_pattern)); //m_support_params.interface_fill_pattern)); FIXME choose
4172-
std::unique_ptr<Fill> filler_support = std::unique_ptr<Fill>(Fill::new_from_type(m_support_params.base_fill_pattern));
4182+
4183+
std::unique_ptr<Fill> filler_top_interface = std::unique_ptr<Fill>(Fill::new_from_type(m_support_params.contact_top_fill_pattern));
4184+
std::unique_ptr<Fill> filler_support = std::unique_ptr<Fill>(Fill::new_from_type(m_support_params.base_fill_pattern));
41734185
std::unique_ptr<FillWithPerimeter> filler_support_with_sheath = std::make_unique<FillWithPerimeter>((Fill::new_from_type(m_support_params.base_fill_pattern)));
41744186
filler_support_with_sheath->overlap = m_support_params.gap_xy == 0 ? 0 : 1; // allow periemter overlap is not touching perimeters
41754187
filler_support_with_sheath->ratio_fill_inside = 0.2f;
41764188
std::unique_ptr<FillWithPerimeter> filler_dense = std::make_unique<FillWithPerimeter>((Fill::new_from_type(ipRectilinear)));
41774189
filler_dense->overlap = m_support_params.gap_xy == 0 ? 0 : 1;
41784190
filler_dense->ratio_fill_inside = 0.2f;
4179-
filler_interface->set_bounding_box(bbox_object);
4191+
filler_top_interface->set_bounding_box(bbox_object);
41804192
filler_support->set_bounding_box(bbox_object);
41814193

41824194
// Print the support base below the support columns, or the support base for the support columns plus the contacts.
@@ -4207,7 +4219,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
42074219
}
42084220
}
42094221

4210-
Fill *filler = filler_interface.get();
4222+
Fill *filler = filler_top_interface.get();
42114223
Flow flow = m_support_params.first_layer_flow;
42124224
float density = 0.f;
42134225
double spacing = 0.f;
@@ -4283,7 +4295,8 @@ void PrintObjectSupportMaterial::generate_toolpaths(
42834295
size_t idx_layer_intermediate = size_t(-1);
42844296
size_t idx_layer_interface = size_t(-1);
42854297
size_t idx_layer_base_interface = size_t(-1);
4286-
std::unique_ptr<Fill> filler_interface = std::unique_ptr<Fill>(Fill::new_from_type(m_support_params.contact_fill_pattern));
4298+
std::unique_ptr<Fill> filler_top_interface = std::unique_ptr<Fill>(Fill::new_from_type(m_support_params.contact_top_fill_pattern));
4299+
std::unique_ptr<Fill> filler_bottom_interface = std::unique_ptr<Fill>(Fill::new_from_type(m_support_params.contact_bottom_fill_pattern));
42874300
std::unique_ptr<Fill> filler_intermediate_interface = std::unique_ptr<Fill>(Fill::new_from_type(ipRectilinear));
42884301
// Filler for the base interface (to be used for soluble interface / non soluble base, to produce non soluble interface layer below soluble interface layer).
42894302
std::unique_ptr<Fill> filler_base_interface = std::unique_ptr<Fill>(base_interface_layers.empty() ? nullptr :
@@ -4296,7 +4309,8 @@ void PrintObjectSupportMaterial::generate_toolpaths(
42964309
} else {
42974310
filler_support.reset(Fill::new_from_type(m_support_params.base_fill_pattern));
42984311
}
4299-
filler_interface->set_bounding_box(bbox_object);
4312+
filler_top_interface->set_bounding_box(bbox_object);
4313+
filler_bottom_interface->set_bounding_box(bbox_object);
43004314
filler_intermediate_interface->set_bounding_box(bbox_object);
43014315
if (range.begin() == 0)
43024316
filler_first_layer_ptr->set_bounding_box(bbox_object);
@@ -4399,7 +4413,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
43994413
Flow interface_flow = layer_ex.layer->bridging ?
44004414
Flow::bridging_flow(layer_ex.layer->height, m_support_params.support_material_bottom_interface_flow.nozzle_diameter()) :
44014415
(interface_as_base ? &m_support_params.support_material_flow : &m_support_params.support_material_interface_flow)->with_height(float(layer_ex.layer->height));
4402-
Fill *filler = i == 2 ? filler_intermediate_interface.get() : filler_interface.get();
4416+
Fill *filler = (i == 0) ? filler_top_interface.get() : (i == 1 ? filler_bottom_interface.get() : filler_intermediate_interface.get());
44034417
//filler->layer_id = support_layer_id; // don't do that, or the filler will rotate thigns from that layerid
44044418
filler->z = support_layer.print_z;
44054419
float supp_density = m_support_params.interface_density;

src/libslic3r/SupportMaterial.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ class PrintObjectSupportMaterial
149149

150150
InfillPattern base_fill_pattern;
151151
InfillPattern interface_fill_pattern;
152-
InfillPattern contact_fill_pattern;
152+
InfillPattern contact_top_fill_pattern;
153+
InfillPattern contact_bottom_fill_pattern;
153154
bool with_sheath;
154155
};
155156

0 commit comments

Comments
 (0)