From 61d52c889e5de24a7664d3f4fbbf12be47d57685 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Fri, 11 Apr 2025 09:27:27 +0800 Subject: [PATCH] ENH: locked-zag for shoes Jira: 11796 11798 11799 Signed-off-by: qing.zhang Change-Id: I0402cc8e25cb680a79d52957f9a0c7deb2321624 --- resources/profiles/BBL.json | 4 +- .../BBL/process/0.20mm Strength @BBL A1.json | 2 + .../BBL/process/0.20mm Strength @BBL P1P.json | 2 + .../BBL/process/0.20mm Strength @BBL X1C.json | 2 + .../0.30mm Strength @BBL A1 0.6 nozzle.json | 2 + .../0.30mm Strength @BBL P1P 0.6 nozzle.json | 2 + .../0.30mm Strength @BBL X1C 0.6 nozzle.json | 2 + .../BBL/process/fdm_process_common.json | 6 + .../fdm_process_dual_0.06_nozzle_0.2.json | 2 + .../fdm_process_dual_0.08_nozzle_0.2.json | 2 + .../fdm_process_dual_0.10_nozzle_0.2.json | 2 + .../fdm_process_dual_0.12_nozzle_0.2.json | 2 + .../fdm_process_dual_0.14_nozzle_0.2.json | 2 + .../fdm_process_dual_0.18_nozzle_0.6.json | 2 + .../fdm_process_dual_0.24_nozzle_0.6.json | 2 + .../fdm_process_dual_0.24_nozzle_0.8.json | 2 + .../fdm_process_dual_0.30_nozzle_0.6.json | 2 + .../fdm_process_dual_0.32_nozzle_0.8.json | 2 + .../fdm_process_dual_0.36_nozzle_0.6.json | 2 + .../fdm_process_dual_0.40_nozzle_0.8.json | 2 + .../fdm_process_dual_0.42_nozzle_0.6.json | 2 + .../fdm_process_dual_0.48_nozzle_0.8.json | 2 + .../fdm_process_dual_0.56_nozzle_0.8.json | 2 + .../fdm_process_single_0.06_nozzle_0.2.json | 2 + .../fdm_process_single_0.08_nozzle_0.2.json | 2 + .../fdm_process_single_0.10_nozzle_0.2.json | 2 + .../fdm_process_single_0.12_nozzle_0.2.json | 2 + .../fdm_process_single_0.14_nozzle_0.2.json | 2 + .../fdm_process_single_0.18_nozzle_0.6.json | 2 + .../fdm_process_single_0.24_nozzle_0.6.json | 2 + .../fdm_process_single_0.24_nozzle_0.8.json | 2 + .../fdm_process_single_0.30_nozzle_0.6.json | 2 + .../fdm_process_single_0.32_nozzle_0.8.json | 2 + .../fdm_process_single_0.36_nozzle_0.6.json | 2 + .../fdm_process_single_0.40_nozzle_0.8.json | 2 + .../fdm_process_single_0.42_nozzle_0.6.json | 2 + .../fdm_process_single_0.48_nozzle_0.8.json | 2 + .../fdm_process_single_0.56_nozzle_0.8.json | 2 + src/libslic3r/Fill/Fill.cpp | 90 +++++++++++--- src/libslic3r/Fill/FillBase.cpp | 1 + src/libslic3r/Fill/FillBase.hpp | 16 ++- src/libslic3r/Fill/FillRectilinear.cpp | 116 ++++++++++++++++++ src/libslic3r/Fill/FillRectilinear.hpp | 15 +++ src/libslic3r/Flow.hpp | 7 ++ src/libslic3r/Preset.cpp | 11 +- src/libslic3r/Print.cpp | 2 +- src/libslic3r/PrintConfig.cpp | 71 ++++++++++- src/libslic3r/PrintConfig.hpp | 8 +- src/libslic3r/PrintObject.cpp | 8 +- src/slic3r/GUI/ConfigManipulation.cpp | 22 +++- src/slic3r/GUI/Tab.cpp | 22 ++++ 51 files changed, 438 insertions(+), 33 deletions(-) diff --git a/resources/profiles/BBL.json b/resources/profiles/BBL.json index 380cc3778..9fac9c1a2 100644 --- a/resources/profiles/BBL.json +++ b/resources/profiles/BBL.json @@ -1,7 +1,7 @@ { "name": "Bambulab", "url": "http://www.bambulab.com/Parameters/vendor/BBL.json", - "version": "02.00.01.05", + "version": "02.00.01.06", "force_update": "0", "description": "the initial version of BBL configurations", "machine_model_list": [ @@ -4256,4 +4256,4 @@ "sub_path": "machine/Bambu Lab H2D 0.8 nozzle.json" } ] -} \ No newline at end of file +} diff --git a/resources/profiles/BBL/process/0.20mm Strength @BBL A1.json b/resources/profiles/BBL/process/0.20mm Strength @BBL A1.json index a8e43fa16..4be40d2de 100644 --- a/resources/profiles/BBL/process/0.20mm Strength @BBL A1.json +++ b/resources/profiles/BBL/process/0.20mm Strength @BBL A1.json @@ -14,6 +14,8 @@ "60" ], "sparse_infill_density": "25%", + "skeleton_infill_density": "25%", + "skin_infill_density": "25%", "travel_speed": [ "700" ], diff --git a/resources/profiles/BBL/process/0.20mm Strength @BBL P1P.json b/resources/profiles/BBL/process/0.20mm Strength @BBL P1P.json index f9da24d3b..d4bde0846 100644 --- a/resources/profiles/BBL/process/0.20mm Strength @BBL P1P.json +++ b/resources/profiles/BBL/process/0.20mm Strength @BBL P1P.json @@ -10,6 +10,8 @@ "60" ], "sparse_infill_density": "25%", + "skeleton_infill_density": "25%", + "skin_infill_density": "25%", "wall_loops": "6", "compatible_printers": [ "Bambu Lab P1P 0.4 nozzle" diff --git a/resources/profiles/BBL/process/0.20mm Strength @BBL X1C.json b/resources/profiles/BBL/process/0.20mm Strength @BBL X1C.json index 0b2cdd940..010f783a5 100644 --- a/resources/profiles/BBL/process/0.20mm Strength @BBL X1C.json +++ b/resources/profiles/BBL/process/0.20mm Strength @BBL X1C.json @@ -11,6 +11,8 @@ ], "smooth_coefficient": "150", "sparse_infill_density": "25%", + "skeleton_infill_density": "25%", + "skin_infill_density": "25%", "wall_loops": "6", "compatible_printers": [ "Bambu Lab X1 Carbon 0.4 nozzle", diff --git a/resources/profiles/BBL/process/0.30mm Strength @BBL A1 0.6 nozzle.json b/resources/profiles/BBL/process/0.30mm Strength @BBL A1 0.6 nozzle.json index 6e357ebaf..0c3818df5 100644 --- a/resources/profiles/BBL/process/0.30mm Strength @BBL A1 0.6 nozzle.json +++ b/resources/profiles/BBL/process/0.30mm Strength @BBL A1 0.6 nozzle.json @@ -11,6 +11,8 @@ ], "elefant_foot_compensation": "0.075", "sparse_infill_density": "25%", + "skeleton_infill_density": "25%", + "skin_infill_density": "25%", "travel_speed": [ "700" ], diff --git a/resources/profiles/BBL/process/0.30mm Strength @BBL P1P 0.6 nozzle.json b/resources/profiles/BBL/process/0.30mm Strength @BBL P1P 0.6 nozzle.json index 8a711ba4a..d7b714433 100644 --- a/resources/profiles/BBL/process/0.30mm Strength @BBL P1P 0.6 nozzle.json +++ b/resources/profiles/BBL/process/0.30mm Strength @BBL P1P 0.6 nozzle.json @@ -8,6 +8,8 @@ "description": "Compared with the default profile of a 0.6 mm nozzle, it has more wall loops and a higher sparse infill density. So, it results in higher strength of the prints, but more filament consumption and longer printing time.", "elefant_foot_compensation": "0.15", "sparse_infill_density": "25%", + "skeleton_infill_density": "25%", + "skin_infill_density": "25%", "wall_loops": "4", "compatible_printers": [ "Bambu Lab P1P 0.6 nozzle" diff --git a/resources/profiles/BBL/process/0.30mm Strength @BBL X1C 0.6 nozzle.json b/resources/profiles/BBL/process/0.30mm Strength @BBL X1C 0.6 nozzle.json index e41231bc4..d7d419c91 100644 --- a/resources/profiles/BBL/process/0.30mm Strength @BBL X1C 0.6 nozzle.json +++ b/resources/profiles/BBL/process/0.30mm Strength @BBL X1C 0.6 nozzle.json @@ -8,6 +8,8 @@ "description": "Compared with the default profile of a 0.6 mm nozzle, it has more wall loops and a higher sparse infill density. So, it results in higher strength of the prints, but more filament consumption and longer printing time.", "elefant_foot_compensation": "0.15", "sparse_infill_density": "25%", + "skeleton_infill_density": "25%", + "skin_infill_density": "25%", "wall_loops": "4", "smooth_coefficient": "150", "compatible_printers": [ diff --git a/resources/profiles/BBL/process/fdm_process_common.json b/resources/profiles/BBL/process/fdm_process_common.json index 5b55ef946..95697f0e2 100644 --- a/resources/profiles/BBL/process/fdm_process_common.json +++ b/resources/profiles/BBL/process/fdm_process_common.json @@ -87,7 +87,13 @@ "skirt_loops": "0", "smooth_coefficient": "80", "sparse_infill_density": "15%", + "skeleton_infill_density": "15%", + "skin_infill_density": "15%", "sparse_infill_line_width": "0.45", + "skin_infill_line_width": "0.45", + "infill_lock_depth": "1.0", + "skin_infill_depth": "2.0", + "skeleton_infill_line_width": "0.45", "sparse_infill_pattern": "grid", "sparse_infill_speed": [ "50" diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.06_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_dual_0.06_nozzle_0.2.json index e61e3490a..ff52b1b03 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.06_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.06_nozzle_0.2.json @@ -29,6 +29,8 @@ "line_width": "0.22", "outer_wall_line_width": "0.22", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.08_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_dual_0.08_nozzle_0.2.json index 1dfb174f9..86b63fc5c 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.08_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.08_nozzle_0.2.json @@ -29,6 +29,8 @@ "line_width": "0.22", "outer_wall_line_width": "0.22", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.10_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_dual_0.10_nozzle_0.2.json index bf5c74fa2..652c20abf 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.10_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.10_nozzle_0.2.json @@ -29,6 +29,8 @@ "line_width": "0.22", "outer_wall_line_width": "0.22", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.12_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_dual_0.12_nozzle_0.2.json index d128b79e3..4e3aeb345 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.12_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.12_nozzle_0.2.json @@ -29,6 +29,8 @@ "line_width": "0.22", "outer_wall_line_width": "0.22", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.14_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_dual_0.14_nozzle_0.2.json index f9c17ac0c..69f3e5676 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.14_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.14_nozzle_0.2.json @@ -29,6 +29,8 @@ "line_width": "0.22", "outer_wall_line_width": "0.22", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.18_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_dual_0.18_nozzle_0.6.json index 91c2adddb..72aab665b 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.18_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.18_nozzle_0.6.json @@ -39,6 +39,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.24_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_dual_0.24_nozzle_0.6.json index 33a75846b..623e9ec70 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.24_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.24_nozzle_0.6.json @@ -39,6 +39,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.24_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_dual_0.24_nozzle_0.8.json index 605c9fccb..73ebd6a07 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.24_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.24_nozzle_0.8.json @@ -45,6 +45,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.30_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_dual_0.30_nozzle_0.6.json index c6e04962d..e6f3c4eef 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.30_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.30_nozzle_0.6.json @@ -39,6 +39,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.32_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_dual_0.32_nozzle_0.8.json index 676969cf0..1539bd5c7 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.32_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.32_nozzle_0.8.json @@ -45,6 +45,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.36_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_dual_0.36_nozzle_0.6.json index f374f31a0..878731d21 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.36_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.36_nozzle_0.6.json @@ -39,6 +39,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.40_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_dual_0.40_nozzle_0.8.json index 275639f00..3efdcfd2f 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.40_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.40_nozzle_0.8.json @@ -45,6 +45,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.42_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_dual_0.42_nozzle_0.6.json index c64e78852..2327322f8 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.42_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.42_nozzle_0.6.json @@ -39,6 +39,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.48_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_dual_0.48_nozzle_0.8.json index d53bbbe18..aa317a023 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.48_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.48_nozzle_0.8.json @@ -45,6 +45,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_dual_0.56_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_dual_0.56_nozzle_0.8.json index cc5400781..f3d9cb460 100644 --- a/resources/profiles/BBL/process/fdm_process_dual_0.56_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_dual_0.56_nozzle_0.8.json @@ -45,6 +45,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100", "100", diff --git a/resources/profiles/BBL/process/fdm_process_single_0.06_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_single_0.06_nozzle_0.2.json index 10b2b5b5a..c039f2d02 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.06_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.06_nozzle_0.2.json @@ -22,6 +22,8 @@ "outer_wall_line_width": "0.22", "ironing_inset": "0.11", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.08_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_single_0.08_nozzle_0.2.json index 8d69b735e..548446a48 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.08_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.08_nozzle_0.2.json @@ -22,6 +22,8 @@ "outer_wall_line_width": "0.22", "ironing_inset": "0.11", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.10_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_single_0.10_nozzle_0.2.json index 93993b0ee..f1250a3b8 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.10_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.10_nozzle_0.2.json @@ -22,6 +22,8 @@ "outer_wall_line_width": "0.22", "ironing_inset": "0.11", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.12_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_single_0.12_nozzle_0.2.json index 866b9eaea..304a87008 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.12_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.12_nozzle_0.2.json @@ -22,6 +22,8 @@ "outer_wall_line_width": "0.22", "ironing_inset": "0.11", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.14_nozzle_0.2.json b/resources/profiles/BBL/process/fdm_process_single_0.14_nozzle_0.2.json index 32f1efc55..eac4af62a 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.14_nozzle_0.2.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.14_nozzle_0.2.json @@ -22,6 +22,8 @@ "outer_wall_line_width": "0.22", "ironing_inset": "0.11", "sparse_infill_line_width": "0.22", + "skin_infill_line_width": "0.22", + "skeleton_infill_line_width": "0.22", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.18_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_single_0.18_nozzle_0.6.json index 81979b7a0..b5b35ba15 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.18_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.18_nozzle_0.6.json @@ -26,6 +26,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.24_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_single_0.24_nozzle_0.6.json index 20a96ce19..84153d08c 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.24_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.24_nozzle_0.6.json @@ -26,6 +26,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.24_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_single_0.24_nozzle_0.8.json index f748b9fc6..a6631b28f 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.24_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.24_nozzle_0.8.json @@ -29,6 +29,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.30_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_single_0.30_nozzle_0.6.json index 7006984d1..e7f733824 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.30_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.30_nozzle_0.6.json @@ -26,6 +26,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.32_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_single_0.32_nozzle_0.8.json index de5731940..913259de8 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.32_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.32_nozzle_0.8.json @@ -29,6 +29,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.36_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_single_0.36_nozzle_0.6.json index 7981a0189..6309867c4 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.36_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.36_nozzle_0.6.json @@ -26,6 +26,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.40_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_single_0.40_nozzle_0.8.json index 0c64b4ce9..35e6e21da 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.40_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.40_nozzle_0.8.json @@ -29,6 +29,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.42_nozzle_0.6.json b/resources/profiles/BBL/process/fdm_process_single_0.42_nozzle_0.6.json index b6371e127..1afb7a209 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.42_nozzle_0.6.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.42_nozzle_0.6.json @@ -26,6 +26,8 @@ "15" ], "sparse_infill_line_width": "0.62", + "skin_infill_line_width": "0.62", + "skeleton_infill_line_width": "0.62", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.48_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_single_0.48_nozzle_0.8.json index c864cef5d..a68231804 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.48_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.48_nozzle_0.8.json @@ -29,6 +29,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100" ], diff --git a/resources/profiles/BBL/process/fdm_process_single_0.56_nozzle_0.8.json b/resources/profiles/BBL/process/fdm_process_single_0.56_nozzle_0.8.json index f2573d7c1..e94ba4893 100644 --- a/resources/profiles/BBL/process/fdm_process_single_0.56_nozzle_0.8.json +++ b/resources/profiles/BBL/process/fdm_process_single_0.56_nozzle_0.8.json @@ -29,6 +29,8 @@ "5" ], "sparse_infill_line_width": "0.82", + "skin_infill_line_width": "0.82", + "skeleton_infill_line_width": "0.82", "sparse_infill_speed": [ "100" ], diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index 3aded3c7e..48983e4a7 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -65,7 +65,8 @@ struct SurfaceFillParams float solid_infill_speed = 0; float infill_shift_step = 0;// param for cross zag float infill_rotate_step = 0; // param for zig zag to get cross texture - + float infill_lock_depth = 0; + float skin_infill_depth = 0; bool symmetric_infill_y_axis = false; bool operator<(const SurfaceFillParams &rhs) const { @@ -95,8 +96,9 @@ struct SurfaceFillParams RETURN_COMPARE_NON_EQUAL(solid_infill_speed); RETURN_COMPARE_NON_EQUAL(infill_shift_step); RETURN_COMPARE_NON_EQUAL(infill_rotate_step); - RETURN_COMPARE_NON_EQUAL(symmetric_infill_y_axis); - + RETURN_COMPARE_NON_EQUAL(symmetric_infill_y_axis); + RETURN_COMPARE_NON_EQUAL(infill_lock_depth); + RETURN_COMPARE_NON_EQUAL(skin_infill_depth); return false; } @@ -119,7 +121,9 @@ struct SurfaceFillParams this->solid_infill_speed == rhs.solid_infill_speed && this->infill_shift_step == rhs.infill_shift_step && this->infill_rotate_step == rhs.infill_rotate_step && - this->symmetric_infill_y_axis == rhs.symmetric_infill_y_axis; + this->symmetric_infill_y_axis == rhs.symmetric_infill_y_axis && + this->infill_lock_depth == rhs.infill_lock_depth && + this->skin_infill_depth == rhs.skin_infill_depth; } }; @@ -145,16 +149,34 @@ static bool is_narrow_infill_area(const ExPolygon& expolygon) return false; } -std::vector group_fills(const Layer &layer) +std::vector group_fills(const Layer &layer, LockRegionParam &lock_param) { std::vector surface_fills; - // Fill in a map of a region & surface to SurfaceFillParams. std::set set_surface_params; std::vector> region_to_surface_params(layer.regions().size(), std::vector()); SurfaceFillParams params; bool has_internal_voids = false; const PrintObjectConfig& object_config = layer.object()->config(); + + auto append_flow_param = [](std::map &flow_params, Flow flow, const ExPolygon &exp) { + auto it = flow_params.find(flow); + if (it == flow_params.end()) + flow_params.insert({flow, {exp}}); + else + it->second.push_back(exp); + it++; + }; + + auto append_density_param = [](std::map &density_params, float density, const ExPolygon &exp) { + auto it = density_params.find(density); + if (it == density_params.end()) + density_params.insert({density, {exp}}); + else + it->second.push_back(exp); + it++; + }; + for (size_t region_id = 0; region_id < layer.regions().size(); ++ region_id) { const LayerRegion &layerm = *layer.regions()[region_id]; region_to_surface_params[region_id].assign(layerm.fill_surfaces.size(), nullptr); @@ -168,7 +190,12 @@ std::vector group_fills(const Layer &layer) params.extruder = layerm.region().extruder(extrusion_role); params.pattern = region_config.sparse_infill_pattern.value; params.density = float(region_config.sparse_infill_density); - if (params.pattern == ipCrossZag){ + if (params.pattern == ipLockedZag) { + params.infill_lock_depth = scale_(region_config.infill_lock_depth); + params.skin_infill_depth = scale_(region_config.skin_infill_depth); + + } + if (params.pattern == ipCrossZag || params.pattern == ipLockedZag){ params.infill_shift_step = scale_(region_config.infill_shift_step); params.symmetric_infill_y_axis = region_config.symmetric_infill_y_axis; }else if (params.pattern == ipZigZag){ @@ -237,7 +264,28 @@ std::vector group_fills(const Layer &layer) params.anchor_length = std::min(params.anchor_length, params.anchor_length_max); } - auto it_params = set_surface_params.find(params); + //get locked region param + if (params.pattern == ipLockedZag){ + const PrintObject *object = layerm.layer()->object(); + auto nozzle_diameter = float(object->print()->config().nozzle_diameter.get_at(layerm.region().extruder(extrusion_role) - 1)); + Flow skin_flow = params.bridge ? params.flow : Flow::new_from_config_width(extrusion_role, region_config.skin_infill_line_width, nozzle_diameter, float((surface.thickness == -1) ? layer.height : surface.thickness)); + //add skin flow + append_flow_param(lock_param.skin_flow_params, skin_flow, surface.expolygon); + + Flow skeleton_flow = params.bridge ? params.flow : Flow::new_from_config_width(extrusion_role, region_config.skeleton_infill_line_width, nozzle_diameter, float((surface.thickness == -1) ? layer.height : surface.thickness)) ; + // add skeleton flow + append_flow_param(lock_param.skeleton_flow_params, skeleton_flow, surface.expolygon); + + // add skin density + append_density_param(lock_param.skin_density_params, float(0.01 * region_config.skin_infill_density), surface.expolygon); + + // add skin density + append_density_param(lock_param.skeleton_density_params, float(0.01 * region_config.skeleton_infill_density), surface.expolygon); + + } + + auto it_params = set_surface_params.find(params); + if (it_params == set_surface_params.end()) it_params = set_surface_params.insert(it_params, params); region_to_surface_params[region_id][&surface - &layerm.fill_surfaces.surfaces.front()] = &(*it_params); @@ -494,8 +542,8 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: #ifdef SLIC3R_DEBUG_SLICE_PROCESSING // this->export_region_fill_surfaces_to_svg_debug("10_fill-initial"); #endif /* SLIC3R_DEBUG_SLICE_PROCESSING */ - - std::vector surface_fills = group_fills(*this); + LockRegionParam lock_param; + std::vector surface_fills = group_fills(*this, lock_param); const Slic3r::BoundingBox bbox = this->object()->bounding_box(); const auto resolution = this->object()->print()->config().resolution.value; @@ -549,8 +597,8 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: lower_unsuporrt_expolys = union_ex(lower_unsuporrt_expolys, sexpolys); } lower_unsuporrt_expolys = shrink_ex(lower_unsuporrt_expolys, SCALED_EPSILON); - - std::vector lower_fills = group_fills(*lower_layer); + LockRegionParam temp_skin_inner_param; + std::vector lower_fills = group_fills(*lower_layer, temp_skin_inner_param); bool detect_lower_sparse_lines = true; for (auto& fill : lower_fills) { if (fill.params.pattern == ipAdaptiveCubic || fill.params.pattern == ipLightning || fill.params.pattern == ipSupportCubic) { @@ -606,7 +654,13 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: params.extrusion_role = surface_fill.params.extrusion_role; params.using_internal_flow = using_internal_flow; params.no_extrusion_overlap = surface_fill.params.overlap; - if (surface_fill.params.pattern == ipCrossZag) { + if( surface_fill.params.pattern == ipLockedZag ) { + params.locked_zag = true; + params.infill_lock_depth = surface_fill.params.infill_lock_depth; + params.skin_infill_depth = surface_fill.params.skin_infill_depth; + f->set_lock_region_param(lock_param); + } + if (surface_fill.params.pattern == ipCrossZag || surface_fill.params.pattern == ipLockedZag) { if (f->layer_id % 2 == 0) { params.horiz_move -= surface_fill.params.infill_shift_step * (f->layer_id / 2); } else { @@ -634,9 +688,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: f->spacing = surface_fill.params.spacing; surface_fill.surface.expolygon = std::move(expoly); // BBS: make fill - f->fill_surface_extrusion(&surface_fill.surface, - params, - m_regions[surface_fill.region_id]->fills.entities); + f->fill_surface_extrusion(&surface_fill.surface, params, m_regions[surface_fill.region_id]->fills.entities); } } @@ -660,7 +712,8 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree, FillLightning::Generator* lightning_generator) const { - std::vector surface_fills = group_fills(*this); + LockRegionParam skin_inner_param; + std::vector surface_fills = group_fills(*this, skin_inner_param); const Slic3r::BoundingBox bbox = this->object()->bounding_box(); const auto resolution = this->object()->print()->config().resolution.value; @@ -694,7 +747,8 @@ Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Oc case ipArchimedeanChords: case ipOctagramSpiral: case ipZigZag: - case ipCrossZag: break; + case ipCrossZag: + case ipLockedZag: break; } // Create the filler object. diff --git a/src/libslic3r/Fill/FillBase.cpp b/src/libslic3r/Fill/FillBase.cpp index d0e8efb95..29926c191 100644 --- a/src/libslic3r/Fill/FillBase.cpp +++ b/src/libslic3r/Fill/FillBase.cpp @@ -60,6 +60,7 @@ Fill* Fill::new_from_type(const InfillPattern type) case ipZigZag: return new FillZigZag(); case ipCrossZag: return new FillCrossZag(); case ipFloatingConcentric: return new FillFloatingConcentric(); + case ipLockedZag: return new FillLockedZag(); default: throw Slic3r::InvalidArgument("unknown type"); } } diff --git a/src/libslic3r/Fill/FillBase.hpp b/src/libslic3r/Fill/FillBase.hpp index 103710cfb..2238febe7 100644 --- a/src/libslic3r/Fill/FillBase.hpp +++ b/src/libslic3r/Fill/FillBase.hpp @@ -35,6 +35,15 @@ public: InfillFailedException() : Slic3r::RuntimeError("Infill failed") {} }; +struct LockRegionParam +{ + LockRegionParam() {} + std::map skin_density_params; + std::map skeleton_density_params; + std::map skin_flow_params; + std::map skeleton_flow_params; +}; + struct FillParams { bool full_infill() const { return density > 0.9999f; } @@ -80,6 +89,9 @@ struct FillParams float horiz_move{0.0}; //move infill to get cross zag pattern bool symmetric_infill_y_axis{false}; coord_t symmetric_y_axis{0}; + bool locked_zag{false}; + float infill_lock_depth{0.0}; + float skin_infill_depth{0.0}; }; static_assert(IsTriviallyCopyable::value, "FillParams class is not POD (and it should be - see constructor)."); @@ -135,10 +147,10 @@ public: // Perform the fill. virtual Polylines fill_surface(const Surface *surface, const FillParams ¶ms); virtual ThickPolylines fill_surface_arachne(const Surface* surface, const FillParams& params); - + virtual void set_lock_region_param(const LockRegionParam &lock_param){}; // BBS: this method is used to fill the ExtrusionEntityCollection. // It call fill_surface by default - virtual void fill_surface_extrusion(const Surface* surface, const FillParams& params, ExtrusionEntitiesPtr& out); + virtual void fill_surface_extrusion(const Surface *surface, const FillParams ¶ms, ExtrusionEntitiesPtr &out); protected: Fill() : diff --git a/src/libslic3r/Fill/FillRectilinear.cpp b/src/libslic3r/Fill/FillRectilinear.cpp index 6473506e6..4218c81a3 100644 --- a/src/libslic3r/Fill/FillRectilinear.cpp +++ b/src/libslic3r/Fill/FillRectilinear.cpp @@ -2833,6 +2833,8 @@ bool FillRectilinear::fill_surface_by_lines(const Surface *surface, const FillPa // Rotate polygons so that we can work with vertical lines here std::pair rotate_vector = this->_infill_direction(surface); + if (params.locked_zag) + rotate_vector.first += float(M_PI/2.); rotate_vector.first += angleBase; assert(params.density > 0.0001f && params.density <= 1.f); @@ -3372,5 +3374,119 @@ void FillMonotonicLineWGapFill::fill_surface_by_lines(const Surface* surface, co } } +void FillLockedZag::fill_surface_locked_zag (const Surface * surface, + const FillParams & params, + std::vector> &multi_width_polyline) +{ + // merge different part exps + // diff skin flow + Polylines skin_lines; + Polylines skeloton_lines; + double offset_threshold = params.skin_infill_depth; + double overlap_threshold = params.infill_lock_depth; + Surface cross_surface = *surface; + Surface zig_surface = *surface; + // inner exps + // inner union exps + ExPolygons zig_expas = offset_ex({surface->expolygon}, -offset_threshold); + ExPolygons cross_expas = diff_ex(surface->expolygon, zig_expas); + + bool zig_get = false; + FillParams zig_params = params; + zig_params.horiz_move = 0; + // generate skeleton for diff density + auto generate_for_different_flow = [&multi_width_polyline](const std::map &flow_params, const Polylines &polylines) { + auto it = flow_params.begin(); + while (it != flow_params.end()) { + ExPolygons region_exp = union_safety_offset_ex(it->second); + + Polylines polys = intersection_pl(polylines, region_exp); + multi_width_polyline.emplace_back(polys, it->first); + it++; + } + }; + + auto it = this->lock_param.skeleton_density_params.begin(); + while (it != this->lock_param.skeleton_density_params.end()) { + ExPolygons region_exp = union_safety_offset_ex(it->second); + ExPolygons exps = intersection_ex(region_exp, zig_expas); + zig_params.density = it->first; + exps = intersection_ex(offset_ex(exps, overlap_threshold), surface->expolygon); + for (ExPolygon &exp : exps) { + zig_surface.expolygon = exp; + + Polylines zig_polylines_out = this->fill_surface(&zig_surface, zig_params); + skeloton_lines.insert(skeloton_lines.end(), zig_polylines_out.begin(), zig_polylines_out.end()); + } + it++; + } + + // set skeleton flow + generate_for_different_flow(this->lock_param.skeleton_flow_params, skeloton_lines); + + // skin exps + bool cross_get = false; + FillParams cross_params = params; + cross_params.locked_zag = false; + auto skin_density = this->lock_param.skin_density_params.begin(); + while (skin_density != this->lock_param.skin_density_params.end()) { + ExPolygons region_exp = union_safety_offset_ex(skin_density->second); + ExPolygons exps = intersection_ex(region_exp, cross_expas); + cross_params.density = skin_density->first; + for (ExPolygon &exp : exps) { + cross_surface.expolygon = exp; + Polylines cross_polylines_out = this->fill_surface(&cross_surface, cross_params); + skin_lines.insert(skin_lines.end(), cross_polylines_out.begin(), cross_polylines_out.end()); + } + skin_density++; + } + + generate_for_different_flow(this->lock_param.skin_flow_params, skin_lines); +} + +void FillLockedZag::fill_surface_extrusion(const Surface *surface, const FillParams ¶ms, ExtrusionEntitiesPtr &out) +{ + Polylines polylines; + ThickPolylines thick_polylines; + std::vector> multi_width_polyline; + try { + this->fill_surface_locked_zag(surface, params, multi_width_polyline); + } + catch (InfillFailedException&) {} + + if (!thick_polylines.empty() || !multi_width_polyline.empty()) { + // Save into layer. + ExtrusionEntityCollection* eec = nullptr; + out.push_back(eec = new ExtrusionEntityCollection()); + // Only concentric fills are not sorted. + eec->no_sort = this->no_sort(); + size_t idx = eec->entities.size(); + { + for (std::pair &poly_with_flow: multi_width_polyline) { + // calculate actual flow from spacing (which might have been adjusted by the infill + // pattern generator) + double flow_mm3_per_mm = poly_with_flow.second.mm3_per_mm(); + double flow_width = poly_with_flow.second.width(); + if (params.using_internal_flow) { + // if we used the internal flow we're not doing a solid infill + // so we can safely ignore the slight variation that might have + // been applied to f->spacing + } else { + Flow new_flow = poly_with_flow.second.with_spacing(this->spacing); + flow_mm3_per_mm = new_flow.mm3_per_mm(); + flow_width = new_flow.width(); + } + extrusion_entities_append_paths( + eec->entities, std::move(poly_with_flow.first), + params.extrusion_role, + flow_mm3_per_mm, float(flow_width), poly_with_flow.second.height()); + } + } + if (!params.can_reverse) { + for (size_t i = idx; i < eec->entities.size(); i++) + eec->entities[i]->set_reverse(); + } + } +} } // namespace Slic3r diff --git a/src/libslic3r/Fill/FillRectilinear.hpp b/src/libslic3r/Fill/FillRectilinear.hpp index c7d6da974..69aef8b21 100644 --- a/src/libslic3r/Fill/FillRectilinear.hpp +++ b/src/libslic3r/Fill/FillRectilinear.hpp @@ -159,6 +159,21 @@ public: bool has_consistent_pattern() const override { return true; } }; +class FillLockedZag : public FillRectilinear +{ +public: + Fill *clone() const override { return new FillLockedZag(*this); } + ~FillLockedZag() override = default; + LockRegionParam lock_param; + + void fill_surface_extrusion(const Surface *surface, const FillParams ¶ms, ExtrusionEntitiesPtr &out) override; + + bool has_consistent_pattern() const override { return true; } + void set_lock_region_param(const LockRegionParam &lock_param) override { this->lock_param = lock_param;}; + void fill_surface_locked_zag(const Surface * surface, + const FillParams & params, + std::vector> &multi_width_polyline); +}; Points sample_grid_pattern(const ExPolygon &expolygon, coord_t spacing, const BoundingBox &global_bounding_box); Points sample_grid_pattern(const ExPolygons &expolygons, coord_t spacing, const BoundingBox &global_bounding_box); diff --git a/src/libslic3r/Flow.hpp b/src/libslic3r/Flow.hpp index 64c0532dd..13bf224b5 100644 --- a/src/libslic3r/Flow.hpp +++ b/src/libslic3r/Flow.hpp @@ -81,6 +81,13 @@ public: bool operator==(const Flow &rhs) const { return m_width == rhs.m_width && m_height == rhs.m_height && m_nozzle_diameter == rhs.m_nozzle_diameter && m_bridge == rhs.m_bridge; } + bool operator!=(const Flow &rhs) const{ + return m_width != rhs.m_width || m_height != rhs.m_height || m_nozzle_diameter != rhs.m_nozzle_diameter || m_bridge != rhs.m_bridge; + } + + bool operator <(const Flow &rhs) const { + return this->mm3_per_mm() < rhs.mm3_per_mm(); + } Flow with_width (float width) const { assert(! m_bridge); return Flow(width, m_height, rounded_rectangle_extrusion_spacing(width, m_height), m_nozzle_diameter, m_bridge); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index ec2a136ce..1c58f80d7 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -848,8 +848,10 @@ static std::vector s_Preset_print_options { "top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness", "ensure_vertical_shell_thickness", "reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall", "top_color_penetration_layers", "bottom_color_penetration_layers", "smooth_speed_discontinuity_area","smooth_coefficient", - "seam_position", "wall_sequence", "is_infill_first", "sparse_infill_density", "sparse_infill_pattern", "sparse_infill_anchor", "sparse_infill_anchor_max", - "top_surface_pattern", "bottom_surface_pattern", "internal_solid_infill_pattern", "infill_direction", "bridge_angle","infill_shift_step", "infill_rotate_step", "symmetric_infill_y_axis", + "seam_position", "wall_sequence", "is_infill_first", "sparse_infill_density", "sparse_infill_pattern", "sparse_infill_anchor", "sparse_infill_anchor_max", "top_surface_pattern", + "bottom_surface_pattern", "internal_solid_infill_pattern", "infill_direction", "bridge_angle", "infill_shift_step", "skeleton_infill_density", "infill_lock_depth", "skin_infill_depth", "skin_infill_density", + "infill_rotate_step", + "symmetric_infill_y_axis", "minimum_sparse_infill_area", "reduce_infill_retraction", "ironing_pattern", "ironing_type", "ironing_flow", "ironing_speed", "ironing_spacing","ironing_direction", "ironing_inset", "max_travel_detour_distance", @@ -875,8 +877,9 @@ static std::vector s_Preset_print_options { "bridge_no_support", "thick_bridges", "max_bridge_length", "print_sequence", "filename_format", "wall_filament", "support_bottom_z_distance", "sparse_infill_filament", "solid_infill_filament", "support_filament", "support_interface_filament","support_interface_not_for_body", - "ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width", - "inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", + "ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width", "inner_wall_line_width", + "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", + "skin_infill_line_width","skeleton_infill_line_width", "top_surface_line_width", "support_line_width", "infill_wall_overlap", "bridge_flow", "elefant_foot_compensation", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower", "prime_tower_enable_framework", "prime_tower_width", "prime_tower_brim_width", "prime_tower_skip_points","prime_tower_max_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 3948856c1..5104f0959 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1402,7 +1402,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* if (!validate_extrusion_width(object->config(), "support_line_width", layer_height, err_msg)) return {err_msg, object, "support_line_width"}; } - for (const char *opt_key : { "inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", "top_surface_line_width" }) + for (const char *opt_key : { "inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", "top_surface_line_width","skin_infill_line_width" ,"skeleton_infill_line_width"}) for (const PrintRegion ®ion : object->all_regions()) if (!validate_extrusion_width(region.config(), opt_key, layer_height, err_msg)) return {err_msg, object, opt_key}; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 2e343e135..61a8b532c 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -157,7 +157,8 @@ static t_config_enum_values s_keys_map_InfillPattern { { "lightning", ipLightning }, { "crosshatch", ipCrossHatch}, { "zigzag", ipZigZag }, - { "crosszag", ipCrossZag } + { "crosszag", ipCrossZag }, + { "lockedzag", ipLockedZag } }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(InfillPattern) @@ -2083,6 +2084,7 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("crosshatch"); def->enum_values.push_back("zigzag"); def->enum_values.push_back("crosszag"); + def->enum_values.push_back("lockedzag"); def->enum_labels.push_back(L("Concentric")); def->enum_labels.push_back(L("Rectilinear")); def->enum_labels.push_back(L("Grid")); @@ -2103,6 +2105,7 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back(L("Cross Hatch")); def->enum_labels.push_back(L("Zig Zag")); def->enum_labels.push_back(L("Cross Zag")); + def->enum_labels.push_back(L("Locked Zag")); def->set_default_value(new ConfigOptionEnum(ipCubic)); def = this->add("top_surface_acceleration", coFloats); @@ -2521,6 +2524,68 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("skeleton_infill_density", coPercent); + def->label = L("Skeleton infill density"); + def->category = L("Strength"); + def->tooltip = L("The remaining part of the model contour after removing a certain depth from the surface is called the skeleton. This parameter is used to adjust the density of this section." + "When two regions have the same sparse infill settings but different skeleton densities, their skeleton areas will develop overlapping sections." + "default is as same as infill density."); + def->sidetext = "%"; + def->min = 0; + def->max = 100; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionPercent(15)); + + def = this->add("skin_infill_density", coPercent); + def->label = L("Skin infill density"); + def->category = L("Strength"); + def->tooltip = L("The portion of the model's outer surface within a certain depth range is called the skin. This parameter is used to adjust the density of this section." + "When two regions have the same sparse infill settings but different skin densities, This area will not be split into two separate regions." + "default is as same as infill density."); + def->sidetext = "%"; + def->min = 0; + def->max = 100; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionPercent(15)); + + def = this->add("skin_infill_depth", coFloat); + def->label = L("Skin infill depth"); + def->category = L("Strength"); + def->tooltip = L("The parameter sets the depth of skin."); + def->sidetext = L("mm"); + def->min = 0; + def->max = 100; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(2.0)); + + def = this->add("infill_lock_depth", coFloat); + def->label = L("Infill lock depth"); + def->category = L("Strength"); + def->tooltip = L("The parameter sets the overlapping depth between the interior and skin."); + def->sidetext = L("mm"); + def->min = 0; + def->max = 100; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(1.0)); + + def = this->add("skin_infill_line_width", coFloat); + def->label = L("Skin line width"); + def->category = L("Strength"); + def->tooltip = L("Adjust the line width of the selected skin paths."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.4)); + + def = this->add("skeleton_infill_line_width", coFloat); + def->label = L("Skeleton line width"); + def->category = L("Strength"); + def->tooltip = L("Adjust the line width of the selected skeleton paths."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.4)); + def = this->add("symmetric_infill_y_axis", coBool); def->label = L("Symmetric infill y axis"); def->category = L("Strength"); @@ -7391,7 +7456,9 @@ std::map validate(const FullPrintConfig &cfg, bool und "internal_solid_infill_line_width", "top_surface_line_width", "support_line_width", - "initial_layer_line_width" }; + "initial_layer_line_width", + "skin_infill_line_width", + "skeleton_infill_line_width"}; for (size_t i = 0; i < sizeof(widths) / sizeof(widths[i]); ++ i) { std::string key(widths[i]); if (cfg.get_abs_value(key) > 2.5 * max_nozzle_diameter) { diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 3ada3ff6a..7d644201b 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -54,7 +54,7 @@ enum AuthorizationType { enum InfillPattern : int { ipConcentric, ipRectilinear, ipGrid, ipLine, ipCubic, ipTriangles, ipStars, ipGyroid, ipHoneycomb, ipAdaptiveCubic, ipMonotonic, ipMonotonicLine, ipAlignedRectilinear, ip3DHoneycomb, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipSupportCubic, ipSupportBase, ipConcentricInternal, - ipLightning, ipCrossHatch, ipZigZag, ipCrossZag,ipFloatingConcentric, + ipLightning, ipCrossHatch, ipZigZag, ipCrossZag,ipFloatingConcentric, ipLockedZag, ipCount, }; @@ -909,7 +909,11 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, symmetric_infill_y_axis)) ((ConfigOptionFloat, infill_shift_step)) ((ConfigOptionFloat, infill_rotate_step)) + ((ConfigOptionPercent, skeleton_infill_density)) + ((ConfigOptionPercent, skin_infill_density)) ((ConfigOptionPercent, sparse_infill_density)) + ((ConfigOptionFloat, infill_lock_depth)) + ((ConfigOptionFloat, skin_infill_depth)) ((ConfigOptionEnum, sparse_infill_pattern)) ((ConfigOptionEnum, fuzzy_skin)) ((ConfigOptionFloat, fuzzy_skin_thickness)) @@ -917,6 +921,8 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloatsNullable, gap_infill_speed)) ((ConfigOptionInt, sparse_infill_filament)) ((ConfigOptionFloat, sparse_infill_line_width)) + ((ConfigOptionFloat, skin_infill_line_width)) + ((ConfigOptionFloat, skeleton_infill_line_width)) ((ConfigOptionPercent, infill_wall_overlap)) ((ConfigOptionFloatsNullable, sparse_infill_speed)) //BBS diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index c0cb096f3..c5e7b1eba 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1085,6 +1085,8 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "sparse_infill_filament" || opt_key == "solid_infill_filament" || opt_key == "sparse_infill_line_width" + || opt_key == "skin_infill_line_width" + || opt_key == "skeleton_infill_line_width" || opt_key == "infill_direction" || opt_key == "ensure_vertical_shell_thickness" || opt_key == "bridge_angle" @@ -1105,7 +1107,11 @@ bool PrintObject::invalidate_state_by_config_options( } else if (opt_key == "sparse_infill_pattern" || opt_key == "symmetric_infill_y_axis" || opt_key == "infill_shift_step" - || opt_key == "infill_rotate_step") { + || opt_key == "infill_rotate_step" + || opt_key == "skeleton_infill_density" + || opt_key == "skin_infill_density" + || opt_key == "infill_lock_depth" + || opt_key == "skin_infill_depth") { steps.emplace_back(posPrepareInfill); } else if (opt_key == "sparse_infill_density") { // One likely wants to reslice only when switching between zero infill to simulate boolean difference (subtracting volumes), diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index e797a3f45..572ed9320 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -521,6 +521,19 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con apply(config, &new_conf); is_msg_dlg_already_exist = false; } + + // layer_height shouldn't be equal to zero + float skin_depth = config->opt_float("skin_infill_depth"); + if (config->opt_float("infill_lock_depth") > skin_depth) { + const wxString msg_text = _(L("lock depth should smaller than skin depth.\nReset to 50% of skin depth")); + MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK); + DynamicPrintConfig new_conf = *config; + is_msg_dlg_already_exist = true; + dialog.ShowModal(); + new_conf.set_key_value("infill_lock_depth", new ConfigOptionFloat(skin_depth / 2)); + apply(config, &new_conf); + is_msg_dlg_already_exist = false; + } } void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::vector const &keys, std::map const &configs) @@ -565,11 +578,16 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in //cross zag bool is_cross_zag = config->option>("sparse_infill_pattern")->value == InfillPattern::ipCrossZag; - toggle_line("infill_shift_step", is_cross_zag); + bool is_locked_zig = config->option>("sparse_infill_pattern")->value == InfillPattern::ipLockedZag; + + toggle_line("infill_shift_step", is_cross_zag || is_locked_zig); + for (auto el : { "skeleton_infill_density", "skin_infill_density", "infill_lock_depth", "skin_infill_depth","skin_infill_line_width", "skeleton_infill_line_width" }) + toggle_line(el, is_locked_zig); + bool is_zig_zag = config->option>("sparse_infill_pattern")->value == InfillPattern::ipZigZag; toggle_line("infill_rotate_step", is_zig_zag); - toggle_line("symmetric_infill_y_axis", is_zig_zag || is_cross_zag); + toggle_line("symmetric_infill_y_axis", is_zig_zag || is_cross_zag || is_locked_zig); bool has_spiral_vase = config->opt_bool("spiral_mode"); toggle_line("spiral_mode_smooth", has_spiral_vase); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 9d88c2815..060d253a0 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1452,6 +1452,22 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) } } + if (opt_key == "sparse_infill_density") { + ConfigOptionPercent density = *m_config->option("sparse_infill_density"); + DynamicPrintConfig new_conf = *m_config; + new_conf.set_key_value("skeleton_infill_density", new ConfigOptionPercent(density)); + new_conf.set_key_value("skin_infill_density", new ConfigOptionPercent(density)); + m_config_manipulation.apply(m_config, &new_conf); + } + + if (opt_key == "sparse_infill_line_width") { + ConfigOptionFloat line_width = *m_config->option("sparse_infill_line_width"); + DynamicPrintConfig new_conf = *m_config; + new_conf.set_key_value("skin_infill_line_width", new ConfigOptionFloat(line_width)); + new_conf.set_key_value("skeleton_infill_line_width", new ConfigOptionFloat(line_width)); + m_config_manipulation.apply(m_config, &new_conf); + } + if (opt_key == "single_extruder_multi_material" || opt_key == "extruders_count" ) update_wiping_button_visibility(); @@ -2184,6 +2200,12 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Sparse infill"), L"param_infill"); optgroup->append_single_option_line("sparse_infill_density"); optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse"); + optgroup->append_single_option_line("skin_infill_density"); + optgroup->append_single_option_line("skeleton_infill_density"); + optgroup->append_single_option_line("infill_lock_depth"); + optgroup->append_single_option_line("skin_infill_depth"); + optgroup->append_single_option_line("skin_infill_line_width", "parameter/line-width"); + optgroup->append_single_option_line("skeleton_infill_line_width", "parameter/line-width"); optgroup->append_single_option_line("symmetric_infill_y_axis"); optgroup->append_single_option_line("infill_shift_step");