mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 07:06:01 +08:00
parent
5c46a60f33
commit
7802f276e4
@ -176,6 +176,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|
|||||||
steps.emplace_back(psSkirt);
|
steps.emplace_back(psSkirt);
|
||||||
} else if (
|
} else if (
|
||||||
opt_key == "complete_objects"
|
opt_key == "complete_objects"
|
||||||
|
|| opt_key == "brim_inside_holes"
|
||||||
|| opt_key == "brim_width"
|
|| opt_key == "brim_width"
|
||||||
|| opt_key == "brim_ears"
|
|| opt_key == "brim_ears"
|
||||||
|| opt_key == "brim_ears_max_angle") {
|
|| opt_key == "brim_ears_max_angle") {
|
||||||
@ -1783,12 +1784,18 @@ ExPolygons Print::_make_brim(const PrintObjectPtrs &objects, ExtrusionEntityColl
|
|||||||
for (PrintObject *object : objects) {
|
for (PrintObject *object : objects) {
|
||||||
ExPolygons object_islands;
|
ExPolygons object_islands;
|
||||||
for (ExPolygon &expoly : object->m_layers.front()->slices.expolygons)
|
for (ExPolygon &expoly : object->m_layers.front()->slices.expolygons)
|
||||||
|
if(config().brim_inside_holes || config().brim_width_interior > 0)
|
||||||
object_islands.push_back(expoly);
|
object_islands.push_back(expoly);
|
||||||
|
else
|
||||||
|
object_islands.emplace_back(to_expolygon(expoly.contour));
|
||||||
if (!object->support_layers().empty()) {
|
if (!object->support_layers().empty()) {
|
||||||
Polygons polys = object->support_layers().front()->support_fills.polygons_covered_by_spacing(float(SCALED_EPSILON));
|
Polygons polys = object->support_layers().front()->support_fills.polygons_covered_by_spacing(float(SCALED_EPSILON));
|
||||||
for (Polygon poly : polys)
|
for (Polygon poly : polys)
|
||||||
for (ExPolygon & expoly2 : union_ex(poly))
|
for (ExPolygon & expoly2 : union_ex(poly))
|
||||||
|
if (config().brim_inside_holes || config().brim_width_interior > 0)
|
||||||
object_islands.emplace_back(expoly2);
|
object_islands.emplace_back(expoly2);
|
||||||
|
else
|
||||||
|
object_islands.emplace_back(to_expolygon(expoly2.contour));
|
||||||
}
|
}
|
||||||
islands.reserve(islands.size() + object_islands.size() * object->m_copies.size());
|
islands.reserve(islands.size() + object_islands.size() * object->m_copies.size());
|
||||||
for (const Point &pt : object->m_copies)
|
for (const Point &pt : object->m_copies)
|
||||||
@ -1912,12 +1919,18 @@ ExPolygons Print::_make_brim_ears(const PrintObjectPtrs &objects, ExtrusionEntit
|
|||||||
for (PrintObject *object : objects) {
|
for (PrintObject *object : objects) {
|
||||||
ExPolygons object_islands;
|
ExPolygons object_islands;
|
||||||
for (ExPolygon &expoly : object->m_layers.front()->slices.expolygons)
|
for (ExPolygon &expoly : object->m_layers.front()->slices.expolygons)
|
||||||
|
if (config().brim_inside_holes || config().brim_width_interior > 0)
|
||||||
object_islands.push_back(expoly);
|
object_islands.push_back(expoly);
|
||||||
|
else
|
||||||
|
object_islands.emplace_back(to_expolygon(expoly.contour));
|
||||||
if (!object->support_layers().empty()) {
|
if (!object->support_layers().empty()) {
|
||||||
Polygons polys = object->support_layers().front()->support_fills.polygons_covered_by_spacing(float(SCALED_EPSILON));
|
Polygons polys = object->support_layers().front()->support_fills.polygons_covered_by_spacing(float(SCALED_EPSILON));
|
||||||
for (Polygon poly : polys)
|
for (Polygon poly : polys)
|
||||||
for (ExPolygon & expoly2 : union_ex(poly))
|
for (ExPolygon & expoly2 : union_ex(poly))
|
||||||
|
if (config().brim_inside_holes || config().brim_width_interior > 0)
|
||||||
object_islands.push_back(expoly2);
|
object_islands.push_back(expoly2);
|
||||||
|
else
|
||||||
|
object_islands.emplace_back(to_expolygon(expoly2.contour));
|
||||||
}
|
}
|
||||||
islands.reserve(islands.size() + object_islands.size() * object->m_copies.size());
|
islands.reserve(islands.size() + object_islands.size() * object->m_copies.size());
|
||||||
for (const Point ©_pt : object->m_copies)
|
for (const Point ©_pt : object->m_copies)
|
||||||
|
@ -240,6 +240,13 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionFloat(60));
|
def->set_default_value(new ConfigOptionFloat(60));
|
||||||
|
|
||||||
|
def = this->add("brim_inside_holes", coBool);
|
||||||
|
def->label = L("Brim inside holes");
|
||||||
|
def->full_label = L("Brim inside holes");
|
||||||
|
def->tooltip = L("Allow to create brim when over an island when this one is inside a hole.");
|
||||||
|
def->mode = comAdvanced;
|
||||||
|
def->set_default_value(new ConfigOptionBool(false));
|
||||||
|
|
||||||
def = this->add("brim_width", coFloat);
|
def = this->add("brim_width", coFloat);
|
||||||
def->label = L("Brim width");
|
def->label = L("Brim width");
|
||||||
def->tooltip = L("Horizontal width of the brim that will be printed around each object on the first layer.");
|
def->tooltip = L("Horizontal width of the brim that will be printed around each object on the first layer.");
|
||||||
@ -260,6 +267,7 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->label = L(" ");
|
def->label = L(" ");
|
||||||
def->full_label = L("Brim ears");
|
def->full_label = L("Brim ears");
|
||||||
def->tooltip = L("Only draw brim over the sharp edges of the model.");
|
def->tooltip = L("Only draw brim over the sharp edges of the model.");
|
||||||
|
def->mode = comSimple;
|
||||||
def->set_default_value(new ConfigOptionBool(false));
|
def->set_default_value(new ConfigOptionBool(false));
|
||||||
|
|
||||||
def = this->add("brim_ears_max_angle", coFloat);
|
def = this->add("brim_ears_max_angle", coFloat);
|
||||||
@ -268,6 +276,7 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->sidetext = L("°");
|
def->sidetext = L("°");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->max = 180;
|
def->max = 180;
|
||||||
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionFloat(125));
|
def->set_default_value(new ConfigOptionFloat(125));
|
||||||
|
|
||||||
def = this->add("chamber_temperature", coInts);
|
def = this->add("chamber_temperature", coInts);
|
||||||
|
@ -950,6 +950,7 @@ public:
|
|||||||
ConfigOptionInts bed_temperature;
|
ConfigOptionInts bed_temperature;
|
||||||
ConfigOptionFloat bridge_acceleration;
|
ConfigOptionFloat bridge_acceleration;
|
||||||
ConfigOptionInts bridge_fan_speed;
|
ConfigOptionInts bridge_fan_speed;
|
||||||
|
ConfigOptionBool brim_inside_holes;
|
||||||
ConfigOptionFloat brim_width;
|
ConfigOptionFloat brim_width;
|
||||||
ConfigOptionFloat brim_width_interior;
|
ConfigOptionFloat brim_width_interior;
|
||||||
ConfigOptionBool brim_ears;
|
ConfigOptionBool brim_ears;
|
||||||
@ -1027,6 +1028,7 @@ protected:
|
|||||||
OPT_PTR(bed_temperature);
|
OPT_PTR(bed_temperature);
|
||||||
OPT_PTR(bridge_acceleration);
|
OPT_PTR(bridge_acceleration);
|
||||||
OPT_PTR(bridge_fan_speed);
|
OPT_PTR(bridge_fan_speed);
|
||||||
|
OPT_PTR(brim_inside_holes);
|
||||||
OPT_PTR(brim_width);
|
OPT_PTR(brim_width);
|
||||||
OPT_PTR(brim_width_interior);
|
OPT_PTR(brim_width_interior);
|
||||||
OPT_PTR(brim_ears);
|
OPT_PTR(brim_ears);
|
||||||
|
@ -295,11 +295,12 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
|
|||||||
for (auto el : { "skirt_distance", "skirt_height" })
|
for (auto el : { "skirt_distance", "skirt_height" })
|
||||||
toggle_field(el, have_skirt);
|
toggle_field(el, have_skirt);
|
||||||
|
|
||||||
bool have_brim = config->opt_float("brim_width") > 0;
|
bool have_brim = config->opt_float("brim_width") > 0 || config->opt_float("brim_width_interior") > 0;
|
||||||
// perimeter_extruder uses the same logic as in Print::extruders()
|
// perimeter_extruder uses the same logic as in Print::extruders()
|
||||||
toggle_field("perimeter_extruder", have_perimeters || have_brim);
|
toggle_field("perimeter_extruder", have_perimeters || have_brim);
|
||||||
|
|
||||||
toggle_field("brim_ears", have_brim);
|
toggle_field("brim_ears", config->opt_float("brim_width") > 0);
|
||||||
|
toggle_field("brim_inside_holes", config->opt_float("brim_width") > 0 && config->opt_float("brim_width_interior") == 0);
|
||||||
toggle_field("brim_ears_max_angle", have_brim && config->opt_bool("brim_ears"));
|
toggle_field("brim_ears_max_angle", have_brim && config->opt_bool("brim_ears"));
|
||||||
|
|
||||||
bool have_raft = config->opt_int("raft_layers") > 0;
|
bool have_raft = config->opt_int("raft_layers") > 0;
|
||||||
|
@ -406,6 +406,7 @@ const std::vector<std::string>& Preset::print_options()
|
|||||||
"travel_speed", "first_layer_speed", "perimeter_acceleration", "infill_acceleration",
|
"travel_speed", "first_layer_speed", "perimeter_acceleration", "infill_acceleration",
|
||||||
"bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height",
|
"bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height",
|
||||||
"min_skirt_length",
|
"min_skirt_length",
|
||||||
|
"brim_inside_holes",
|
||||||
"brim_width",
|
"brim_width",
|
||||||
"brim_width_interior",
|
"brim_width_interior",
|
||||||
"brim_ears",
|
"brim_ears",
|
||||||
|
@ -1162,6 +1162,7 @@ void TabPrint::build()
|
|||||||
|
|
||||||
optgroup = page->new_optgroup(_(L("Brim")));
|
optgroup = page->new_optgroup(_(L("Brim")));
|
||||||
optgroup->append_single_option_line("brim_width");
|
optgroup->append_single_option_line("brim_width");
|
||||||
|
optgroup->append_single_option_line("brim_inside_holes");
|
||||||
optgroup->append_single_option_line("brim_width_interior");
|
optgroup->append_single_option_line("brim_width_interior");
|
||||||
line = { _(L("Brim ears")), "" };
|
line = { _(L("Brim ears")), "" };
|
||||||
line.append_option(optgroup->get_option("brim_ears"));
|
line.append_option(optgroup->get_option("brim_ears"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user