Port of Cura's multi-material interlocking (#5775)

* Init port of Cura's MM interlocking

* Refactor a bit

* Fix crash when bottom surface is multi-color

* Fix crash when boundary avoidance is 0

* Add config

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Noisyfox 2024-06-30 23:25:15 +08:00 committed by GitHub
parent 8ccf0edbc2
commit 4145f45e42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1029 additions and 5 deletions

View file

@ -2810,6 +2810,56 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.));
def = this->add("interlocking_beam", coBool);
def->label = L("Use beam interlocking");
def->tooltip = L("Generate interlocking beam structure at the locations where different filaments touch. This improves the adhesion between filaments, especially models printed in different materials.");
def->category = L("Advanced");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("interlocking_beam_width", coFloat);
def->label = L("Interlocking beam width");
def->tooltip = L("The width of the interlocking structure beams.");
def->sidetext = L("mm");
def->min = 0.01;
def->category = L("Advanced");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.8));
def = this->add("interlocking_orientation", coFloat);
def->label = L("Interlocking direction");
def->tooltip = L("Orientation of interlock beams.");
def->sidetext = L("°");
def->min = 0;
def->max = 360;
def->category = L("Advanced");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(22.5));
def = this->add("interlocking_beam_layer_count", coInt);
def->label = L("Interlocking beam layers");
def->tooltip = L("The height of the beams of the interlocking structure, measured in number of layers. Less layers is stronger, but more prone to defects.");
def->min = 1;
def->category = L("Advanced");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(2));
def = this->add("interlocking_depth", coInt);
def->label = L("Interlocking depth");
def->tooltip = L("The distance from the boundary between filaments to generate interlocking structure, measured in cells. Too few cells will result in poor adhesion.");
def->min = 1;
def->category = L("Advanced");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(2));
def = this->add("interlocking_boundary_avoidance", coInt);
def->label = L("Interlocking boundary avoidance");
def->tooltip = L("The distance from the outside of a model where interlocking structures will not be generated, measured in cells.");
def->min = 0;
def->category = L("Advanced");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(2));
def = this->add("ironing_type", coEnum);
def->label = L("Ironing Type");
def->category = L("Quality");