mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-30 17:05:35 -05:00
Fix pipe-separated exclusion areas
Treat pipe-separated bed_exclude_area strings as extended exclusion syntax even when no Z range is present. ConfigOptionPoints now preserves and parses plain multi-region strings like XxY,...|XxY,... instead of flattening them into a single polygon. Remove the stale bed_exclude_area_3d config option and related preset/UI plumbing now that Z-limited and multi-region exclusions are represented through the existing bed_exclude_area field.
This commit is contained in:
1 parent
19a454746a
commit
ee593c2d5a
9 files changed
+15
-33
No files matched your search
@@ -885,14 +885,6 @@ void PrintConfigDef::init_common_params()
|
||||
def->gui_type = ConfigOptionDef::GUIType::one_string;
|
||||
def->set_default_value(new ConfigOptionPoints{ Vec2d(0, 0) });
|
||||
|
||||
def = this->add("bed_exclude_area_3d", coString);
|
||||
def->label = L("Bed exclusion volume");
|
||||
def->tooltip = L("Z-limited unprintable volumes. Use: \"ZMIN..ZMAX;XxY,XxY,...\". Separate multiple regions with \"|\". "
|
||||
"Missing Z bounds default to the bed surface or printable height.");
|
||||
def->mode = comAdvanced;
|
||||
def->gui_type = ConfigOptionDef::GUIType::one_string;
|
||||
def->set_default_value(new ConfigOptionString());
|
||||
|
||||
def = this->add("bed_custom_texture", coString);
|
||||
def->label = L("Bed custom texture");
|
||||
def->mode = comAdvanced;
|
||||
@@ -12742,7 +12734,7 @@ namespace {
|
||||
|
||||
static bool is_bed_exclusion_volume_syntax(const std::string &value)
|
||||
{
|
||||
return value.find("..") != std::string::npos && value.find(';') != std::string::npos;
|
||||
return value.find('|') != std::string::npos || (value.find("..") != std::string::npos && value.find(';') != std::string::npos);
|
||||
}
|
||||
|
||||
static bool parse_double_token(const std::string &text, double &out)
|
||||
@@ -12907,14 +12899,13 @@ static std::vector<BedExcludeRegion> get_bed_excluded_regions_impl(
|
||||
std::vector<BedExcludeRegion> get_bed_excluded_regions(const DynamicPrintConfig& cfg)
|
||||
{
|
||||
const ConfigOptionPoints *legacy = cfg.opt<ConfigOptionPoints>("bed_exclude_area");
|
||||
const ConfigOptionString *regions = cfg.opt<ConfigOptionString>("bed_exclude_area_3d");
|
||||
const ConfigOptionFloat *height = cfg.opt<ConfigOptionFloat>("printable_height");
|
||||
const std::string bed_exclude_area = legacy != nullptr ? legacy->serialize() : std::string{};
|
||||
const bool volume_syntax = is_bed_exclusion_volume_syntax(bed_exclude_area);
|
||||
|
||||
return get_bed_excluded_regions_impl(
|
||||
volume_syntax || legacy == nullptr ? Pointfs{} : legacy->values,
|
||||
volume_syntax ? bed_exclude_area : (regions != nullptr ? regions->value : std::string{}),
|
||||
volume_syntax ? bed_exclude_area : std::string{},
|
||||
height != nullptr ? height->value : 0.0);
|
||||
}
|
||||
|
||||
@@ -12925,7 +12916,7 @@ std::vector<BedExcludeRegion> get_bed_excluded_regions(const PrintConfig& cfg)
|
||||
|
||||
return get_bed_excluded_regions_impl(
|
||||
volume_syntax ? Pointfs{} : cfg.bed_exclude_area.values,
|
||||
volume_syntax ? bed_exclude_area : cfg.bed_exclude_area_3d.value,
|
||||
volume_syntax ? bed_exclude_area : std::string{},
|
||||
cfg.printable_height.value);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user