Add support for structured noise (perlin) fuzzy skin (#7678)

* Add support for perlin noise fuzzy skin

* Support multiple types of coherent noise

* Updated tooltips for more clarity.

* Reorder options as suggested by @discip

* Fix accidental removal of &

* Move libnoise to deps

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Nick Johnson 2025-01-27 14:45:16 +00:00 committed by GitHub
parent 118e14d788
commit fd0b2547f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 200 additions and 24 deletions

View file

@ -123,6 +123,15 @@ static t_config_enum_values s_keys_map_FuzzySkinType {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(FuzzySkinType)
static t_config_enum_values s_keys_map_NoiseType {
{ "classic", int(NoiseType::Classic) },
{ "perlin", int(NoiseType::Perlin) },
{ "billow", int(NoiseType::Billow) },
{ "ridgedmulti", int(NoiseType::RidgedMulti) },
{ "voronoi", int(NoiseType::Voronoi) }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(NoiseType)
static t_config_enum_values s_keys_map_InfillPattern {
{ "concentric", ipConcentric },
{ "zig-zag", ipRectilinear },
@ -2632,6 +2641,57 @@ void PrintConfigDef::init_fff_params()
def->mode = comSimple;
def->set_default_value(new ConfigOptionBool(0));
def = this->add("fuzzy_skin_noise_type", coEnum);
def->label = L("Fuzzy skin noise type");
def->category = L("Others");
def->tooltip = L("Noise type to use for fuzzy skin generation.\n"
"Classic: Classic uniform random noise.\n"
"Perlin: Perlin noise, which gives a more consistent texture.\n"
"Billow: Similar to perlin noise, but clumpier.\n"
"Ridged Multifractal: Ridged noise with sharp, jagged features. Creates marble-like textures.\n"
"Voronoi: Divides the surface into voronoi cells, and displaces each one by a random amount. Creates a patchwork texture.");
def->enum_keys_map = &ConfigOptionEnum<NoiseType>::get_enum_values();
def->enum_values.push_back("classic");
def->enum_values.push_back("perlin");
def->enum_values.push_back("billow");
def->enum_values.push_back("ridgedmulti");
def->enum_values.push_back("voronoi");
def->enum_labels.push_back(L("Classic"));
def->enum_labels.push_back(L("Perlin"));
def->enum_labels.push_back(L("Billow"));
def->enum_labels.push_back(L("Ridged Multifractal"));
def->enum_labels.push_back(L("Voronoi"));
def->mode = comSimple;
def->set_default_value(new ConfigOptionEnum<NoiseType>(NoiseType::Classic));
def = this->add("fuzzy_skin_scale", coFloat);
def->label = L("Fuzzy skin feature size");
def->category = L("Others");
def->tooltip = L("The base size of the coherent noise features, in mm. Higher values will result in larger features.");
def->sidetext = L("mm");
def->min = 0.1;
def->max = 500;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(1.0));
def = this->add("fuzzy_skin_octaves", coInt);
def->label = L("Fuzzy Skin Noise Octaves");
def->category = L("Others");
def->tooltip = L("The number of octaves of coherent noise to use. Higher values increase the detail of the noise, but also increase computation time.");
def->min = 1;
def->max = 10;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(4));
def = this->add("fuzzy_skin_persistence", coFloat);
def->label = L("Fuzzy skin noise persistence");
def->category = L("Others");
def->tooltip = L("The decay rate for higher octaves of the coherent noise. Lower values will result in smoother noise.");
def->min = 0.01;
def->max = 1;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.5));
def = this->add("filter_out_gap_fill", coFloat);
def->label = L("Filter out tiny gaps");
def->category = L("Layers and Perimeters");