mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 12:41:20 -06:00 
			
		
		
		
	ENH: support specific acceleration for outer wall
So we can set lower acceleration for outer wall now. Signed-off-by: salt.wei <salt.wei@bambulab.com> Change-Id: Ib4728bf16f6c540afca62f423c8aab4c9e0c4d02
This commit is contained in:
		
							parent
							
								
									9c32cff1dd
								
							
						
					
					
						commit
						5e024f75b9
					
				
					 8 changed files with 23 additions and 7 deletions
				
			
		|  | @ -1465,9 +1465,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato | |||
|     // Emit machine envelope limits for the Marlin firmware.
 | ||||
|     this->print_machine_envelope(file, print); | ||||
| 
 | ||||
|     //BBS: emit printing accelerate if has non-zero value
 | ||||
|     //BBS: emit outer wall accelerate if has non-zero value
 | ||||
|     if (m_config.default_acceleration.value > 0) { | ||||
|         float acceleration = m_config.default_acceleration.value; | ||||
|         float acceleration = m_config.outer_wall_acceleration.value > 0 ? | ||||
|                              m_config.outer_wall_acceleration.value : m_config.default_acceleration.value; | ||||
|         file.write(m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5))); | ||||
|     } | ||||
| 
 | ||||
|  | @ -3538,9 +3539,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, | |||
|             acceleration = m_config.first_layer_acceleration_over_raft.value; | ||||
|         } else if (m_config.bridge_acceleration.value > 0 && is_bridge(path.role())) { | ||||
|             acceleration = m_config.bridge_acceleration.value; | ||||
|         } else if (m_config.perimeter_acceleration.value > 0 && is_perimeter(path.role())) { | ||||
|             acceleration = m_config.perimeter_acceleration.value; | ||||
| #endif | ||||
|         } else if (m_config.outer_wall_acceleration.value > 0 | ||||
|             //BBS: FIXME, in fact,we only need to set acceleration for outer wall. But we don't know
 | ||||
|             //whether the overhang perimeter is outer or not. So using specific acceleration together.
 | ||||
|             && (path.role() == erExternalPerimeter || path.role() == erOverhangPerimeter)) { | ||||
|             acceleration = m_config.outer_wall_acceleration.value; | ||||
|         } else if (m_config.top_surface_acceleration.value > 0 && is_top_surface(path.role())) { | ||||
|             acceleration = m_config.top_surface_acceleration.value; | ||||
|         } else { | ||||
|  |  | |||
|  | @ -705,7 +705,7 @@ static std::vector<std::string> s_Preset_print_options { | |||
|     "inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed", | ||||
|     "top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed", | ||||
|     "bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", | ||||
|     "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield", | ||||
|     "outer_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield", | ||||
|     "brim_width", "brim_object_gap", "brim_type", "enable_support", "support_type", "support_threshold_angle", "enforce_support_layers", | ||||
|     "raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion", | ||||
|     "support_base_pattern", "support_base_pattern_spacing", "support_style", | ||||
|  |  | |||
|  | @ -92,6 +92,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n | |||
|         "filament_density", | ||||
|         "filament_cost", | ||||
|         "initial_layer_acceleration", | ||||
|         "outer_wall_acceleration", | ||||
|         "top_surface_acceleration", | ||||
|         // BBS
 | ||||
|         "cool_plate_temp_initial_layer", | ||||
|  |  | |||
|  | @ -1255,6 +1255,14 @@ void PrintConfigDef::init_fff_params() | |||
|     def->mode = comAdvanced; | ||||
|     def->set_default_value(new ConfigOptionFloat(500)); | ||||
| 
 | ||||
|     def = this->add("outer_wall_acceleration", coFloat); | ||||
|     def->label = L("Outer wall"); | ||||
|     def->tooltip = L("Acceleration of outer wall. Using a lower value can improve quality"); | ||||
|     def->sidetext = L("mm/s²"); | ||||
|     def->min = 0; | ||||
|     def->mode = comAdvanced; | ||||
|     def->set_default_value(new ConfigOptionFloat(500)); | ||||
| 
 | ||||
|     def = this->add("initial_layer_acceleration", coFloat); | ||||
|     def->label = L("Initial layer"); | ||||
|     def->tooltip = L("Acceleration of initial layer. Using a lower value can improve build plate adhensive"); | ||||
|  | @ -3997,7 +4005,7 @@ std::string validate(const FullPrintConfig &cfg) | |||
|     // config before exporting, leaving this check in would mean that config would be rejected before export
 | ||||
|     // (although both the UI and the backend handle it).
 | ||||
|     // --default-acceleration
 | ||||
|     //if ((cfg.perimeter_acceleration != 0. || cfg.infill_acceleration != 0. || cfg.bridge_acceleration != 0. || cfg.initial_layer_acceleration != 0.) &&
 | ||||
|     //if ((cfg.outer_wall_acceleration != 0. || cfg.infill_acceleration != 0. || cfg.bridge_acceleration != 0. || cfg.initial_layer_acceleration != 0.) &&
 | ||||
|     //    cfg.default_acceleration == 0.)
 | ||||
|     //    return "Invalid zero value for --default-acceleration when using other acceleration settings";
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -833,6 +833,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( | |||
|     ((ConfigOptionInts,               fan_cooling_layer_time)) | ||||
|     ((ConfigOptionStrings,            filament_colour)) | ||||
|     ((ConfigOptionFloat,              top_surface_acceleration)) | ||||
|     ((ConfigOptionFloat,              outer_wall_acceleration)) | ||||
|     ((ConfigOptionFloat,              initial_layer_acceleration)) | ||||
|     ((ConfigOptionFloat,              initial_layer_line_width)) | ||||
|     ((ConfigOptionFloat,              initial_layer_print_height)) | ||||
|  |  | |||
|  | @ -503,7 +503,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co | |||
| 
 | ||||
|     bool have_default_acceleration = config->opt_float("default_acceleration") > 0; | ||||
|     //BBS
 | ||||
|     for (auto el : { "initial_layer_acceleration", "top_surface_acceleration" }) | ||||
|     for (auto el : { "initial_layer_acceleration", "outer_wall_acceleration", "top_surface_acceleration" }) | ||||
|         toggle_field(el, have_default_acceleration); | ||||
| 
 | ||||
|     bool have_skirt = config->opt_int("skirt_loops") > 0; | ||||
|  |  | |||
|  | @ -1837,6 +1837,7 @@ void TabPrint::build() | |||
| 
 | ||||
|         optgroup = page->new_optgroup(L("Acceleration"), L"param_acceleration", 15); | ||||
|         optgroup->append_single_option_line("initial_layer_acceleration"); | ||||
|         optgroup->append_single_option_line("outer_wall_acceleration"); | ||||
|         optgroup->append_single_option_line("top_surface_acceleration"); | ||||
|         optgroup->append_single_option_line("default_acceleration"); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 salt.wei
						salt.wei