mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-06 05:24:01 -06:00
Fix of Add option to change support interface pattern #1197
New config field for switching the support interface pattern between default (rectilinear for non-soluble interface, concentric for soluble interface), explicit rectilinear and explicit concentric. Also the config layer was reworked a bit to reduce some switch statements on ConfigOptionEnum<> templates.
This commit is contained in:
parent
88bd189047
commit
61a5b43ac3
13 changed files with 66 additions and 70 deletions
|
@ -1313,6 +1313,7 @@ public:
|
|||
ConfigOptionEnum<T>& operator=(const ConfigOption *opt) { this->set(opt); return *this; }
|
||||
bool operator==(const ConfigOptionEnum<T> &rhs) const { return this->value == rhs.value; }
|
||||
int getInt() const override { return (int)this->value; }
|
||||
void setInt(int val) override { this->value = T(val); }
|
||||
|
||||
bool operator==(const ConfigOption &rhs) const override
|
||||
{
|
||||
|
|
|
@ -429,7 +429,7 @@ const std::vector<std::string>& Preset::print_options()
|
|||
"raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion",
|
||||
"support_material_pattern", "support_material_with_sheath", "support_material_spacing",
|
||||
"support_material_synchronize_layers", "support_material_angle", "support_material_interface_layers",
|
||||
"support_material_interface_spacing", "support_material_interface_contact_loops", "support_material_contact_distance",
|
||||
"support_material_interface_pattern", "support_material_interface_spacing", "support_material_interface_contact_loops", "support_material_contact_distance",
|
||||
"support_material_buildplate_only", "dont_support_bridges", "notes", "complete_objects", "extruder_clearance_radius",
|
||||
"extruder_clearance_height", "gcode_comments", "gcode_label_objects", "output_filename_format", "post_process", "perimeter_extruder",
|
||||
"infill_extruder", "solid_infill_extruder", "support_material_extruder", "support_material_interface_extruder",
|
||||
|
|
|
@ -2341,6 +2341,22 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<SupportMaterialPattern>(smpRectilinear));
|
||||
|
||||
def = this->add("support_material_interface_pattern", coEnum);
|
||||
def->label = L("Interface pattern");
|
||||
def->category = L("Support material");
|
||||
def->tooltip = L("Pattern used to generate support material interface. "
|
||||
"Default pattern for non-soluble support interface is Rectilinear, "
|
||||
"while default pattern for soluble support interface is Concentric.");
|
||||
def->enum_keys_map = &ConfigOptionEnum<SupportMaterialInterfacePattern>::get_enum_values();
|
||||
def->enum_values.push_back("auto");
|
||||
def->enum_values.push_back("rectilinear");
|
||||
def->enum_values.push_back("concentric");
|
||||
def->enum_labels.push_back(L("Default"));
|
||||
def->enum_labels.push_back(L("Rectilinear"));
|
||||
def->enum_labels.push_back(L("Concentric"));
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<SupportMaterialPattern>(smpRectilinear));
|
||||
|
||||
def = this->add("support_material_spacing", coFloat);
|
||||
def->label = L("Pattern spacing");
|
||||
def->category = L("Support material");
|
||||
|
|
|
@ -65,6 +65,10 @@ enum SupportMaterialPattern {
|
|||
smpRectilinear, smpRectilinearGrid, smpHoneycomb,
|
||||
};
|
||||
|
||||
enum SupportMaterialInterfacePattern {
|
||||
smipAuto, smipRectilinear, smipConcentric,
|
||||
};
|
||||
|
||||
enum SeamPosition {
|
||||
spRandom, spNearest, spAligned, spRear
|
||||
};
|
||||
|
@ -207,6 +211,16 @@ template<> inline const t_config_enum_values& ConfigOptionEnum<SupportMaterialPa
|
|||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<SupportMaterialInterfacePattern>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
keys_map["auto"] = smipAuto;
|
||||
keys_map["rectilinear"] = smipRectilinear;
|
||||
keys_map["concentric"] = smipConcentric;
|
||||
}
|
||||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<SeamPosition>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
|
@ -499,6 +513,7 @@ public:
|
|||
ConfigOptionFloat support_material_interface_spacing;
|
||||
ConfigOptionFloatOrPercent support_material_interface_speed;
|
||||
ConfigOptionEnum<SupportMaterialPattern> support_material_pattern;
|
||||
ConfigOptionEnum<SupportMaterialPattern> support_material_interface_pattern;
|
||||
// Spacing between support material lines (the hatching distance).
|
||||
ConfigOptionFloat support_material_spacing;
|
||||
ConfigOptionFloat support_material_speed;
|
||||
|
@ -547,6 +562,7 @@ protected:
|
|||
OPT_PTR(support_material_interface_spacing);
|
||||
OPT_PTR(support_material_interface_speed);
|
||||
OPT_PTR(support_material_pattern);
|
||||
OPT_PTR(support_material_interface_pattern);
|
||||
OPT_PTR(support_material_spacing);
|
||||
OPT_PTR(support_material_speed);
|
||||
OPT_PTR(support_material_synchronize_layers);
|
||||
|
|
|
@ -568,6 +568,7 @@ bool PrintObject::invalidate_state_by_config_options(
|
|||
|| opt_key == "support_material_extruder"
|
||||
|| opt_key == "support_material_extrusion_width"
|
||||
|| opt_key == "support_material_interface_layers"
|
||||
|| opt_key == "support_material_interface_pattern"
|
||||
|| opt_key == "support_material_interface_contact_loops"
|
||||
|| opt_key == "support_material_interface_extruder"
|
||||
|| opt_key == "support_material_interface_spacing"
|
||||
|
|
|
@ -3573,9 +3573,15 @@ void PrintObjectSupportMaterial::generate_toolpaths(
|
|||
};
|
||||
std::vector<LayerCache> layer_caches(support_layers.size(), LayerCache());
|
||||
|
||||
|
||||
const auto fill_type_interface =
|
||||
(m_object_config->support_material_interface_pattern == smipAuto && m_slicing_params.soluble_interface) ||
|
||||
m_object_config->support_material_interface_pattern == smipConcentric ?
|
||||
ipConcentric : ipRectilinear;
|
||||
|
||||
tbb::parallel_for(tbb::blocked_range<size_t>(n_raft_layers, support_layers.size()),
|
||||
[this, &support_layers, &bottom_contacts, &top_contacts, &intermediate_layers, &interface_layers, &base_interface_layers, &layer_caches, &loop_interface_processor,
|
||||
infill_pattern, &bbox_object, support_density, interface_density, interface_angle, &angles, link_max_length_factor, with_sheath]
|
||||
infill_pattern, &bbox_object, support_density, fill_type_interface, interface_density, interface_angle, &angles, link_max_length_factor, with_sheath]
|
||||
(const tbb::blocked_range<size_t>& range) {
|
||||
// Indices of the 1st layer in their respective container at the support layer height.
|
||||
size_t idx_layer_bottom_contact = size_t(-1);
|
||||
|
@ -3583,7 +3589,6 @@ void PrintObjectSupportMaterial::generate_toolpaths(
|
|||
size_t idx_layer_intermediate = size_t(-1);
|
||||
size_t idx_layer_interface = size_t(-1);
|
||||
size_t idx_layer_base_interface = size_t(-1);
|
||||
const auto fill_type_interface = m_slicing_params.soluble_interface ? ipConcentric : ipRectilinear;
|
||||
const auto fill_type_first_layer = ipRectilinear;
|
||||
auto filler_interface = std::unique_ptr<Fill>(Fill::new_from_type(fill_type_interface));
|
||||
// Filler for the 1st layer interface, if different from filler_interface.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue