mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer
This commit is contained in:
		
						commit
						d4b20fa396
					
				
					 8 changed files with 32 additions and 27 deletions
				
			
		|  | @ -2640,8 +2640,7 @@ void PrintConfigDef::init_sla_params() | ||||||
|     def->label = L("Object elevation"); |     def->label = L("Object elevation"); | ||||||
|     def->category = L("Supports"); |     def->category = L("Supports"); | ||||||
|     def->tooltip = L("How much the supports should lift up the supported object. " |     def->tooltip = L("How much the supports should lift up the supported object. " | ||||||
|                      "If this value is zero, the bottom of the model geometry " |                      "If \"Pad around object\" is enabled, this value is ignored."); | ||||||
|                      "will be considered as part of the pad."); |  | ||||||
|     def->sidetext = L("mm"); |     def->sidetext = L("mm"); | ||||||
|     def->min = 0; |     def->min = 0; | ||||||
|     def->max = 150; // This is the max height of print on SL1
 |     def->max = 150; // This is the max height of print on SL1
 | ||||||
|  | @ -2728,7 +2727,7 @@ void PrintConfigDef::init_sla_params() | ||||||
|     def->mode = comAdvanced; |     def->mode = comAdvanced; | ||||||
|     def->set_default_value(new ConfigOptionFloat(45.0)); |     def->set_default_value(new ConfigOptionFloat(45.0)); | ||||||
| 
 | 
 | ||||||
|     def = this->add("pad_zero_elevation", coBool); |     def = this->add("pad_around_object", coBool); | ||||||
|     def->label = L("Pad around object"); |     def->label = L("Pad around object"); | ||||||
|     def->category = L("Pad"); |     def->category = L("Pad"); | ||||||
|     def->tooltip = L("Create pad around object and ignore the support elevation"); |     def->tooltip = L("Create pad around object and ignore the support elevation"); | ||||||
|  |  | ||||||
|  | @ -1042,7 +1042,7 @@ public: | ||||||
|     // /////////////////////////////////////////////////////////////////////////
 |     // /////////////////////////////////////////////////////////////////////////
 | ||||||
| 
 | 
 | ||||||
|     // Disable the elevation (ignore its value) and use the zero elevation mode
 |     // Disable the elevation (ignore its value) and use the zero elevation mode
 | ||||||
|     ConfigOptionBool  pad_zero_elevation; |     ConfigOptionBool  pad_around_object; | ||||||
| 
 | 
 | ||||||
|     // This is the gap between the object bottom and the generated pad
 |     // This is the gap between the object bottom and the generated pad
 | ||||||
|     ConfigOptionFloat pad_object_gap; |     ConfigOptionFloat pad_object_gap; | ||||||
|  | @ -1085,7 +1085,7 @@ protected: | ||||||
|         OPT_PTR(pad_max_merge_distance); |         OPT_PTR(pad_max_merge_distance); | ||||||
|         // OPT_PTR(pad_edge_radius);
 |         // OPT_PTR(pad_edge_radius);
 | ||||||
|         OPT_PTR(pad_wall_slope); |         OPT_PTR(pad_wall_slope); | ||||||
|         OPT_PTR(pad_zero_elevation); |         OPT_PTR(pad_around_object); | ||||||
|         OPT_PTR(pad_object_gap); |         OPT_PTR(pad_object_gap); | ||||||
|         OPT_PTR(pad_object_connector_stride); |         OPT_PTR(pad_object_connector_stride); | ||||||
|         OPT_PTR(pad_object_connector_width); |         OPT_PTR(pad_object_connector_width); | ||||||
|  |  | ||||||
|  | @ -577,12 +577,7 @@ std::string SLAPrint::output_filename(const std::string &filename_base) const | ||||||
| namespace { | namespace { | ||||||
| 
 | 
 | ||||||
| bool is_zero_elevation(const SLAPrintObjectConfig &c) { | bool is_zero_elevation(const SLAPrintObjectConfig &c) { | ||||||
|     bool en_implicit = c.support_object_elevation.getFloat() <= EPSILON && |     return c.pad_enable.getBool() && c.pad_around_object.getBool(); | ||||||
|                        c.pad_enable.getBool() && c.supports_enable.getBool(); |  | ||||||
|     bool en_explicit = c.pad_zero_elevation.getBool() && |  | ||||||
|                        c.supports_enable.getBool(); |  | ||||||
| 
 |  | ||||||
|     return en_implicit || en_explicit; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Compile the argument for support creation from the static print config.
 | // Compile the argument for support creation from the static print config.
 | ||||||
|  | @ -676,12 +671,13 @@ std::string SLAPrint::validate() const | ||||||
| 
 | 
 | ||||||
|         double elv = cfg.object_elevation_mm; |         double elv = cfg.object_elevation_mm; | ||||||
| 
 | 
 | ||||||
|         if(supports_en && elv > EPSILON && elv < pinhead_width ) |         sla::PoolConfig::EmbedObject builtinpad = builtin_pad_cfg(po->config()); | ||||||
|  |          | ||||||
|  |         if(supports_en && !builtinpad.enabled && elv < pinhead_width ) | ||||||
|             return L( |             return L( | ||||||
|                 "Elevation is too low for object. Use the \"Pad around " |                 "Elevation is too low for object. Use the \"Pad around " | ||||||
|                 "obect\" feature to print the object without elevation."); |                 "obect\" feature to print the object without elevation."); | ||||||
|          |          | ||||||
|         sla::PoolConfig::EmbedObject builtinpad = builtin_pad_cfg(po->config()); |  | ||||||
|         if(supports_en && builtinpad.enabled && |         if(supports_en && builtinpad.enabled && | ||||||
|            cfg.pillar_base_safety_distance_mm < builtinpad.object_gap_mm) { |            cfg.pillar_base_safety_distance_mm < builtinpad.object_gap_mm) { | ||||||
|             return L( |             return L( | ||||||
|  | @ -1698,7 +1694,7 @@ bool SLAPrintObject::invalidate_state_by_config_options(const std::vector<t_conf | ||||||
|             || opt_key == "pad_wall_thickness" |             || opt_key == "pad_wall_thickness" | ||||||
|             || opt_key == "supports_enable" |             || opt_key == "supports_enable" | ||||||
|             || opt_key == "support_object_elevation" |             || opt_key == "support_object_elevation" | ||||||
|             || opt_key == "pad_zero_elevation" |             || opt_key == "pad_around_object" | ||||||
|             || opt_key == "slice_closing_radius") { |             || opt_key == "slice_closing_radius") { | ||||||
|             steps.emplace_back(slaposObjectSlice); |             steps.emplace_back(slaposObjectSlice); | ||||||
|         } else if ( |         } else if ( | ||||||
|  |  | ||||||
|  | @ -1130,13 +1130,13 @@ void GLVolumeCollection::export_toolpaths_to_obj(const char* filename) const | ||||||
|         fprintf(fp, "\n# vertices volume %d\n", volumes_count); |         fprintf(fp, "\n# vertices volume %d\n", volumes_count); | ||||||
|         for (const Vector& v : dst_vertices) |         for (const Vector& v : dst_vertices) | ||||||
|         { |         { | ||||||
|             fprintf(fp, "v %f %f %f\n", unscale<float>(v.vector[0]), unscale<float>(v.vector[1]), unscale<float>(v.vector[2])); |             fprintf(fp, "v %g %g %g\n", unscale<float>(v.vector[0]), unscale<float>(v.vector[1]), unscale<float>(v.vector[2])); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         fprintf(fp, "\n# normals volume %d\n", volumes_count); |         fprintf(fp, "\n# normals volume %d\n", volumes_count); | ||||||
|         for (const Vector& n : dst_normals) |         for (const Vector& n : dst_normals) | ||||||
|         { |         { | ||||||
|             fprintf(fp, "vn %f %f %f\n", unscale<float>(n.vector[0]), unscale<float>(n.vector[1]), unscale<float>(n.vector[2])); |             fprintf(fp, "vn %g %g %g\n", unscale<float>(n.vector[0]), unscale<float>(n.vector[1]), unscale<float>(n.vector[2])); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         Color color; |         Color color; | ||||||
|  |  | ||||||
|  | @ -351,10 +351,10 @@ void ConfigManipulation::toggle_print_sla_options(DynamicPrintConfig* config) | ||||||
|     toggle_field("pad_max_merge_distance", pad_en); |     toggle_field("pad_max_merge_distance", pad_en); | ||||||
|  // toggle_field("pad_edge_radius", supports_en);
 |  // toggle_field("pad_edge_radius", supports_en);
 | ||||||
|     toggle_field("pad_wall_slope", pad_en); |     toggle_field("pad_wall_slope", pad_en); | ||||||
|     toggle_field("pad_zero_elevation", pad_en); |     toggle_field("pad_around_object", pad_en); | ||||||
| 
 | 
 | ||||||
|     bool has_suppad = pad_en && supports_en; |     bool has_suppad = pad_en && supports_en; | ||||||
|     bool zero_elev = config->opt_bool("pad_zero_elevation") && has_suppad; |     bool zero_elev = config->opt_bool("pad_around_object") && has_suppad; | ||||||
| 
 | 
 | ||||||
|     toggle_field("support_object_elevation", supports_en && !zero_elev); |     toggle_field("support_object_elevation", supports_en && !zero_elev); | ||||||
|     toggle_field("pad_object_gap", zero_elev); |     toggle_field("pad_object_gap", zero_elev); | ||||||
|  |  | ||||||
|  | @ -563,9 +563,9 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent) : | ||||||
|             new_conf.set_key_value("pad_enable", new ConfigOptionBool(pad_enable)); |             new_conf.set_key_value("pad_enable", new ConfigOptionBool(pad_enable)); | ||||||
| 
 | 
 | ||||||
|             if (selection == _("Below object")) |             if (selection == _("Below object")) | ||||||
|                 new_conf.set_key_value("pad_zero_elevation", new ConfigOptionBool(false)); |                 new_conf.set_key_value("pad_around_object", new ConfigOptionBool(false)); | ||||||
|             else if (selection == _("Around object")) |             else if (selection == _("Around object")) | ||||||
|                 new_conf.set_key_value("pad_zero_elevation", new ConfigOptionBool(true)); |                 new_conf.set_key_value("pad_around_object", new ConfigOptionBool(true)); | ||||||
|         } |         } | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
|  |  | ||||||
|  | @ -480,7 +480,7 @@ const std::vector<std::string>& Preset::sla_print_options() | ||||||
|             // "pad_edge_radius",
 |             // "pad_edge_radius",
 | ||||||
|             "pad_wall_slope", |             "pad_wall_slope", | ||||||
|             "pad_object_gap", |             "pad_object_gap", | ||||||
|             "pad_zero_elevation", |             "pad_around_object", | ||||||
|             "pad_object_connector_stride", |             "pad_object_connector_stride", | ||||||
|             "pad_object_connector_width", |             "pad_object_connector_width", | ||||||
|             "pad_object_connector_penetration", |             "pad_object_connector_penetration", | ||||||
|  |  | ||||||
|  | @ -840,7 +840,7 @@ static wxString support_combo_value_for_config(const DynamicPrintConfig &config, | ||||||
| 
 | 
 | ||||||
| static wxString pad_combo_value_for_config(const DynamicPrintConfig &config) | static wxString pad_combo_value_for_config(const DynamicPrintConfig &config) | ||||||
| { | { | ||||||
|     return config.opt_bool("pad_enable") ? (config.opt_bool("pad_zero_elevation") ? _("Around object") : _("Below object")) : _("None"); |     return config.opt_bool("pad_enable") ? (config.opt_bool("pad_around_object") ? _("Around object") : _("Below object")) : _("None"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | ||||||
|  | @ -857,12 +857,19 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | ||||||
|         og_freq_chng_params->set_value(opt_key, val); |         og_freq_chng_params->set_value(opt_key, val); | ||||||
|     } |     } | ||||||
|      |      | ||||||
|  |     if (opt_key == "pad_around_object") { | ||||||
|  |         for (PageShp &pg : m_pages) { | ||||||
|  |             Field * fld = pg->get_field(opt_key); | ||||||
|  |             if (fld) fld->set_value(value, false); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     if (is_fff ? |     if (is_fff ? | ||||||
|             (opt_key == "support_material" || opt_key == "support_material_auto" || opt_key == "support_material_buildplate_only") : |             (opt_key == "support_material" || opt_key == "support_material_auto" || opt_key == "support_material_buildplate_only") : | ||||||
|             (opt_key == "supports_enable"  || opt_key == "support_buildplate_only")) |             (opt_key == "supports_enable"  || opt_key == "support_buildplate_only")) | ||||||
|         og_freq_chng_params->set_value("support", support_combo_value_for_config(*m_config, is_fff)); |         og_freq_chng_params->set_value("support", support_combo_value_for_config(*m_config, is_fff)); | ||||||
| 
 | 
 | ||||||
|     if (! is_fff && (opt_key == "pad_enable" || opt_key == "pad_zero_elevation")) |     if (! is_fff && (opt_key == "pad_enable" || opt_key == "pad_around_object")) | ||||||
|         og_freq_chng_params->set_value("pad", pad_combo_value_for_config(*m_config)); |         og_freq_chng_params->set_value("pad", pad_combo_value_for_config(*m_config)); | ||||||
| 
 | 
 | ||||||
|     if (opt_key == "brim_width") |     if (opt_key == "brim_width") | ||||||
|  | @ -3742,6 +3749,9 @@ void TabSLAPrint::build() | ||||||
|     optgroup->append_single_option_line("support_base_diameter"); |     optgroup->append_single_option_line("support_base_diameter"); | ||||||
|     optgroup->append_single_option_line("support_base_height"); |     optgroup->append_single_option_line("support_base_height"); | ||||||
|     optgroup->append_single_option_line("support_base_safety_distance"); |     optgroup->append_single_option_line("support_base_safety_distance"); | ||||||
|  |      | ||||||
|  |     // Mirrored parameter from Pad page for toggling elevation on the same page
 | ||||||
|  |     optgroup->append_single_option_line("pad_around_object"); | ||||||
|     optgroup->append_single_option_line("support_object_elevation"); |     optgroup->append_single_option_line("support_object_elevation"); | ||||||
| 
 | 
 | ||||||
|     optgroup = page->new_optgroup(_(L("Connection of the support sticks and junctions"))); |     optgroup = page->new_optgroup(_(L("Connection of the support sticks and junctions"))); | ||||||
|  | @ -3763,7 +3773,7 @@ void TabSLAPrint::build() | ||||||
| //    optgroup->append_single_option_line("pad_edge_radius");
 | //    optgroup->append_single_option_line("pad_edge_radius");
 | ||||||
|     optgroup->append_single_option_line("pad_wall_slope"); |     optgroup->append_single_option_line("pad_wall_slope"); | ||||||
| 
 | 
 | ||||||
|     optgroup->append_single_option_line("pad_zero_elevation"); |     optgroup->append_single_option_line("pad_around_object"); | ||||||
|     optgroup->append_single_option_line("pad_object_gap"); |     optgroup->append_single_option_line("pad_object_gap"); | ||||||
|     optgroup->append_single_option_line("pad_object_connector_stride"); |     optgroup->append_single_option_line("pad_object_connector_stride"); | ||||||
|     optgroup->append_single_option_line("pad_object_connector_width"); |     optgroup->append_single_option_line("pad_object_connector_width"); | ||||||
|  | @ -3839,7 +3849,7 @@ void TabSLAPrint::update() | ||||||
|     get_field("pad_max_merge_distance")->toggle(pad_en); |     get_field("pad_max_merge_distance")->toggle(pad_en); | ||||||
|     // get_field("pad_edge_radius")->toggle(supports_en);
 |     // get_field("pad_edge_radius")->toggle(supports_en);
 | ||||||
|     get_field("pad_wall_slope")->toggle(pad_en); |     get_field("pad_wall_slope")->toggle(pad_en); | ||||||
|     get_field("pad_zero_elevation")->toggle(pad_en); |     get_field("pad_around_object")->toggle(pad_en); | ||||||
| 
 | 
 | ||||||
|     double head_penetration = m_config->opt_float("support_head_penetration"); |     double head_penetration = m_config->opt_float("support_head_penetration"); | ||||||
|     double head_width       = m_config->opt_float("support_head_width"); |     double head_width       = m_config->opt_float("support_head_width"); | ||||||
|  | @ -3882,7 +3892,7 @@ void TabSLAPrint::update() | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     bool   has_suppad = pad_en && supports_en; |     bool   has_suppad = pad_en && supports_en; | ||||||
|     bool zero_elev    = m_config->opt_bool("pad_zero_elevation") && has_suppad; |     bool zero_elev    = m_config->opt_bool("pad_around_object") && has_suppad; | ||||||
| 
 | 
 | ||||||
|     get_field("support_object_elevation")->toggle(supports_en && !zero_elev); |     get_field("support_object_elevation")->toggle(supports_en && !zero_elev); | ||||||
|     get_field("pad_object_gap")->toggle(zero_elev); |     get_field("pad_object_gap")->toggle(zero_elev); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bubnikv
						bubnikv