This commit is contained in:
enricoturri1966 2021-11-30 08:37:00 +01:00
commit 03a6a46dce
14 changed files with 597 additions and 48 deletions

View file

@ -72,7 +72,8 @@ static t_config_enum_values s_keys_map_PrintHostType {
{ "duet", htDuet },
{ "flashair", htFlashAir },
{ "astrobox", htAstroBox },
{ "repetier", htRepetier }
{ "repetier", htRepetier },
{ "mks", htMKS }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PrintHostType)
@ -1854,12 +1855,14 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("flashair");
def->enum_values.push_back("astrobox");
def->enum_values.push_back("repetier");
def->enum_values.push_back("mks");
def->enum_labels.push_back("PrusaLink");
def->enum_labels.push_back("OctoPrint");
def->enum_labels.push_back("Duet");
def->enum_labels.push_back("FlashAir");
def->enum_labels.push_back("AstroBox");
def->enum_labels.push_back("Repetier");
def->enum_labels.push_back("MKS");
def->mode = comAdvanced;
def->cli = ConfigOptionDef::nocli;
def->set_default_value(new ConfigOptionEnum<PrintHostType>(htOctoPrint));

View file

@ -44,7 +44,7 @@ enum class MachineLimitsUsage {
};
enum PrintHostType {
htPrusaLink, htOctoPrint, htDuet, htFlashAir, htAstroBox, htRepetier
htPrusaLink, htOctoPrint, htDuet, htFlashAir, htAstroBox, htRepetier, htMKS
};
enum AuthorizationType {

View file

@ -379,11 +379,7 @@ static std::vector<std::vector<ExPolygons>> slices_to_regions(
int j = i;
bool merged = false;
ExPolygons &expolygons = temp_slices[i].expolygons;
for (++ j;
j < int(temp_slices.size()) &&
temp_slices[i].region_id == temp_slices[j].region_id &&
(clip_multipart_objects || temp_slices[i].volume_id == temp_slices[j].volume_id);
++ j)
for (++ j; j < int(temp_slices.size()) && temp_slices[i].region_id == temp_slices[j].region_id; ++ j)
if (ExPolygons &expolygons2 = temp_slices[j].expolygons; ! expolygons2.empty()) {
if (expolygons.empty()) {
expolygons = std::move(expolygons2);
@ -392,7 +388,10 @@ static std::vector<std::vector<ExPolygons>> slices_to_regions(
merged = true;
}
}
if (merged)
// Don't unite the regions if ! clip_multipart_objects. In that case it is user's responsibility
// to handle region overlaps. Indeed, one may intentionally let the regions overlap to produce crossing perimeters
// for example.
if (merged && clip_multipart_objects)
expolygons = closing_ex(expolygons, float(scale_(EPSILON)));
slices_by_region[temp_slices[i].region_id][z_idx] = std::move(expolygons);
i = j;