Commented out fuzzy_skin_shape for now, the parameter may be used

in the future, but for now we don't want the parameter to be stored
into configuration files.
This commit is contained in:
Vojtech Bubnik 2021-01-27 09:36:39 +01:00
parent 05f9910c8f
commit dcec1fa749
6 changed files with 23 additions and 13 deletions

View File

@ -231,13 +231,15 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
return out; return out;
} }
/*
enum class FuzzyShape { enum class FuzzyShape {
Triangle, Triangle,
Sawtooth, Sawtooth,
Random Random
}; };
*/
static void fuzzy_polygon(Polygon &poly, FuzzyShape shape, double fuzzy_skin_thickness, double fuzzy_skin_point_dist) static void fuzzy_polygon(Polygon &poly, /* FuzzyShape shape, */ double fuzzy_skin_thickness, double fuzzy_skin_point_dist)
{ {
#if 0 #if 0
Point last = poly.points.at(poly.points.size() - 1); Point last = poly.points.at(poly.points.size() - 1);
@ -396,8 +398,9 @@ void PerimeterGenerator::process()
// fuzzy skin configuration // fuzzy skin configuration
double fuzzy_skin_thickness; double fuzzy_skin_thickness;
double fuzzy_skin_point_dist; double fuzzy_skin_point_dist;
FuzzyShape fuzzy_skin_shape; //FuzzyShape fuzzy_skin_shape;
if (this->object_config->fuzzy_skin_perimeter_mode != FuzzySkinPerimeterMode::None) { if (this->object_config->fuzzy_skin_perimeter_mode != FuzzySkinPerimeterMode::None) {
/*
switch (this->object_config->fuzzy_skin_shape) { switch (this->object_config->fuzzy_skin_shape) {
case FuzzySkinShape::Triangle1: case FuzzySkinShape::Triangle1:
case FuzzySkinShape::Triangle2: case FuzzySkinShape::Triangle2:
@ -415,6 +418,7 @@ void PerimeterGenerator::process()
fuzzy_skin_shape = FuzzyShape::Random; fuzzy_skin_shape = FuzzyShape::Random;
break; break;
} }
*/
fuzzy_skin_thickness = scale_(this->object_config->fuzzy_skin_thickness); fuzzy_skin_thickness = scale_(this->object_config->fuzzy_skin_thickness);
fuzzy_skin_point_dist = scale_(this->object_config->fuzzy_skin_point_dist); fuzzy_skin_point_dist = scale_(this->object_config->fuzzy_skin_point_dist);
} }
@ -514,12 +518,12 @@ void PerimeterGenerator::process()
this->object_config->fuzzy_skin_perimeter_mode == FuzzySkinPerimeterMode::ExternalSkipFirst this->object_config->fuzzy_skin_perimeter_mode == FuzzySkinPerimeterMode::ExternalSkipFirst
) { ) {
ExPolygon expolygon_fuzzy(expolygon); ExPolygon expolygon_fuzzy(expolygon);
fuzzy_polygon(expolygon_fuzzy.contour, fuzzy_skin_shape, fuzzy_skin_thickness, fuzzy_skin_point_dist); fuzzy_polygon(expolygon_fuzzy.contour, /* fuzzy_skin_shape, */ fuzzy_skin_thickness, fuzzy_skin_point_dist);
// compensate for the depth of intersection. // compensate for the depth of intersection.
contours[i].emplace_back(PerimeterGeneratorLoop(expolygon_fuzzy.contour, i, true)); contours[i].emplace_back(PerimeterGeneratorLoop(expolygon_fuzzy.contour, i, true));
skip_polygon = true; skip_polygon = true;
} else } else
fuzzy_polygon(expolygon.contour, fuzzy_skin_shape, fuzzy_skin_thickness, fuzzy_skin_point_dist); fuzzy_polygon(expolygon.contour, /* fuzzy_skin_shape, */ fuzzy_skin_thickness, fuzzy_skin_point_dist);
} }
} }

View File

@ -1029,6 +1029,7 @@ void PrintConfigDef::init_fff_params()
def->category = L("Fuzzy Skin"); def->category = L("Fuzzy Skin");
def->tooltip = L("Fuzzy skin shape."); def->tooltip = L("Fuzzy skin shape.");
/*
def->enum_keys_map = &ConfigOptionEnum<FuzzySkinShape>::get_enum_values(); def->enum_keys_map = &ConfigOptionEnum<FuzzySkinShape>::get_enum_values();
def->enum_values.push_back("triangle1"); def->enum_values.push_back("triangle1");
def->enum_values.push_back("triangle2"); def->enum_values.push_back("triangle2");
@ -1050,6 +1051,7 @@ void PrintConfigDef::init_fff_params()
def->enum_labels.push_back(L("Random (3)")); def->enum_labels.push_back(L("Random (3)"));
def->mode = comSimple; def->mode = comSimple;
def->set_default_value(new ConfigOptionEnum<FuzzySkinShape>(FuzzySkinShape::Triangle1)); def->set_default_value(new ConfigOptionEnum<FuzzySkinShape>(FuzzySkinShape::Triangle1));
*/
def = this->add("fuzzy_skin_thickness", coFloat); def = this->add("fuzzy_skin_thickness", coFloat);
def->label = L("Fuzzy skin thickness"); def->label = L("Fuzzy skin thickness");

View File

@ -50,6 +50,7 @@ enum class FuzzySkinPerimeterMode {
All All
}; };
/*
enum class FuzzySkinShape { enum class FuzzySkinShape {
Triangle1, Triangle1,
Triangle2, Triangle2,
@ -61,6 +62,7 @@ enum class FuzzySkinShape {
Random2, Random2,
Random3 Random3
}; };
*/
enum InfillPattern : int { enum InfillPattern : int {
ipRectilinear, ipMonotonic, ipAlignedRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb, ipRectilinear, ipMonotonic, ipAlignedRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
@ -170,6 +172,7 @@ template<> inline const t_config_enum_values& ConfigOptionEnum<FuzzySkinPerimete
return keys_map; return keys_map;
} }
/*
template<> inline const t_config_enum_values& ConfigOptionEnum<FuzzySkinShape>::get_enum_values() { template<> inline const t_config_enum_values& ConfigOptionEnum<FuzzySkinShape>::get_enum_values() {
static t_config_enum_values keys_map; static t_config_enum_values keys_map;
if (keys_map.empty()) { if (keys_map.empty()) {
@ -185,6 +188,7 @@ template<> inline const t_config_enum_values& ConfigOptionEnum<FuzzySkinShape>::
} }
return keys_map; return keys_map;
} }
*/
template<> inline const t_config_enum_values& ConfigOptionEnum<InfillPattern>::get_enum_values() { template<> inline const t_config_enum_values& ConfigOptionEnum<InfillPattern>::get_enum_values() {
static t_config_enum_values keys_map; static t_config_enum_values keys_map;
@ -479,7 +483,7 @@ public:
ConfigOptionFloatOrPercent extrusion_width; ConfigOptionFloatOrPercent extrusion_width;
ConfigOptionFloatOrPercent first_layer_height; ConfigOptionFloatOrPercent first_layer_height;
ConfigOptionEnum<FuzzySkinPerimeterMode> fuzzy_skin_perimeter_mode; ConfigOptionEnum<FuzzySkinPerimeterMode> fuzzy_skin_perimeter_mode;
ConfigOptionEnum<FuzzySkinShape> fuzzy_skin_shape; // ConfigOptionEnum<FuzzySkinShape> fuzzy_skin_shape;
ConfigOptionFloat fuzzy_skin_thickness; ConfigOptionFloat fuzzy_skin_thickness;
ConfigOptionFloat fuzzy_skin_point_dist; ConfigOptionFloat fuzzy_skin_point_dist;
ConfigOptionBool infill_only_where_needed; ConfigOptionBool infill_only_where_needed;
@ -528,7 +532,7 @@ protected:
OPT_PTR(extrusion_width); OPT_PTR(extrusion_width);
OPT_PTR(first_layer_height); OPT_PTR(first_layer_height);
OPT_PTR(fuzzy_skin_perimeter_mode); OPT_PTR(fuzzy_skin_perimeter_mode);
OPT_PTR(fuzzy_skin_shape); // OPT_PTR(fuzzy_skin_shape);
OPT_PTR(fuzzy_skin_thickness); OPT_PTR(fuzzy_skin_thickness);
OPT_PTR(fuzzy_skin_point_dist); OPT_PTR(fuzzy_skin_point_dist);
OPT_PTR(infill_only_where_needed); OPT_PTR(infill_only_where_needed);

View File

@ -1202,8 +1202,8 @@ boost::any& Choice::get_value()
m_value = static_cast<IroningType>(ret_enum); m_value = static_cast<IroningType>(ret_enum);
else if (m_opt_id.compare("fuzzy_skin_perimeter_mode") == 0) else if (m_opt_id.compare("fuzzy_skin_perimeter_mode") == 0)
m_value = static_cast<FuzzySkinPerimeterMode>(ret_enum); m_value = static_cast<FuzzySkinPerimeterMode>(ret_enum);
else if (m_opt_id.compare("fuzzy_skin_shape") == 0) // else if (m_opt_id.compare("fuzzy_skin_shape") == 0)
m_value = static_cast<FuzzySkinShape>(ret_enum); // m_value = static_cast<FuzzySkinShape>(ret_enum);
else if (m_opt_id.compare("gcode_flavor") == 0) else if (m_opt_id.compare("gcode_flavor") == 0)
m_value = static_cast<GCodeFlavor>(ret_enum); m_value = static_cast<GCodeFlavor>(ret_enum);
else if (m_opt_id.compare("machine_limits_usage") == 0) else if (m_opt_id.compare("machine_limits_usage") == 0)

View File

@ -184,8 +184,8 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
config.set_key_value(opt_key, new ConfigOptionEnum<IroningType>(boost::any_cast<IroningType>(value))); config.set_key_value(opt_key, new ConfigOptionEnum<IroningType>(boost::any_cast<IroningType>(value)));
else if (opt_key.compare("fuzzy_skin_perimeter_mode") == 0) else if (opt_key.compare("fuzzy_skin_perimeter_mode") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<FuzzySkinPerimeterMode>(boost::any_cast<FuzzySkinPerimeterMode>(value))); config.set_key_value(opt_key, new ConfigOptionEnum<FuzzySkinPerimeterMode>(boost::any_cast<FuzzySkinPerimeterMode>(value)));
else if (opt_key.compare("fuzzy_skin_shape") == 0) // else if (opt_key.compare("fuzzy_skin_shape") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<FuzzySkinShape>(boost::any_cast<FuzzySkinShape>(value))); // config.set_key_value(opt_key, new ConfigOptionEnum<FuzzySkinShape>(boost::any_cast<FuzzySkinShape>(value)));
else if (opt_key.compare("gcode_flavor") == 0) else if (opt_key.compare("gcode_flavor") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<GCodeFlavor>(boost::any_cast<GCodeFlavor>(value))); config.set_key_value(opt_key, new ConfigOptionEnum<GCodeFlavor>(boost::any_cast<GCodeFlavor>(value)));
else if (opt_key.compare("machine_limits_usage") == 0) else if (opt_key.compare("machine_limits_usage") == 0)

View File

@ -873,9 +873,9 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
else if (opt_key == "fuzzy_skin_perimeter_mode") { else if (opt_key == "fuzzy_skin_perimeter_mode") {
ret = static_cast<int>(config.option<ConfigOptionEnum<FuzzySkinPerimeterMode>>(opt_key)->value); ret = static_cast<int>(config.option<ConfigOptionEnum<FuzzySkinPerimeterMode>>(opt_key)->value);
} }
else if (opt_key == "fuzzy_skin_shape") { // else if (opt_key == "fuzzy_skin_shape") {
ret = static_cast<int>(config.option<ConfigOptionEnum<FuzzySkinShape>>(opt_key)->value); // ret = static_cast<int>(config.option<ConfigOptionEnum<FuzzySkinShape>>(opt_key)->value);
} // }
else if (opt_key == "gcode_flavor") { else if (opt_key == "gcode_flavor") {
ret = static_cast<int>(config.option<ConfigOptionEnum<GCodeFlavor>>(opt_key)->value); ret = static_cast<int>(config.option<ConfigOptionEnum<GCodeFlavor>>(opt_key)->value);
} }