ENH: imprve overhang quality

Jira: none

add speed transition between discontinuity speed
detect bridge-wall and only use bride speed on bridge wall
fix the bug that not use overhang speed while support z
distance is 0 on arachne mode

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I72a1504544fe1ed7bd184ca073bd1b52cd2dcd75
This commit is contained in:
qing.zhang 2024-04-15 16:52:47 +08:00 committed by Lane.Wei
parent 18eeba6e7a
commit 0efa2db823
44 changed files with 516 additions and 52 deletions

View File

@ -11,6 +11,8 @@
"outer_wall_acceleration": "2000", "outer_wall_acceleration": "2000",
"outer_wall_speed": "60", "outer_wall_speed": "60",
"sparse_infill_pattern": "gyroid", "sparse_infill_pattern": "gyroid",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.2 nozzle", "Bambu Lab X1 Carbon 0.2 nozzle",
"Bambu Lab X1 0.2 nozzle", "Bambu Lab X1 0.2 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of 0.2 mm nozzle, it has a smaller layer height, and results in minimal layer lines and higher printing quality, but shorter printing time.", "description": "Compared with the default profile of 0.2 mm nozzle, it has a smaller layer height, and results in minimal layer lines and higher printing quality, but shorter printing time.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.2 nozzle", "Bambu Lab X1 Carbon 0.2 nozzle",
"Bambu Lab X1 0.2 nozzle", "Bambu Lab X1 0.2 nozzle",

View File

@ -6,6 +6,8 @@
"setting_id": "GP001", "setting_id": "GP001",
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height, and results in almost negligible layer lines and longer printing time.", "description": "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height, and results in almost negligible layer lines and longer printing time.",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -11,6 +11,8 @@
"outer_wall_acceleration": "2000", "outer_wall_acceleration": "2000",
"outer_wall_speed": "60", "outer_wall_speed": "60",
"sparse_infill_pattern": "gyroid", "sparse_infill_pattern": "gyroid",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.2 nozzle", "Bambu Lab X1 Carbon 0.2 nozzle",
"Bambu Lab X1 0.2 nozzle", "Bambu Lab X1 0.2 nozzle",

View File

@ -15,6 +15,8 @@
"sparse_infill_pattern": "gyroid", "sparse_infill_pattern": "gyroid",
"sparse_infill_speed": "150", "sparse_infill_speed": "150",
"top_surface_speed": "150", "top_surface_speed": "150",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer height, and results in almost invisible layer lines and higher printing quality, but shorter printing time.", "description": "Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer height, and results in almost invisible layer lines and higher printing quality, but shorter printing time.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.2 nozzle", "Bambu Lab X1 Carbon 0.2 nozzle",
"Bambu Lab X1 0.2 nozzle", "Bambu Lab X1 0.2 nozzle",

View File

@ -11,6 +11,8 @@
"outer_wall_acceleration": "2000", "outer_wall_acceleration": "2000",
"outer_wall_speed": "60", "outer_wall_speed": "60",
"sparse_infill_pattern": "gyroid", "sparse_infill_pattern": "gyroid",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.2 nozzle", "Bambu Lab X1 Carbon 0.2 nozzle",
"Bambu Lab X1 0.2 nozzle", "Bambu Lab X1 0.2 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "It has a small layer height, and results in almost negligible layer lines and high printing quality. It is suitable for most general printing cases.", "description": "It has a small layer height, and results in almost negligible layer lines and high printing quality. It is suitable for most general printing cases.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.2 nozzle", "Bambu Lab X1 Carbon 0.2 nozzle",
"Bambu Lab X1 0.2 nozzle", "Bambu Lab X1 0.2 nozzle",

View File

@ -6,6 +6,8 @@
"setting_id": "GP002", "setting_id": "GP002",
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height, and results in almost negligible layer lines and higher printing quality, but longer printing time.", "description": "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height, and results in almost negligible layer lines and higher printing quality, but longer printing time.",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -15,6 +15,8 @@
"sparse_infill_pattern": "gyroid", "sparse_infill_pattern": "gyroid",
"sparse_infill_speed": "180", "sparse_infill_speed": "180",
"top_surface_speed": "150", "top_surface_speed": "150",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.2 mm nozzle, it has a slightly bigger layer height, and results in almost negligible layer lines, and slightly shorter printing time.", "description": "Compared with the default profile of a 0.2 mm nozzle, it has a slightly bigger layer height, and results in almost negligible layer lines, and slightly shorter printing time.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.2 nozzle", "Bambu Lab X1 Carbon 0.2 nozzle",
"Bambu Lab X1 0.2 nozzle", "Bambu Lab X1 0.2 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.2 mm nozzle, it has a bigger layer height, and results in slightly visible layer lines, but shorter printing time.", "description": "Compared with the default profile of a 0.2 mm nozzle, it has a bigger layer height, and results in slightly visible layer lines, but shorter printing time.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.2 nozzle", "Bambu Lab X1 Carbon 0.2 nozzle",
"Bambu Lab X1 0.2 nozzle", "Bambu Lab X1 0.2 nozzle",

View File

@ -15,6 +15,8 @@
"sparse_infill_pattern": "gyroid", "sparse_infill_pattern": "gyroid",
"sparse_infill_speed": "200", "sparse_infill_speed": "200",
"top_surface_speed": "150", "top_surface_speed": "150",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -6,6 +6,8 @@
"setting_id": "GP003", "setting_id": "GP003",
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height, and results in less apparent layer lines and higher printing quality, but longer printing time.", "description": "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height, and results in less apparent layer lines and higher printing quality, but longer printing time.",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.6 mm nozzle, it has a smaller layer height, and results in less apparent layer lines and higher printing quality, but longer printing time.", "description": "Compared with the default profile of a 0.6 mm nozzle, it has a smaller layer height, and results in less apparent layer lines and higher printing quality, but longer printing time.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.6 nozzle", "Bambu Lab X1 Carbon 0.6 nozzle",
"Bambu Lab X1 0.6 nozzle", "Bambu Lab X1 0.6 nozzle",

View File

@ -6,6 +6,8 @@
"setting_id": "GP004", "setting_id": "GP004",
"instantiation": "true", "instantiation": "true",
"description": "It has a general layer height, and results in general layer lines and printing quality. It is suitable for most general printing cases.", "description": "It has a general layer height, and results in general layer lines and printing quality. It is suitable for most general printing cases.",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -8,6 +8,8 @@
"description": "Compared with the default profile of a 0.4 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.", "description": "Compared with the default profile of a 0.4 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.",
"outer_wall_speed": "60", "outer_wall_speed": "60",
"sparse_infill_density": "25%", "sparse_infill_density": "25%",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"wall_loops": "6", "wall_loops": "6",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",

View File

@ -6,6 +6,8 @@
"setting_id": "GP005", "setting_id": "GP005",
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.4 mm nozzle, it has a bigger layer height, and results in more apparent layer lines and lower printing quality, but slightly shorter printing time.", "description": "Compared with the default profile of a 0.4 mm nozzle, it has a bigger layer height, and results in more apparent layer lines and lower printing quality, but slightly shorter printing time.",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.6 mm nozzle, it has a smaller layer height, and results in less apparent layer lines and slight higher printing quality, but longer printing time.", "description": "Compared with the default profile of a 0.6 mm nozzle, it has a smaller layer height, and results in less apparent layer lines and slight higher printing quality, but longer printing time.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.6 nozzle", "Bambu Lab X1 Carbon 0.6 nozzle",
"Bambu Lab X1 0.6 nozzle", "Bambu Lab X1 0.6 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.8 mm nozzle, it has a smaller layer height, and results in less but still apparent layer lines and slightly higher printing quality, but longer printing time in some printing cases.", "description": "Compared with the default profile of a 0.8 mm nozzle, it has a smaller layer height, and results in less but still apparent layer lines and slightly higher printing quality, but longer printing time in some printing cases.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.8 nozzle", "Bambu Lab X1 Carbon 0.8 nozzle",
"Bambu Lab X1 0.8 nozzle", "Bambu Lab X1 0.8 nozzle",

View File

@ -6,6 +6,8 @@
"setting_id": "GP006", "setting_id": "GP006",
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.4 mm nozzle, it has a bigger layer height, and results in more apparent layer lines and lower printing quality, but shorter printing time.", "description": "Compared with the default profile of a 0.4 mm nozzle, it has a bigger layer height, and results in more apparent layer lines and lower printing quality, but shorter printing time.",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.4 nozzle", "Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab X1 0.4 nozzle", "Bambu Lab X1 0.4 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "It has a big layer height, and results in apparent layer lines and ordinary printing quality and printing time.", "description": "It has a big layer height, and results in apparent layer lines and ordinary printing quality and printing time.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.6 nozzle", "Bambu Lab X1 Carbon 0.6 nozzle",
"Bambu Lab P1S 0.6 nozzle", "Bambu Lab P1S 0.6 nozzle",

View File

@ -9,6 +9,8 @@
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"sparse_infill_density": "25%", "sparse_infill_density": "25%",
"wall_loops": "4", "wall_loops": "4",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.6 nozzle", "Bambu Lab X1 Carbon 0.6 nozzle",
"Bambu Lab X1 0.6 nozzle", "Bambu Lab X1 0.6 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.8 mm nozzle, it has a slightly smaller layer height, and results in slightly less but still apparent layer lines and slightly higher printing quality, but longer printing time in some printing cases.", "description": "Compared with the default profile of a 0.8 mm nozzle, it has a slightly smaller layer height, and results in slightly less but still apparent layer lines and slightly higher printing quality, but longer printing time in some printing cases.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.8 nozzle", "Bambu Lab X1 Carbon 0.8 nozzle",
"Bambu Lab X1 0.8 nozzle", "Bambu Lab X1 0.8 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.6 mm nozzle, it has a bigger layer height, and results in more apparent layer lines and lower printing quality, but shorter printing time in some printing cases.", "description": "Compared with the default profile of a 0.6 mm nozzle, it has a bigger layer height, and results in more apparent layer lines and lower printing quality, but shorter printing time in some printing cases.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.6 nozzle", "Bambu Lab X1 Carbon 0.6 nozzle",
"Bambu Lab X1 0.6 nozzle", "Bambu Lab X1 0.6 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "It has a very big layer height, and results in very apparent layer lines, low printing quality and general printing time.", "description": "It has a very big layer height, and results in very apparent layer lines, low printing quality and general printing time.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.8 nozzle", "Bambu Lab X1 Carbon 0.8 nozzle",
"Bambu Lab P1S 0.8 nozzle", "Bambu Lab P1S 0.8 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.6 mm nozzle, it has a bigger layer height, and results in much more apparent layer lines and much lower printing quality, but shorter printing time in some printing cases.", "description": "Compared with the default profile of a 0.6 mm nozzle, it has a bigger layer height, and results in much more apparent layer lines and much lower printing quality, but shorter printing time in some printing cases.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.6 nozzle", "Bambu Lab X1 Carbon 0.6 nozzle",
"Bambu Lab X1 0.6 nozzle", "Bambu Lab X1 0.6 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.8 mm nozzle, it has a bigger layer height, and results in very apparent layer lines and much lower printing quality, but shorter printing time in some printing cases.", "description": "Compared with the default profile of a 0.8 mm nozzle, it has a bigger layer height, and results in very apparent layer lines and much lower printing quality, but shorter printing time in some printing cases.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.8 nozzle", "Bambu Lab X1 Carbon 0.8 nozzle",
"Bambu Lab X1 0.8 nozzle", "Bambu Lab X1 0.8 nozzle",

View File

@ -7,6 +7,8 @@
"instantiation": "true", "instantiation": "true",
"description": "Compared with the default profile of a 0.8 mm nozzle, it has a much bigger layer height, and results in extremely apparent layer lines and much lower printing quality, but much shorter printing time in some printing cases.", "description": "Compared with the default profile of a 0.8 mm nozzle, it has a much bigger layer height, and results in extremely apparent layer lines and much lower printing quality, but much shorter printing time in some printing cases.",
"elefant_foot_compensation": "0.15", "elefant_foot_compensation": "0.15",
"smooth_coefficient": "150",
"overhang_totally_speed": "50",
"compatible_printers": [ "compatible_printers": [
"Bambu Lab X1 Carbon 0.8 nozzle", "Bambu Lab X1 Carbon 0.8 nozzle",
"Bambu Lab X1 0.8 nozzle", "Bambu Lab X1 0.8 nozzle",

View File

@ -67,5 +67,7 @@
"prime_tower_width": "60", "prime_tower_width": "60",
"xy_hole_compensation": "0", "xy_hole_compensation": "0",
"xy_contour_compensation": "0", "xy_contour_compensation": "0",
"compatible_printers": [] "compatible_printers": [],
"smooth_coefficient": "80",
"overhang_totally_speed": "24"
} }

View File

@ -264,17 +264,22 @@ double ExtrusionLine::area() const
} // namespace Slic3r::Arachne } // namespace Slic3r::Arachne
namespace Slic3r { namespace Slic3r {
void extrusion_paths_append(ExtrusionPaths &dst, const ClipperLib_Z::Paths &extrusion_paths, const ExtrusionRole role, const Flow &flow) void extrusion_paths_append(ExtrusionPaths &dst, const ClipperLib_Z::Paths &extrusion_paths, const ExtrusionRole role, const Flow &flow, int overhang)
{ {
for (const ClipperLib_Z::Path &extrusion_path : extrusion_paths) { for (const ClipperLib_Z::Path &extrusion_path : extrusion_paths) {
ThickPolyline thick_polyline = Arachne::to_thick_polyline(extrusion_path); ThickPolyline thick_polyline = Arachne::to_thick_polyline(extrusion_path);
Slic3r::append(dst, thick_polyline_to_multi_path(thick_polyline, role, flow, scaled<float>(0.05), float(SCALED_EPSILON)).paths); Slic3r::append(dst, thick_polyline_to_multi_path(thick_polyline, role, flow, scaled<float>(0.05), float(SCALED_EPSILON), overhang).paths);
} }
} }
void extrusion_paths_append(ExtrusionPaths &dst, const Arachne::ExtrusionLine &extrusion, const ExtrusionRole role, const Flow &flow) void extrusion_paths_append(ExtrusionPaths &dst, const Arachne::ExtrusionLine &extrusion, const ExtrusionRole role, const Flow &flow, int overhang)
{ {
ThickPolyline thick_polyline = Arachne::to_thick_polyline(extrusion); ThickPolyline thick_polyline = Arachne::to_thick_polyline(extrusion);
Slic3r::append(dst, thick_polyline_to_multi_path(thick_polyline, role, flow, scaled<float>(0.05), float(SCALED_EPSILON)).paths); Slic3r::append(dst, thick_polyline_to_multi_path(thick_polyline, role, flow, scaled<float>(0.05), float(SCALED_EPSILON), overhang).paths);
}
void extrusion_path_append(ExtrusionPaths &dst, const ThickPolyline &thick_polyline, const ExtrusionRole role, const Flow &flow, int overhang)
{
Slic3r::append(dst, thick_polyline_to_multi_path(thick_polyline, role, flow, scaled<float>(0.05), float(SCALED_EPSILON), overhang).paths);
} }
} // namespace Slic3r } // namespace Slic3r

View File

@ -299,9 +299,9 @@ using VariableWidthLines = std::vector<ExtrusionLine>; //<! The ExtrusionLines g
namespace Slic3r { namespace Slic3r {
void extrusion_paths_append(ExtrusionPaths &dst, const ClipperLib_Z::Paths &extrusion_paths, const ExtrusionRole role, const Flow &flow); void extrusion_paths_append(ExtrusionPaths &dst, const ClipperLib_Z::Paths &extrusion_paths, const ExtrusionRole role, const Flow &flow, int overhang = 0);
void extrusion_paths_append(ExtrusionPaths &dst, const Arachne::ExtrusionLine &extrusion, const ExtrusionRole role, const Flow &flow); void extrusion_paths_append(ExtrusionPaths &dst, const Arachne::ExtrusionLine &extrusion, const ExtrusionRole role, const Flow &flow, int overhang = 0);
void extrusion_path_append(ExtrusionPaths &dst, const ThickPolyline &thick_polyline, const ExtrusionRole role, const Flow &flow, int overhang = 0);
} // namespace Slic3r } // namespace Slic3r
#endif // UTILS_EXTRUSION_LINE_H #endif // UTILS_EXTRUSION_LINE_H

View File

@ -140,6 +140,7 @@ public:
float width; float width;
// Height of the extrusion, used for visualization purposes. // Height of the extrusion, used for visualization purposes.
float height; float height;
double smooth_speed = 0;
ExtrusionPath() : mm3_per_mm(-1), width(-1), height(-1), m_role(erNone), m_no_extrusion(false) {} ExtrusionPath() : mm3_per_mm(-1), width(-1), height(-1), m_role(erNone), m_no_extrusion(false) {}
ExtrusionPath(ExtrusionRole role) : mm3_per_mm(-1), width(-1), height(-1), m_role(role), m_no_extrusion(false) {} ExtrusionPath(ExtrusionRole role) : mm3_per_mm(-1), width(-1), height(-1), m_role(role), m_no_extrusion(false) {}
@ -153,6 +154,7 @@ public:
, mm3_per_mm(rhs.mm3_per_mm) , mm3_per_mm(rhs.mm3_per_mm)
, width(rhs.width) , width(rhs.width)
, height(rhs.height) , height(rhs.height)
, smooth_speed(rhs.smooth_speed)
, m_can_reverse(rhs.m_can_reverse) , m_can_reverse(rhs.m_can_reverse)
, m_role(rhs.m_role) , m_role(rhs.m_role)
, m_no_extrusion(rhs.m_no_extrusion) , m_no_extrusion(rhs.m_no_extrusion)
@ -164,6 +166,7 @@ public:
, mm3_per_mm(rhs.mm3_per_mm) , mm3_per_mm(rhs.mm3_per_mm)
, width(rhs.width) , width(rhs.width)
, height(rhs.height) , height(rhs.height)
, smooth_speed(rhs.smooth_speed)
, m_can_reverse(rhs.m_can_reverse) , m_can_reverse(rhs.m_can_reverse)
, m_role(rhs.m_role) , m_role(rhs.m_role)
, m_no_extrusion(rhs.m_no_extrusion) , m_no_extrusion(rhs.m_no_extrusion)
@ -175,6 +178,7 @@ public:
, mm3_per_mm(rhs.mm3_per_mm) , mm3_per_mm(rhs.mm3_per_mm)
, width(rhs.width) , width(rhs.width)
, height(rhs.height) , height(rhs.height)
, smooth_speed(rhs.smooth_speed)
, m_can_reverse(rhs.m_can_reverse) , m_can_reverse(rhs.m_can_reverse)
, m_role(rhs.m_role) , m_role(rhs.m_role)
, m_no_extrusion(rhs.m_no_extrusion) , m_no_extrusion(rhs.m_no_extrusion)
@ -186,6 +190,7 @@ public:
, mm3_per_mm(rhs.mm3_per_mm) , mm3_per_mm(rhs.mm3_per_mm)
, width(rhs.width) , width(rhs.width)
, height(rhs.height) , height(rhs.height)
, smooth_speed(rhs.smooth_speed)
, m_can_reverse(rhs.m_can_reverse) , m_can_reverse(rhs.m_can_reverse)
, m_role(rhs.m_role) , m_role(rhs.m_role)
, m_no_extrusion(rhs.m_no_extrusion) , m_no_extrusion(rhs.m_no_extrusion)
@ -198,6 +203,7 @@ public:
this->mm3_per_mm = rhs.mm3_per_mm; this->mm3_per_mm = rhs.mm3_per_mm;
this->width = rhs.width; this->width = rhs.width;
this->height = rhs.height; this->height = rhs.height;
this->smooth_speed = rhs.smooth_speed;
this->overhang_degree = rhs.overhang_degree; this->overhang_degree = rhs.overhang_degree;
this->curve_degree = rhs.curve_degree; this->curve_degree = rhs.curve_degree;
this->polyline = rhs.polyline; this->polyline = rhs.polyline;
@ -210,6 +216,7 @@ public:
this->mm3_per_mm = rhs.mm3_per_mm; this->mm3_per_mm = rhs.mm3_per_mm;
this->width = rhs.width; this->width = rhs.width;
this->height = rhs.height; this->height = rhs.height;
this->smooth_speed = rhs.smooth_speed;
this->overhang_degree = rhs.overhang_degree; this->overhang_degree = rhs.overhang_degree;
this->curve_degree = rhs.curve_degree; this->curve_degree = rhs.curve_degree;
this->polyline = std::move(rhs.polyline); this->polyline = std::move(rhs.polyline);

View File

@ -79,6 +79,8 @@ static const float g_min_purge_volume = 100.f;
static const float g_purge_volume_one_time = 135.f; static const float g_purge_volume_one_time = 135.f;
static const int g_max_flush_count = 4; static const int g_max_flush_count = 4;
static const size_t g_max_label_object = 64; static const size_t g_max_label_object = 64;
static const double smooth_speed_step = 10;
static const double not_split_length = scale_(1.0);
Vec2d travel_point_1; Vec2d travel_point_1;
Vec2d travel_point_2; Vec2d travel_point_2;
@ -3933,6 +3935,16 @@ static bool has_overhang_path_on_slope(const ExtrusionLoop &loop, double slope_l
return false; return false;
} }
static std::map<int, std::string> overhang_speed_key_map =
{
{1, "overhang_1_4_speed"},
{2, "overhang_2_4_speed"},
{3, "overhang_3_4_speed"},
{4, "overhang_4_4_speed"},
{5, "overhang_totally_speed"},
{6, "bridge_speed"},
};
double GCode::get_path_speed(const ExtrusionPath &path) double GCode::get_path_speed(const ExtrusionPath &path)
{ {
double min_speed = double(m_config.slow_down_min_speed.get_at(m_writer.extruder()->id())); double min_speed = double(m_config.slow_down_min_speed.get_at(m_writer.extruder()->id()));
@ -3952,7 +3964,9 @@ double GCode::get_path_speed(const ExtrusionPath &path)
new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree); new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree);
speed = new_speed == 0.0 ? speed : new_speed; speed = new_speed == 0.0 ? speed : new_speed;
} }
} else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erSupportTransition) { } else if (path.role() == erOverhangPerimeter && path.overhang_degree == 5)
speed = m_config.get_abs_value("overhang_totally_speed");
else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erSupportTransition) {
speed = m_config.get_abs_value("bridge_speed"); speed = m_config.get_abs_value("bridge_speed");
} }
auto _mm3_per_mm = path.mm3_per_mm * double(m_curr_print->calib_mode() == CalibMode::Calib_Flow_Rate ? this->config().print_flow_ratio.value : 1); auto _mm3_per_mm = path.mm3_per_mm * double(m_curr_print->calib_mode() == CalibMode::Calib_Flow_Rate ? this->config().print_flow_ratio.value : 1);
@ -3977,6 +3991,7 @@ double GCode::get_path_speed(const ExtrusionPath &path)
// cap speed with max_volumetric_speed anyway (even if user is not using autospeed) // cap speed with max_volumetric_speed anyway (even if user is not using autospeed)
speed = std::min(speed, extrude_speed); speed = std::min(speed, extrude_speed);
} }
return speed; return speed;
} }
@ -4072,6 +4087,9 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
// BBS: slowdown speed to improve seam, to be fix, cooling need to be apply correctly // BBS: slowdown speed to improve seam, to be fix, cooling need to be apply correctly
//new_loop.target_speed = get_path_speed(new_loop.starts.back()); //new_loop.target_speed = get_path_speed(new_loop.starts.back());
//new_loop.slowdown_slope_speed(); //new_loop.slowdown_slope_speed();
// BBS: smooth speed of discontinuity areas
if (m_config.detect_overhang_wall && m_config.smooth_speed_discontinuity_area && (loop.role() == erExternalPerimeter || loop.role() == erPerimeter))
smooth_speed_discontinuity_area(new_loop.paths);
// Then extrude it // Then extrude it
for (const auto &p : new_loop.get_all_paths()) { for (const auto &p : new_loop.get_all_paths()) {
gcode += this->_extrude(*p, description, speed_for_path(*p)); gcode += this->_extrude(*p, description, speed_for_path(*p));
@ -4093,6 +4111,10 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
} }
if (!enable_seam_slope || slope_has_overhang) { if (!enable_seam_slope || slope_has_overhang) {
// BBS: smooth speed of discontinuity areas
if (m_config.detect_overhang_wall && m_config.smooth_speed_discontinuity_area && (loop.role() == erExternalPerimeter || loop.role() == erPerimeter))
smooth_speed_discontinuity_area(paths);
for (ExtrusionPaths::iterator path = paths.begin(); path != paths.end(); ++path) { for (ExtrusionPaths::iterator path = paths.begin(); path != paths.end(); ++path) {
gcode += this->_extrude(*path, description, speed_for_path(*path)); gcode += this->_extrude(*path, description, speed_for_path(*path));
} }
@ -4375,14 +4397,19 @@ void GCode::GCodeOutputStream::write_format(const char* format, ...)
va_end(args); va_end(args);
} }
static std::map<int, std::string> overhang_speed_key_map = // BBS: f(x)=2x^2
double GCode::mapping_speed(double dist)
{ {
{1, "overhang_1_4_speed"}, if (dist <= 0)
{2, "overhang_2_4_speed"}, return 0;
{3, "overhang_3_4_speed"}, return this->config().smooth_coefficient * pow(dist, 2);
{4, "overhang_4_4_speed"}, }
{5, "bridge_speed"},
}; double GCode::get_speed_coor_x(double speed){
double temp = speed / this->config().smooth_coefficient;
return sqrt(temp);
}
double GCode::get_overhang_degree_corr_speed(float normal_speed, double path_degree) { double GCode::get_overhang_degree_corr_speed(float normal_speed, double path_degree) {
@ -4407,6 +4434,269 @@ double GCode::get_overhang_degree_corr_speed(float normal_speed, double path_deg
return speed_out; return speed_out;
} }
static bool need_smooth_speed(const ExtrusionPath &other_path, const ExtrusionPath &this_path)
{
if (this_path.smooth_speed - other_path.smooth_speed > smooth_speed_step)
return true;
return false;
}
static void append_split_line(bool split_from_left, Polyline &polyline, Point p1, Point p2)
{
if (split_from_left) {
polyline.append(p1);
polyline.append(p2);
} else {
polyline.append(p2);
polyline.append(p1);
}
}
ExtrusionPaths GCode::split_and_mapping_speed(double &other_path_v, double &final_v, ExtrusionPath &this_path, double max_smooth_length, bool split_from_left)
{
ExtrusionPaths splited_path;
if (this_path.length() <= 0 || this_path.polyline.points.size() < 2) {
return splited_path;
}
// reverse if this slowdown the speed
Polyline input_polyline = this_path.polyline;
if (!split_from_left)
std::reverse(input_polyline.begin(), input_polyline.end());
double this_path_x = scale_(get_speed_coor_x(final_v));
double x_base = scale_(get_speed_coor_x(other_path_v));
double smooth_length = this_path_x - x_base;
// this length not support to get final v, adjust final v
if (smooth_length > max_smooth_length)
final_v = mapping_speed(unscale_(x_base + max_smooth_length));
double max_step_length = scale_(1.0); // cut path if the path too long
double min_step_length = scale_(0.4); // cut step
double smooth_length_count = 0;
double split_line_speed = 0;
Point line_start_pt = input_polyline.points.front();
Point line_end_pt = input_polyline.points[1];
bool get_next_line = false;
size_t end_pt_idx = 1;
auto insert_speed = [this](double line_lenght, double &pos_x, double &smooth_length_count, double target_v) {
pos_x += line_lenght;
double pos_x_speed = mapping_speed(unscale_(pos_x));
smooth_length_count += line_lenght;
if (pos_x_speed > target_v)
pos_x_speed = target_v;
return pos_x_speed;
};
while (end_pt_idx < input_polyline.points.size()) {
// move to next line
if (get_next_line) {
line_start_pt = input_polyline.points[end_pt_idx - 1];
line_end_pt = input_polyline.points[end_pt_idx];
}
Polyline polyline;
Line line(line_start_pt, line_end_pt);
// split polyline and set speed
if (line.length() < max_step_length || line.length() - min_step_length < min_step_length / 2) {
split_line_speed = insert_speed(line.length(), x_base, smooth_length_count, final_v);
append_split_line(split_from_left, polyline, line_start_pt, line_end_pt);
end_pt_idx++;
get_next_line = true;
} else {
// path is too long, split it
double rate = min_step_length / line.length();
Point insert_p = line.a + (line.b - line.a) * rate;
split_line_speed = insert_speed(min_step_length, x_base, smooth_length_count, final_v);
append_split_line(split_from_left, polyline, line_start_pt, insert_p);
line_start_pt = insert_p;
get_next_line = false;
}
ExtrusionPath path_step(polyline, this_path);
path_step.smooth_speed = split_line_speed;
splited_path.push_back(std::move(path_step));
// stop condition
if (split_line_speed >= final_v) break;
}
if (!split_from_left)
std::reverse(input_polyline.points.begin(), input_polyline.points.end());
// get_remain_path
if (end_pt_idx < input_polyline.points.size()) {
// split at index or split at corr length
Polyline p1, p2;
if( !split_from_left ) {
input_polyline.split_at_length(input_polyline.length() - smooth_length_count, &p1, &p2);
this_path.polyline = p1;
} else {
input_polyline.split_at_length(smooth_length_count, &p1, &p2);
this_path.polyline = p2;
}
} else {
this_path.polyline.clear();
}
// reverse paths if this start from right
if (!split_from_left)
std::reverse(splited_path.begin(), splited_path.end());
return splited_path;
}
ExtrusionPaths GCode::merge_same_speed_paths(const ExtrusionPaths &paths)
{
ExtrusionPaths output_paths;
size_t path_idx = 0;
int merge_start = 0;
ExtrusionPath merge_path;
for (; path_idx < paths.size(); path_idx++) {
ExtrusionPath path = paths[path_idx];
path.smooth_speed = get_path_speed(path);
// 100% overhang speed will not to set smooth speed
if (path.role() == erOverhangPerimeter) {
if (!merge_path.empty())
output_paths.push_back(std::move(merge_path));
output_paths.push_back(std::move(path));
merge_start = path_idx + 1;
continue;
}
if (merge_start == path_idx) {
merge_path = path;
continue;
}
// merge path with same speed
if (merge_path.smooth_speed == path.smooth_speed) {
merge_path.polyline.append(path.polyline);
} else {
output_paths.push_back(std::move(merge_path));
merge_path = path;
}
}
if (!merge_path.empty())
output_paths.push_back(std::move(merge_path));
return output_paths;
}
static void set_short_and_discontinuity_speed_line(ExtrusionPaths &paths)
{
for (size_t path_idx = 0; path_idx < paths.size(); path_idx++) {
ExtrusionPath &path = paths[path_idx];
double path_length = path.polyline.length();
if (path_length > not_split_length) continue;
bool smooth_left_path = false;
bool smooth_right_path = false;
// first line do not need to smooth speed on left
// prev line speed may change
if (path_idx > 0)
smooth_left_path = need_smooth_speed(paths[path_idx - 1], path);
// last line do not need to smooth speed on right
if (path_idx < paths.size() - 1)
smooth_right_path = need_smooth_speed(paths[path_idx + 1], path);
if (!(smooth_left_path || smooth_right_path))
continue;
//reset speed
if (smooth_left_path) {
path.smooth_speed = paths[path_idx - 1].smooth_speed;
} else {
path.smooth_speed = paths[path_idx + 1].smooth_speed;
}
}
}
ExtrusionPaths GCode::set_speed_transition(ExtrusionPaths &paths)
{
ExtrusionPaths interpolated_paths;
for (int path_idx = 0; path_idx < paths.size(); path_idx++) {
// update path
ExtrusionPath &path = paths[path_idx];
double this_path_speed = 0;
// 100% overhang speed will not to set smooth speed
if (path.role() == erOverhangPerimeter) {
interpolated_paths.push_back(path);
continue;
}
bool smooth_left_path = false;
bool smooth_right_path = false;
// first line do not need to smooth speed on left
// prev line speed may change
if (path_idx > 0)
smooth_left_path = need_smooth_speed(paths[path_idx - 1], path);
// first line do not need to smooth speed on right
if (path_idx < paths.size() - 1)
smooth_right_path = need_smooth_speed(paths[path_idx + 1], path);
// get smooth length
double max_smooth_path_length = path.length();
if (smooth_right_path && smooth_left_path) max_smooth_path_length /= 2;
// smooth left
ExtrusionPaths left_split_paths;
if (smooth_left_path) {
left_split_paths = split_and_mapping_speed(paths[path_idx - 1].smooth_speed, path.smooth_speed, path, max_smooth_path_length);
if (!left_split_paths.empty()) interpolated_paths.insert(interpolated_paths.end(), left_split_paths.begin(), left_split_paths.end());
max_smooth_path_length = path.length();
}
// smooth right
ExtrusionPaths right_split_paths;
if (smooth_right_path) {
right_split_paths = split_and_mapping_speed(paths[path_idx + 1].smooth_speed, path.smooth_speed, path, max_smooth_path_length, false); }
if (!path.empty())
interpolated_paths.push_back(path);
if (!right_split_paths.empty())
interpolated_paths.insert(interpolated_paths.end(), right_split_paths.begin(), right_split_paths.end());
}
return interpolated_paths;
}
void GCode::smooth_speed_discontinuity_area(ExtrusionPaths &paths) {
if (paths.size() <= 1)
return;
//step 1 merge same speed path
size_t path_tail_pos = 0;
ExtrusionPaths prepare_paths = merge_same_speed_paths(paths);
//step 2 set too short path speed
set_short_and_discontinuity_speed_line(prepare_paths);
//step 3 split path
ExtrusionPaths inter_paths;
inter_paths =set_speed_transition(prepare_paths);
paths = std::move(inter_paths);
}
std::string GCode::_extrude(const ExtrusionPath &path, std::string description, double speed, bool is_first_slope) std::string GCode::_extrude(const ExtrusionPath &path, std::string description, double speed, bool is_first_slope)
{ {
std::string gcode; std::string gcode;
@ -4500,18 +4790,25 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
if (speed == -1) { if (speed == -1) {
if (path.role() == erPerimeter) { if (path.role() == erPerimeter) {
speed = m_config.get_abs_value("inner_wall_speed"); speed = m_config.get_abs_value("inner_wall_speed");
if (m_config.enable_overhang_speed.value) { if (m_config.detect_overhang_wall && m_config.smooth_speed_discontinuity_area && path.smooth_speed != 0)
speed = path.smooth_speed;
else if (m_config.enable_overhang_speed.value) {
double new_speed = 0; double new_speed = 0;
new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree); new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree);
speed = new_speed == 0.0 ? speed : new_speed; speed = new_speed == 0.0 ? speed : new_speed;
} }
} else if (path.role() == erExternalPerimeter) { } else if (path.role() == erExternalPerimeter) {
speed = m_config.get_abs_value("outer_wall_speed"); speed = m_config.get_abs_value("outer_wall_speed");
if (m_config.enable_overhang_speed.value ) { if (m_config.detect_overhang_wall && m_config.smooth_speed_discontinuity_area && path.smooth_speed != 0)
speed = path.smooth_speed;
else if (m_config.enable_overhang_speed.value) {
double new_speed = 0; double new_speed = 0;
new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree); new_speed = get_overhang_degree_corr_speed(speed, path.overhang_degree);
speed = new_speed == 0.0 ? speed : new_speed; speed = new_speed == 0.0 ? speed : new_speed;
} }
} else if (path.role() == erOverhangPerimeter && path.overhang_degree == 5) {
speed = m_config.get_abs_value("overhang_totally_speed");
} else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erSupportTransition) { } else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erSupportTransition) {
speed = m_config.get_abs_value("bridge_speed"); speed = m_config.get_abs_value("bridge_speed");
} else if (path.role() == erInternalInfill) { } else if (path.role() == erInternalInfill) {

View File

@ -342,6 +342,9 @@ private:
std::string extrude_multi_path(ExtrusionMultiPath multipath, std::string description = "", double speed = -1.); std::string extrude_multi_path(ExtrusionMultiPath multipath, std::string description = "", double speed = -1.);
std::string extrude_path(ExtrusionPath path, std::string description = "", double speed = -1.); std::string extrude_path(ExtrusionPath path, std::string description = "", double speed = -1.);
//smooth speed function
void smooth_speed_discontinuity_area(ExtrusionPaths &paths);
ExtrusionPaths merge_same_speed_paths(const ExtrusionPaths &paths);
// Extruding multiple objects with soluble / non-soluble / combined supports // Extruding multiple objects with soluble / non-soluble / combined supports
// on a multi-material printer, trying to minimize tool switches. // on a multi-material printer, trying to minimize tool switches.
// Following structures sort extrusions by the extruder ID, by an order of objects and object islands. // Following structures sort extrusions by the extruder ID, by an order of objects and object islands.
@ -514,8 +517,12 @@ private:
int get_bed_temperature(const int extruder_id, const bool is_first_layer, const BedType bed_type) const; int get_bed_temperature(const int extruder_id, const bool is_first_layer, const BedType bed_type) const;
std::string _extrude(const ExtrusionPath &path, std::string description = "", double speed = -1, bool is_first_slope = false); std::string _extrude(const ExtrusionPath &path, std::string description = "", double speed = -1, bool is_first_slope = false);
ExtrusionPaths set_speed_transition(ExtrusionPaths &paths);
ExtrusionPaths split_and_mapping_speed(double &other_path_v, double &final_v, ExtrusionPath &this_path, double max_smooth_length, bool split_from_left = true);
double get_path_speed(const ExtrusionPath &path); double get_path_speed(const ExtrusionPath &path);
double get_overhang_degree_corr_speed(float speed, double path_degree); double get_overhang_degree_corr_speed(float speed, double path_degree);
double mapping_speed(double dist);
double get_speed_coor_x(double speed);
void print_machine_envelope(GCodeOutputStream &file, Print &print); void print_machine_envelope(GCodeOutputStream &file, Print &print);
void _print_first_layer_bed_temperature(GCodeOutputStream &file, Print &print, const std::string &gcode, unsigned int first_printing_extruder_id, bool wait); void _print_first_layer_bed_temperature(GCodeOutputStream &file, Print &print, const std::string &gcode, unsigned int first_printing_extruder_id, bool wait);
void _print_first_layer_extruder_temperatures(GCodeOutputStream &file, Print &print, const std::string &gcode, unsigned int first_printing_extruder_id, bool wait); void _print_first_layer_extruder_temperatures(GCodeOutputStream &file, Print &print, const std::string &gcode, unsigned int first_printing_extruder_id, bool wait);

View File

@ -417,6 +417,34 @@ std::pair<double, double> PerimeterGenerator::dist_boundary(double width)
return out; return out;
} }
static void detect_bridge_wall(const PerimeterGenerator &perimeter_generator, ExtrusionPaths &paths, const Polylines &remain_polines, ExtrusionRole role, double mm3_per_mm, float width, float height)
{
for (Polyline poly : remain_polines) {
// check if the line is straight line, which mean if the wall is bridge
Line line(poly.first_point(), poly.last_point());
if (line.length() < poly.length()) {
extrusion_paths_append(paths,
std::move(poly),
overhang_sampling_number - 1,
int(0),
role,
mm3_per_mm,
width,
height);
continue;
}
// bridge wall
extrusion_paths_append(paths,
std::move(poly),
overhang_sampling_number,
int(0),
role,
mm3_per_mm,
width,
height);
}
}
static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perimeter_generator, const PerimeterGeneratorLoops &loops, ThickPolylines &thin_walls) static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perimeter_generator, const PerimeterGeneratorLoops &loops, ThickPolylines &thin_walls)
{ {
@ -557,21 +585,18 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
if (remain_polines.size() != 0) { if (remain_polines.size() != 0) {
if (!((perimeter_generator.object_config->enable_support || perimeter_generator.object_config->enforce_support_layers > 0) if (!((perimeter_generator.object_config->enable_support || perimeter_generator.object_config->enforce_support_layers > 0)
&& perimeter_generator.object_config->support_top_z_distance.value == 0)) { && perimeter_generator.object_config->support_top_z_distance.value == 0)) {
extrusion_paths_append( //detect if the overhang perimeter is bridge
detect_bridge_wall(perimeter_generator,
paths, paths,
std::move(remain_polines), remain_polines,
overhang_sampling_number - 1,
int(0),
erOverhangPerimeter, erOverhangPerimeter,
perimeter_generator.mm3_per_mm_overhang(), perimeter_generator.mm3_per_mm_overhang(),
perimeter_generator.overhang_flow.width(), perimeter_generator.overhang_flow.width(),
perimeter_generator.overhang_flow.height()); perimeter_generator.overhang_flow.height());
} else { } else {
extrusion_paths_append( detect_bridge_wall( perimeter_generator,
paths, paths,
std::move(remain_polines), remain_polines,
overhang_sampling_number - 1,
int(0),
role, role,
extrusion_mm3_per_mm, extrusion_mm3_per_mm,
extrusion_width, extrusion_width,
@ -825,6 +850,30 @@ static void smooth_overhang_level(ExtrusionPaths &paths)
} }
} }
static void detect_brigde_wall_arachne(const PerimeterGenerator &perimeter_generator, ExtrusionPaths &paths, const ClipperLib_Z::Paths &path_overhang, const ExtrusionRole role, const Flow &flow)
{
for (ClipperLib_Z::Path path : path_overhang) {
// check if the line is straight line, which mean if the wall is bridge
ThickPolyline thick_polyline = Arachne::to_thick_polyline(path);
Line line(thick_polyline.front(), thick_polyline.back());
if (line.length() < thick_polyline.length()) {
extrusion_path_append(paths,
std::move(thick_polyline),
role,
flow,
overhang_sampling_number - 1);
continue;
}
extrusion_path_append(paths,
std::move(thick_polyline),
role,
flow,
overhang_sampling_number);
}
}
static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& perimeter_generator, std::vector<PerimeterGeneratorArachneExtrusion>& pg_extrusions) static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& perimeter_generator, std::vector<PerimeterGeneratorArachneExtrusion>& pg_extrusions)
{ {
ExtrusionEntityCollection extrusion_coll; ExtrusionEntityCollection extrusion_coll;
@ -841,9 +890,7 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
ExtrusionPaths paths; ExtrusionPaths paths;
// detect overhanging/bridging perimeters // detect overhanging/bridging perimeters
if (perimeter_generator.config->detect_overhang_wall && perimeter_generator.layer_id > perimeter_generator.object_config->raft_layers if (perimeter_generator.config->detect_overhang_wall && perimeter_generator.layer_id > perimeter_generator.object_config->raft_layers) {
&& !((perimeter_generator.object_config->enable_support || perimeter_generator.object_config->enforce_support_layers > 0) &&
perimeter_generator.object_config->support_top_z_distance.value == 0)) {
ClipperLib_Z::Path extrusion_path; ClipperLib_Z::Path extrusion_path;
extrusion_path.reserve(extrusion->size()); extrusion_path.reserve(extrusion->size());
BoundingBox extrusion_path_bbox; BoundingBox extrusion_path_bbox;
@ -928,9 +975,15 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
// get overhang paths by checking what parts of this loop fall // get overhang paths by checking what parts of this loop fall
// outside the grown lower slices (thus where the distance between // outside the grown lower slices (thus where the distance between
// the loop centerline and original lower slices is >= half nozzle diameter // the loop centerline and original lower slices is >= half nozzle diameter
extrusion_paths_append(paths, clip_extrusion(extrusion_path, lower_slices_paths, ClipperLib_Z::ctDifference), erOverhangPerimeter, // detect if the overhang perimeter is bridge
perimeter_generator.overhang_flow); ClipperLib_Z::Paths path_overhang = clip_extrusion(extrusion_path, lower_slices_paths, ClipperLib_Z::ctDifference);
bool zero_z_support = (perimeter_generator.object_config->enable_support || perimeter_generator.object_config->enforce_support_layers > 0) && perimeter_generator.object_config->support_top_z_distance.value == 0;
if(zero_z_support)
detect_brigde_wall_arachne(perimeter_generator, paths, path_overhang, role, is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow);
else
detect_brigde_wall_arachne(perimeter_generator, paths, path_overhang, erOverhangPerimeter, perimeter_generator.overhang_flow);
// Reapply the nearest point search for starting point. // Reapply the nearest point search for starting point.
// We allow polyline reversal because Clipper may have randomly reversed polylines during clipping. // We allow polyline reversal because Clipper may have randomly reversed polylines during clipping.
// Arachne sometimes creates extrusion with zero-length (just two same endpoints); // Arachne sometimes creates extrusion with zero-length (just two same endpoints);
@ -974,8 +1027,7 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
} }
} }
} } else {
else {
extrusion_paths_append(paths, *extrusion, role, is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow); extrusion_paths_append(paths, *extrusion, role, is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow);
} }

View File

@ -793,8 +793,9 @@ bool Preset::has_cali_lines(PresetBundle* preset_bundle)
static std::vector<std::string> s_Preset_print_options { static std::vector<std::string> s_Preset_print_options {
"layer_height", "initial_layer_print_height", "wall_loops", "slice_closing_radius", "spiral_mode", "spiral_mode_smooth", "spiral_mode_max_xy_smoothing", "slicing_mode", "layer_height", "initial_layer_print_height", "wall_loops", "slice_closing_radius", "spiral_mode", "spiral_mode_smooth", "spiral_mode_max_xy_smoothing", "slicing_mode",
"top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness", "top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness", "ensure_vertical_shell_thickness", "reduce_crossing_wall", "detect_thin_wall",
"ensure_vertical_shell_thickness", "reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall", "detect_overhang_wall",
"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", "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", "top_surface_pattern", "bottom_surface_pattern", "internal_solid_infill_pattern", "infill_direction", "bridge_angle",
"minimum_sparse_infill_area", "reduce_infill_retraction", "ironing_pattern", "ironing_type", "minimum_sparse_infill_area", "reduce_infill_retraction", "ironing_pattern", "ironing_type",
@ -833,7 +834,7 @@ static std::vector<std::string> s_Preset_print_options {
"tree_support_branch_diameter", "tree_support_branch_diameter",
"detect_narrow_internal_solid_infill", "detect_narrow_internal_solid_infill",
"gcode_add_line_number", "enable_arc_fitting", "precise_z_height", "infill_combination", /*"adaptive_layer_height",*/ "gcode_add_line_number", "enable_arc_fitting", "precise_z_height", "infill_combination", /*"adaptive_layer_height",*/
"support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed", "support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed", "overhang_totally_speed",
"initial_layer_infill_speed", "top_one_wall_type", "top_area_threshold", "only_one_wall_first_layer", "initial_layer_infill_speed", "top_one_wall_type", "top_area_threshold", "only_one_wall_first_layer",
"timelapse_type", "internal_bridge_support_thickness", "timelapse_type", "internal_bridge_support_thickness",
"wall_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle", "wall_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle",

View File

@ -885,6 +885,16 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloat(0));
def = this->add("overhang_totally_speed", coFloat);
def->label = "100% overhang wall (not bridge)";
def->category = L("Speed");
def->tooltip = L("Speed for line of wall which has degree of overhang over 100% line width, but the wall is not a bridge wall.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comAdvanced;
def->nullable = true;
def->set_default_value(new ConfigOptionFloat{24});
def = this->add("bridge_speed", coFloat); def = this->add("bridge_speed", coFloat);
def->label = L("Bridge"); def->label = L("Bridge");
def->category = L("Speed"); def->category = L("Speed");
@ -2541,6 +2551,20 @@ void PrintConfigDef::init_fff_params()
def->mode = comDevelop; def->mode = comDevelop;
def->set_default_value(new ConfigOptionBool(true)); def->set_default_value(new ConfigOptionBool(true));
def = this->add("smooth_speed_discontinuity_area", coBool);
def->label = L("Smooth speed discontinuity area");
def->category = L("Quality");
def->tooltip = L("Add the speed transition between discontinuity area.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(true));
def = this->add("smooth_coefficient", coFloat);
def->label = L("Smooth coefficient");
def->category = L("Quality");
def->tooltip = L("The smaller the number, the longer the speed transition path.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(80));
def = this->add("wall_filament", coInt); def = this->add("wall_filament", coInt);
//def->label = L("Walls"); //def->label = L("Walls");
//def->category = L("Extruders"); //def->category = L("Extruders");

View File

@ -777,6 +777,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, bottom_shell_thickness)) ((ConfigOptionFloat, bottom_shell_thickness))
((ConfigOptionFloat, bridge_angle)) ((ConfigOptionFloat, bridge_angle))
((ConfigOptionFloat, bridge_flow)) ((ConfigOptionFloat, bridge_flow))
((ConfigOptionFloat, overhang_totally_speed))
((ConfigOptionFloat, bridge_speed)) ((ConfigOptionFloat, bridge_speed))
((ConfigOptionBool, ensure_vertical_shell_thickness)) ((ConfigOptionBool, ensure_vertical_shell_thickness))
((ConfigOptionEnum<InfillPattern>, top_surface_pattern)) ((ConfigOptionEnum<InfillPattern>, top_surface_pattern))
@ -806,6 +807,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, ironing_speed)) ((ConfigOptionFloat, ironing_speed))
// Detect bridging perimeters // Detect bridging perimeters
((ConfigOptionBool, detect_overhang_wall)) ((ConfigOptionBool, detect_overhang_wall))
((ConfigOptionBool, smooth_speed_discontinuity_area))
((ConfigOptionFloat, smooth_coefficient))
((ConfigOptionInt, wall_filament)) ((ConfigOptionInt, wall_filament))
((ConfigOptionFloat, inner_wall_line_width)) ((ConfigOptionFloat, inner_wall_line_width))
((ConfigOptionFloat, inner_wall_speed)) ((ConfigOptionFloat, inner_wall_speed))

View File

@ -907,10 +907,13 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "wipe_speed" || opt_key == "wipe_speed"
|| opt_key == "support_speed" || opt_key == "support_speed"
|| opt_key == "support_interface_speed" || opt_key == "support_interface_speed"
|| opt_key == "smooth_speed_discontinuity_area"
|| opt_key == "smooth_coefficient"
|| opt_key == "overhang_1_4_speed" || opt_key == "overhang_1_4_speed"
|| opt_key == "overhang_2_4_speed" || opt_key == "overhang_2_4_speed"
|| opt_key == "overhang_3_4_speed" || opt_key == "overhang_3_4_speed"
|| opt_key == "overhang_4_4_speed" || opt_key == "overhang_4_4_speed"
|| opt_key == "overhang_totally_speed"
|| opt_key == "bridge_speed" || opt_key == "bridge_speed"
|| opt_key == "outer_wall_speed" || opt_key == "outer_wall_speed"
|| opt_key == "small_perimeter_speed" || opt_key == "small_perimeter_speed"

View File

@ -2,7 +2,7 @@
namespace Slic3r { namespace Slic3r {
ExtrusionMultiPath thick_polyline_to_multi_path(const ThickPolyline& thick_polyline, ExtrusionRole role, const Flow& flow, const float tolerance, const float merge_tolerance) ExtrusionMultiPath thick_polyline_to_multi_path(const ThickPolyline& thick_polyline, ExtrusionRole role, const Flow& flow, const float tolerance, const float merge_tolerance, int overhang)
{ {
ExtrusionMultiPath multi_path; ExtrusionMultiPath multi_path;
ExtrusionPath path(role); ExtrusionPath path(role);
@ -90,8 +90,10 @@ ExtrusionMultiPath thick_polyline_to_multi_path(const ThickPolyline& thick_polyl
} }
} }
} }
if (path.polyline.is_valid()) if( path.polyline.is_valid() ) {
path.overhang_degree = overhang;
multi_path.paths.emplace_back(std::move(path)); multi_path.paths.emplace_back(std::move(path));
}
return multi_path; return multi_path;
} }

View File

@ -6,7 +6,7 @@
#include "Flow.hpp" #include "Flow.hpp"
namespace Slic3r { namespace Slic3r {
ExtrusionMultiPath thick_polyline_to_multi_path(const ThickPolyline& thick_polyline, ExtrusionRole role, const Flow& flow, const float tolerance, const float merge_tolerance); ExtrusionMultiPath thick_polyline_to_multi_path(const ThickPolyline& thick_polyline, ExtrusionRole role, const Flow& flow, const float tolerance, const float merge_tolerance, int overhang);
void variable_width(const ThickPolylines& polylines, ExtrusionRole role, const Flow& flow, std::vector<ExtrusionEntity*>& out); void variable_width(const ThickPolylines& polylines, ExtrusionRole role, const Flow& flow, std::vector<ExtrusionEntity*>& out);
} }

View File

@ -103,8 +103,8 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::PART_CAT
{"infill_combination", "",1}, {"infill_wall_overlap", "",1}, {"infill_direction", "",1}, {"bridge_angle", "",1},{"minimum_sparse_infill_area", "",1} {"infill_combination", "",1}, {"infill_wall_overlap", "",1}, {"infill_direction", "",1}, {"bridge_angle", "",1},{"minimum_sparse_infill_area", "",1}
}}, }},
{ L("Speed"), {{"outer_wall_speed", "",1},{"inner_wall_speed", "",2},{"sparse_infill_speed", "",3},{"top_surface_speed", "",4}, {"internal_solid_infill_speed", "",5}, { L("Speed"), {{"outer_wall_speed", "",1},{"inner_wall_speed", "",2},{"sparse_infill_speed", "",3},{"top_surface_speed", "",4}, {"internal_solid_infill_speed", "",5},
{"enable_overhang_speed", "",6}, {"overhang_1_4_speed", "",7}, {"overhang_2_4_speed", "",8}, {"overhang_3_4_speed", "",9}, {"overhang_4_4_speed", "",10}, {"enable_overhang_speed", "",6}, {"overhang_1_4_speed", "",7}, {"overhang_2_4_speed", "",8}, {"overhang_3_4_speed", "",9}, {"overhang_4_4_speed", "",10}, {"overhang_totally_speed", "",11},
{"bridge_speed", "",11}, {"gap_infill_speed", "",12} {"bridge_speed", "",12}, {"gap_infill_speed", "",13}
}} }}
}; };

View File

@ -1987,6 +1987,8 @@ void TabPrint::build()
optgroup->append_single_option_line("top_area_threshold"); optgroup->append_single_option_line("top_area_threshold");
optgroup->append_single_option_line("only_one_wall_first_layer"); optgroup->append_single_option_line("only_one_wall_first_layer");
optgroup->append_single_option_line("detect_overhang_wall"); optgroup->append_single_option_line("detect_overhang_wall");
optgroup->append_single_option_line("smooth_speed_discontinuity_area");
optgroup->append_single_option_line("smooth_coefficient");
optgroup->append_single_option_line("reduce_crossing_wall"); optgroup->append_single_option_line("reduce_crossing_wall");
optgroup->append_single_option_line("max_travel_detour_distance"); optgroup->append_single_option_line("max_travel_detour_distance");
@ -2042,6 +2044,7 @@ void TabPrint::build()
line.append_option(optgroup->get_option("overhang_3_4_speed")); line.append_option(optgroup->get_option("overhang_3_4_speed"));
line.append_option(optgroup->get_option("overhang_4_4_speed")); line.append_option(optgroup->get_option("overhang_4_4_speed"));
optgroup->append_line(line); optgroup->append_line(line);
optgroup->append_single_option_line("overhang_totally_speed");
optgroup->append_single_option_line("bridge_speed"); optgroup->append_single_option_line("bridge_speed");
optgroup->append_single_option_line("gap_infill_speed"); optgroup->append_single_option_line("gap_infill_speed");
optgroup->append_single_option_line("support_speed"); optgroup->append_single_option_line("support_speed");