mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Added new options for SLAPrintSettings (faded_layers) and SLAPrinterSettings (fast/slow_tilt_time and area_fill)
This commit is contained in:
		
							parent
							
								
									a690466dbf
								
							
						
					
					
						commit
						9d0acc010d
					
				
					 5 changed files with 63 additions and 10 deletions
				
			
		|  | @ -2435,6 +2435,32 @@ void PrintConfigDef::init_sla_params() | |||
|     def->enum_labels.push_back(L("Portrait")); | ||||
|     def->default_value = new ConfigOptionEnum<SLADisplayOrientation>(sladoPortrait); | ||||
| 
 | ||||
|     def = this->add("fast_tilt_time", coFloat); | ||||
|     def->label = L("Fast"); | ||||
|     def->full_label = L("Fast tilt"); | ||||
|     def->tooltip = L("Time of the fast tilt"); | ||||
|     def->sidetext = L("s"); | ||||
|     def->min = 0; | ||||
|     def->mode = comExpert; | ||||
|     def->default_value = new ConfigOptionFloat(5.); | ||||
| 
 | ||||
|     def = this->add("slow_tilt_time", coFloat); | ||||
|     def->label = L("Slow"); | ||||
|     def->full_label = L("Slow tilt"); | ||||
|     def->tooltip = L("Time of the slow tilt"); | ||||
|     def->sidetext = L("s"); | ||||
|     def->min = 0; | ||||
|     def->mode = comExpert; | ||||
|     def->default_value = new ConfigOptionFloat(8.); | ||||
| 
 | ||||
|     def = this->add("area_fill", coFloat); | ||||
|     def->label = L("Area fill"); | ||||
|     def->tooltip = L("The percentage of the bed area. \nIf the print area exceeds the specified value, \nthen a slow tilt will be used, otherwise - a fast tilt"); | ||||
|     def->sidetext = L("%"); | ||||
|     def->min = 0; | ||||
|     def->mode = comExpert; | ||||
|     def->default_value = new ConfigOptionFloat(50.); | ||||
| 
 | ||||
|     def = this->add("printer_correction", coFloats); | ||||
|     def->full_label = L("Printer scaling correction"); | ||||
|     def->tooltip  = L("Printer scaling correction"); | ||||
|  | @ -2450,6 +2476,14 @@ void PrintConfigDef::init_sla_params() | |||
|     def->min = 0; | ||||
|     def->default_value = new ConfigOptionFloat(0.3); | ||||
| 
 | ||||
|     def = this->add("faded_layers", coInt); | ||||
|     def->label = L("Faded layers"); | ||||
|     def->tooltip = L("Number of the layers needed for the exposure time fade from initial exposure time to the exposure time"); | ||||
|     def->min = 3; | ||||
|     def->max = 20; | ||||
|     def->mode = comExpert; | ||||
|     def->default_value = new ConfigOptionInt(10); | ||||
| 
 | ||||
|     def = this->add("exposure_time", coFloat); | ||||
|     def->label = L("Exposure time"); | ||||
|     def->tooltip = L("Exposure time"); | ||||
|  |  | |||
|  | @ -958,6 +958,9 @@ class SLAPrintObjectConfig : public StaticPrintConfig | |||
| public: | ||||
|     ConfigOptionFloat layer_height; | ||||
| 
 | ||||
|     //Number of the layers needed for the exposure time fade [3;20]
 | ||||
|     ConfigOptionInt  faded_layers /*= 10*/; | ||||
| 
 | ||||
|     // Enabling or disabling support creation
 | ||||
|     ConfigOptionBool  supports_enable; | ||||
| 
 | ||||
|  | @ -1028,6 +1031,7 @@ protected: | |||
|     void initialize(StaticCacheBase &cache, const char *base_ptr) | ||||
|     { | ||||
|         OPT_PTR(layer_height); | ||||
|         OPT_PTR(faded_layers); | ||||
|         OPT_PTR(supports_enable); | ||||
|         OPT_PTR(support_head_front_diameter); | ||||
|         OPT_PTR(support_head_penetration); | ||||
|  | @ -1085,6 +1089,9 @@ public: | |||
|     ConfigOptionInt                         display_pixels_y; | ||||
|     ConfigOptionEnum<SLADisplayOrientation> display_orientation; | ||||
|     ConfigOptionFloats                      printer_correction; | ||||
|     ConfigOptionFloat                       fast_tilt_time; | ||||
|     ConfigOptionFloat                       slow_tilt_time; | ||||
|     ConfigOptionFloat                       area_fill; | ||||
| protected: | ||||
|     void initialize(StaticCacheBase &cache, const char *base_ptr) | ||||
|     { | ||||
|  | @ -1097,6 +1104,9 @@ protected: | |||
|         OPT_PTR(display_pixels_y); | ||||
|         OPT_PTR(display_orientation); | ||||
|         OPT_PTR(printer_correction); | ||||
|         OPT_PTR(fast_tilt_time); | ||||
|         OPT_PTR(slow_tilt_time); | ||||
|         OPT_PTR(area_fill); | ||||
|     } | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -1005,7 +1005,10 @@ bool SLAPrint::invalidate_state_by_config_options(const std::vector<t_config_opt | |||
|         "bed_shape", | ||||
|         "max_print_height", | ||||
|         "printer_technology", | ||||
|         "output_filename_format" | ||||
|         "output_filename_format", | ||||
|         "fast_tilt_time",  | ||||
|         "slow_tilt_time",  | ||||
|         "area_fill" | ||||
|     }; | ||||
| 
 | ||||
|     std::vector<SLAPrintStep> steps; | ||||
|  | @ -1043,18 +1046,14 @@ void SLAPrint::fill_statistics() | |||
|     const double init_layer_height  = m_material_config.initial_layer_height.getFloat(); | ||||
|     const double layer_height       = m_default_object_config.layer_height.getFloat(); | ||||
| 
 | ||||
|     // TODO : slow_fast_limit, fast_tilt, slow_tilt should be filled in the future
 | ||||
|     // These variables will be a part of the printer preset
 | ||||
|     const double slow_fast_limit    = 0.5; // if printing area is more than 50% of the bed area, then use a slow tilt
 | ||||
|     const double fast_tilt          = 5.0; | ||||
|     const double slow_tilt          = 8.0; | ||||
|     const double area_fill          = m_printer_config.area_fill.getFloat()*0.01;// 0.5 (50%);
 | ||||
|     const double fast_tilt          = m_printer_config.fast_tilt_time.getFloat();// 5.0;
 | ||||
|     const double slow_tilt          = m_printer_config.slow_tilt_time.getFloat();// 8.0;
 | ||||
| 
 | ||||
|     const double init_exp_time      = m_material_config.initial_exposure_time.getFloat(); | ||||
|     const double exp_time           = m_material_config.exposure_time.getFloat(); | ||||
| 
 | ||||
|     // TODO : fade_layers_cnt should be filled in the future
 | ||||
|     // This variable will be a part of the print preset
 | ||||
|     const int fade_layers_cnt       = 10; // [3;20]
 | ||||
|     const int fade_layers_cnt       = m_default_object_config.faded_layers.getInt();// 10 // [3;20]
 | ||||
| 
 | ||||
|     const double width              = m_printer_config.display_width.getFloat() / SCALING_FACTOR; | ||||
|     const double height             = m_printer_config.display_height.getFloat() / SCALING_FACTOR; | ||||
|  | @ -1116,7 +1115,7 @@ void SLAPrint::fill_statistics() | |||
| 
 | ||||
|         // Calculation of the slow and fast layers to the future controlling those values on FW
 | ||||
| 
 | ||||
|         const bool is_fast_layer = (layer_model_area + layer_support_area) <= display_area*slow_fast_limit; | ||||
|         const bool is_fast_layer = (layer_model_area + layer_support_area) <= display_area*area_fill; | ||||
|         const double tilt_time = is_fast_layer ? fast_tilt : slow_tilt; | ||||
|         if (is_fast_layer) | ||||
|             fast_layers++; | ||||
|  |  | |||
|  | @ -408,6 +408,7 @@ const std::vector<std::string>& Preset::sla_print_options() | |||
|     if (s_opts.empty()) { | ||||
|         s_opts = { | ||||
|             "layer_height", | ||||
|             "faded_layers", | ||||
|             "supports_enable", | ||||
|             "support_head_front_diameter", | ||||
|             "support_head_penetration", | ||||
|  | @ -465,6 +466,7 @@ const std::vector<std::string>& Preset::sla_printer_options() | |||
|             "bed_shape", "max_print_height", | ||||
|             "display_width", "display_height", "display_pixels_x", "display_pixels_y", | ||||
|             "display_orientation", | ||||
|             "fast_tilt_time", "slow_tilt_time", "area_fill", | ||||
|             "printer_correction", | ||||
|             "print_host", "printhost_apikey", "printhost_cafile", | ||||
|             "printer_notes", | ||||
|  |  | |||
|  | @ -1949,6 +1949,13 @@ void TabPrinter::build_sla() | |||
|     optgroup->append_line(line); | ||||
|     optgroup->append_single_option_line("display_orientation"); | ||||
| 
 | ||||
|     optgroup = page->new_optgroup(_(L("Tilt"))); | ||||
|     line = { _(L("Tilt time")), "" }; | ||||
|     line.append_option(optgroup->get_option("fast_tilt_time")); | ||||
|     line.append_option(optgroup->get_option("slow_tilt_time")); | ||||
|     optgroup->append_line(line); | ||||
|     optgroup->append_single_option_line("area_fill"); | ||||
| 
 | ||||
|     optgroup = page->new_optgroup(_(L("Corrections"))); | ||||
|     line = Line{ m_config->def()->get("printer_correction")->full_label, "" }; | ||||
|     std::vector<std::string> axes{ "X", "Y", "Z" }; | ||||
|  | @ -3178,6 +3185,7 @@ void TabSLAPrint::build() | |||
| 
 | ||||
|     auto optgroup = page->new_optgroup(_(L("Layers"))); | ||||
|     optgroup->append_single_option_line("layer_height"); | ||||
|     optgroup->append_single_option_line("faded_layers"); | ||||
| 
 | ||||
|     page = add_options_page(_(L("Supports")), "building.png"); | ||||
|     optgroup = page->new_optgroup(_(L("Supports"))); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka