mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Number of slow layers #796
This commit is contained in:
		
							parent
							
								
									117cda00bc
								
							
						
					
					
						commit
						be4373583f
					
				
					 7 changed files with 35 additions and 3 deletions
				
			
		|  | @ -4000,6 +4000,21 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, | ||||||
|         if (path.role() != erBottomSurface) |         if (path.role() != erBottomSurface) | ||||||
|             speed = m_config.get_abs_value("initial_layer_speed"); |             speed = m_config.get_abs_value("initial_layer_speed"); | ||||||
|     } |     } | ||||||
|  |     else if(m_config.slow_down_layers > 1){ | ||||||
|  |         const auto _layer = layer_id() + 1; | ||||||
|  |         if (_layer > 0 && _layer < m_config.slow_down_layers) { | ||||||
|  |             const auto first_layer_speed = | ||||||
|  |                 is_perimeter(path.role()) | ||||||
|  |                     ? m_config.get_abs_value("initial_layer_speed") | ||||||
|  |                     : m_config.get_abs_value("initial_layer_infill_speed"); | ||||||
|  |             if (first_layer_speed < speed) { | ||||||
|  |                 speed = std::min( | ||||||
|  |                     speed, | ||||||
|  |                     Slic3r::lerp(first_layer_speed, speed, | ||||||
|  |                                  (double)_layer / m_config.slow_down_layers)); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|     //BBS: remove this config
 |     //BBS: remove this config
 | ||||||
|     //else if (this->object_layer_over_raft())
 |     //else if (this->object_layer_over_raft())
 | ||||||
|     //    speed = m_config.get_abs_value("first_layer_speed_over_raft", speed);
 |     //    speed = m_config.get_abs_value("first_layer_speed_over_raft", speed);
 | ||||||
|  |  | ||||||
|  | @ -512,6 +512,11 @@ private: | ||||||
|     // On the first printing layer. This flag triggers first layer speeds.
 |     // On the first printing layer. This flag triggers first layer speeds.
 | ||||||
|     //BBS
 |     //BBS
 | ||||||
|     bool    on_first_layer() const { return m_layer != nullptr && m_layer->id() == 0 && abs(m_layer->bottom_z()) < EPSILON; } |     bool    on_first_layer() const { return m_layer != nullptr && m_layer->id() == 0 && abs(m_layer->bottom_z()) < EPSILON; } | ||||||
|  |     int layer_id() const { | ||||||
|  |         if (m_layer == nullptr) | ||||||
|  |             return -1; | ||||||
|  |         return m_layer->id(); | ||||||
|  |     } | ||||||
|     // To control print speed of 1st object layer over raft interface.
 |     // To control print speed of 1st object layer over raft interface.
 | ||||||
|     bool                                object_layer_over_raft() const { return m_object_layer_over_raft; } |     bool                                object_layer_over_raft() const { return m_object_layer_over_raft; } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -756,7 +756,7 @@ static std::vector<std::string> s_Preset_print_options { | ||||||
|      "bridge_density", "precise_outer_wall", "overhang_speed_classic", "bridge_acceleration", |      "bridge_density", "precise_outer_wall", "overhang_speed_classic", "bridge_acceleration", | ||||||
|      "sparse_infill_acceleration", "internal_solid_infill_acceleration", "tree_support_adaptive_layer_height", "tree_support_auto_brim",  |      "sparse_infill_acceleration", "internal_solid_infill_acceleration", "tree_support_adaptive_layer_height", "tree_support_auto_brim",  | ||||||
|      "tree_support_brim_width", "gcode_comments", "gcode_label_objects", |      "tree_support_brim_width", "gcode_comments", "gcode_label_objects", | ||||||
|      "initial_layer_travel_speed", "exclude_object" |      "initial_layer_travel_speed", "exclude_object", "slow_down_layers" | ||||||
| 
 | 
 | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -229,7 +229,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n | ||||||
|             || opt_key == "travel_speed" |             || opt_key == "travel_speed" | ||||||
|             || opt_key == "travel_speed_z" |             || opt_key == "travel_speed_z" | ||||||
|             || opt_key == "initial_layer_speed" |             || opt_key == "initial_layer_speed" | ||||||
|             || opt_key == "initial_layer_travel_speed") { |             || opt_key == "initial_layer_travel_speed" | ||||||
|  |             || opt_key == "slow_down_layers") { | ||||||
|             //|| opt_key == "z_offset") {
 |             //|| opt_key == "z_offset") {
 | ||||||
|             steps.emplace_back(psWipeTower); |             steps.emplace_back(psWipeTower); | ||||||
|             steps.emplace_back(psSkirtBrim); |             steps.emplace_back(psSkirtBrim); | ||||||
|  |  | ||||||
|  | @ -1631,6 +1631,14 @@ void PrintConfigDef::init_fff_params() | ||||||
|     def->mode = comAdvanced; |     def->mode = comAdvanced; | ||||||
|     def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); |     def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); | ||||||
| 
 | 
 | ||||||
|  |     def = this->add("slow_down_layers", coInt); | ||||||
|  |     def->label = L("Number of slow layers"); | ||||||
|  |     def->tooltip = L("The first few layers are printed slower than normal. " | ||||||
|  |                      "The speed is gradually increased in a linear fashion over the specified number of layers."); | ||||||
|  |     def->category = L("Speed"); | ||||||
|  |     def->min = 0; | ||||||
|  |     def->mode = comAdvanced; | ||||||
|  |     def->set_default_value(new ConfigOptionInt(0)); | ||||||
| 
 | 
 | ||||||
|     def = this->add("nozzle_temperature_initial_layer", coInts); |     def = this->add("nozzle_temperature_initial_layer", coInts); | ||||||
|     def->label = L("Initial layer"); |     def->label = L("Initial layer"); | ||||||
|  |  | ||||||
|  | @ -1010,6 +1010,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( | ||||||
|     ((ConfigOptionBool,                gcode_label_objects)) |     ((ConfigOptionBool,                gcode_label_objects)) | ||||||
|     ((ConfigOptionBool,                exclude_object)) |     ((ConfigOptionBool,                exclude_object)) | ||||||
|     ((ConfigOptionBool,                gcode_comments)) |     ((ConfigOptionBool,                gcode_comments)) | ||||||
|  |     ((ConfigOptionInt,                 slow_down_layers)) | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1922,6 +1922,7 @@ void TabPrint::build() | ||||||
|         optgroup->append_single_option_line("initial_layer_speed"); |         optgroup->append_single_option_line("initial_layer_speed"); | ||||||
|         optgroup->append_single_option_line("initial_layer_infill_speed"); |         optgroup->append_single_option_line("initial_layer_infill_speed"); | ||||||
|         optgroup->append_single_option_line("initial_layer_travel_speed"); |         optgroup->append_single_option_line("initial_layer_travel_speed"); | ||||||
|  |         optgroup->append_single_option_line("slow_down_layers"); | ||||||
|         optgroup = page->new_optgroup(L("Other layers speed"), L"param_speed", 15); |         optgroup = page->new_optgroup(L("Other layers speed"), L"param_speed", 15); | ||||||
|         optgroup->append_single_option_line("outer_wall_speed"); |         optgroup->append_single_option_line("outer_wall_speed"); | ||||||
|         optgroup->append_single_option_line("inner_wall_speed"); |         optgroup->append_single_option_line("inner_wall_speed"); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 SoftFever
						SoftFever