mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 09:55:57 +08:00
new option: Overlapping perimeters, for when you don't care and don't want to use MedialAxis algo
#116
This commit is contained in:
parent
9c6008e5e0
commit
351d7d437a
@ -137,6 +137,7 @@ void Layer::make_perimeters()
|
|||||||
&& config.opt_serialize("external_perimeter_extrusion_width").compare(other_config.opt_serialize("external_perimeter_extrusion_width")) == 0
|
&& config.opt_serialize("external_perimeter_extrusion_width").compare(other_config.opt_serialize("external_perimeter_extrusion_width")) == 0
|
||||||
&& config.thin_walls == other_config.thin_walls
|
&& config.thin_walls == other_config.thin_walls
|
||||||
&& config.thin_walls_min_width == other_config.thin_walls_min_width
|
&& config.thin_walls_min_width == other_config.thin_walls_min_width
|
||||||
|
&& config.thin_perimeters == other_config.thin_perimeters
|
||||||
&& config.thin_walls_overlap == other_config.thin_walls_overlap
|
&& config.thin_walls_overlap == other_config.thin_walls_overlap
|
||||||
&& config.external_perimeters_first == other_config.external_perimeters_first
|
&& config.external_perimeters_first == other_config.external_perimeters_first
|
||||||
&& config.infill_overlap == other_config.infill_overlap
|
&& config.infill_overlap == other_config.infill_overlap
|
||||||
|
@ -351,22 +351,21 @@ void PerimeterGenerator::process()
|
|||||||
//this variable stored the next onion
|
//this variable stored the next onion
|
||||||
ExPolygons next_onion;
|
ExPolygons next_onion;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
// compute next onion, without taking care of thin_walls : destroy too thin areas.
|
// compute next onion
|
||||||
if (!this->config->thin_walls)
|
|
||||||
next_onion = offset2_ex(
|
|
||||||
last,
|
|
||||||
-(float)(ext_perimeter_width / 2 + ext_min_spacing / 2 - 1),
|
|
||||||
+(float)(ext_min_spacing / 2 - 1));
|
|
||||||
|
|
||||||
|
|
||||||
// look for thin walls
|
|
||||||
if (this->config->thin_walls) {
|
|
||||||
// the minimum thickness of a single loop is:
|
// the minimum thickness of a single loop is:
|
||||||
// ext_width/2 + ext_spacing/2 + spacing/2 + width/2
|
// ext_width/2 + ext_spacing/2 + spacing/2 + width/2
|
||||||
|
if (this->config->thin_perimeters)
|
||||||
|
next_onion = offset_ex(
|
||||||
|
last,
|
||||||
|
-(float)(ext_perimeter_width / 2));
|
||||||
|
else
|
||||||
next_onion = offset2_ex(
|
next_onion = offset2_ex(
|
||||||
last,
|
last,
|
||||||
-(float)(ext_perimeter_width / 2 + ext_min_spacing / 2 - 1),
|
-(float)(ext_perimeter_width / 2 + ext_min_spacing / 2 - 1),
|
||||||
+(float)(ext_min_spacing / 2 - 1));
|
+(float)(ext_min_spacing / 2 - 1));
|
||||||
|
|
||||||
|
// look for thin walls
|
||||||
|
if (this->config->thin_walls) {
|
||||||
// detect edge case where a curve can be split in multiple small chunks.
|
// detect edge case where a curve can be split in multiple small chunks.
|
||||||
ExPolygons no_thin_onion = offset_ex(last, double( - ext_perimeter_width / 2));
|
ExPolygons no_thin_onion = offset_ex(last, double( - ext_perimeter_width / 2));
|
||||||
float div = 2;
|
float div = 2;
|
||||||
|
@ -2811,13 +2811,21 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->max = max_temp;
|
def->max = max_temp;
|
||||||
def->set_default_value(new ConfigOptionInts { 200 });
|
def->set_default_value(new ConfigOptionInts { 200 });
|
||||||
|
|
||||||
|
def = this->add("thin_perimeters", coBool);
|
||||||
|
def->label = L("Overlapping perimeters");
|
||||||
|
def->full_label = L("Overlapping perimeters");
|
||||||
|
def->category = OptionCategory::perimeter;
|
||||||
|
def->tooltip = L("Allow external perimeter to overlap each other to avoid the use of thin walls. Note that their flow isn't adjusted and so it will result in over-extruding and undefined behavior.");
|
||||||
|
def->mode = comExpert;
|
||||||
|
def->set_default_value(new ConfigOptionBool(false));
|
||||||
|
|
||||||
def = this->add("thin_walls", coBool);
|
def = this->add("thin_walls", coBool);
|
||||||
def->label = L("");
|
def->label = L("");
|
||||||
def->full_label = L("Thin walls");
|
def->full_label = L("Thin walls");
|
||||||
def->category = OptionCategory::perimeter;
|
def->category = OptionCategory::perimeter;
|
||||||
def->tooltip = L("Detect single-width walls (parts where two extrusions don't fit and we need "
|
def->tooltip = L("Detect single-width walls (parts where two extrusions don't fit and we need "
|
||||||
"to collapse them into a single trace). If unchecked, slic3r may try to fit perimeters "
|
"to collapse them into a single trace). If unchecked, slic3r may try to fit perimeters "
|
||||||
"where it's not possible, creating some overlap leading to over-extrusion.");
|
"where it's not possible, creating some overlap leading to over-extrusion.");
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionBool(true));
|
def->set_default_value(new ConfigOptionBool(true));
|
||||||
|
|
||||||
|
@ -629,6 +629,7 @@ public:
|
|||||||
ConfigOptionInt solid_infill_every_layers;
|
ConfigOptionInt solid_infill_every_layers;
|
||||||
ConfigOptionFloatOrPercent solid_infill_speed;
|
ConfigOptionFloatOrPercent solid_infill_speed;
|
||||||
// Detect thin walls.
|
// Detect thin walls.
|
||||||
|
ConfigOptionBool thin_perimeters;
|
||||||
ConfigOptionBool thin_walls;
|
ConfigOptionBool thin_walls;
|
||||||
ConfigOptionFloatOrPercent thin_walls_min_width;
|
ConfigOptionFloatOrPercent thin_walls_min_width;
|
||||||
ConfigOptionFloatOrPercent thin_walls_overlap;
|
ConfigOptionFloatOrPercent thin_walls_overlap;
|
||||||
@ -696,6 +697,7 @@ protected:
|
|||||||
OPT_PTR(solid_infill_extrusion_width);
|
OPT_PTR(solid_infill_extrusion_width);
|
||||||
OPT_PTR(solid_infill_every_layers);
|
OPT_PTR(solid_infill_every_layers);
|
||||||
OPT_PTR(solid_infill_speed);
|
OPT_PTR(solid_infill_speed);
|
||||||
|
OPT_PTR(thin_perimeters);
|
||||||
OPT_PTR(thin_walls);
|
OPT_PTR(thin_walls);
|
||||||
OPT_PTR(thin_walls_min_width);
|
OPT_PTR(thin_walls_min_width);
|
||||||
OPT_PTR(thin_walls_overlap);
|
OPT_PTR(thin_walls_overlap);
|
||||||
|
@ -595,6 +595,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
|
|||||||
|| opt_key == "first_layer_extrusion_width"
|
|| opt_key == "first_layer_extrusion_width"
|
||||||
|| opt_key == "perimeter_extrusion_width"
|
|| opt_key == "perimeter_extrusion_width"
|
||||||
|| opt_key == "infill_overlap"
|
|| opt_key == "infill_overlap"
|
||||||
|
|| opt_key == "thin_perimeters"
|
||||||
|| opt_key == "thin_walls"
|
|| opt_key == "thin_walls"
|
||||||
|| opt_key == "thin_walls_min_width"
|
|| opt_key == "thin_walls_min_width"
|
||||||
|| opt_key == "thin_walls_overlap"
|
|| opt_key == "thin_walls_overlap"
|
||||||
|
@ -381,7 +381,9 @@ const std::vector<std::string>& Preset::print_options()
|
|||||||
"layer_height", "first_layer_height", "perimeters", "spiral_vase", "slice_closing_radius", "top_solid_layers", "bottom_solid_layers",
|
"layer_height", "first_layer_height", "perimeters", "spiral_vase", "slice_closing_radius", "top_solid_layers", "bottom_solid_layers",
|
||||||
"extra_perimeters",
|
"extra_perimeters",
|
||||||
"extra_perimeters_odd_layers",
|
"extra_perimeters_odd_layers",
|
||||||
"only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters", "thin_walls", "overhangs",
|
"only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters",
|
||||||
|
"thin_perimeters",
|
||||||
|
"thin_walls", "overhangs",
|
||||||
"overhangs_width",
|
"overhangs_width",
|
||||||
"seam_position",
|
"seam_position",
|
||||||
"external_perimeters_first",
|
"external_perimeters_first",
|
||||||
|
@ -1058,6 +1058,7 @@ void TabPrint::build()
|
|||||||
optgroup->append_single_option_line("only_one_perimeter_top");
|
optgroup->append_single_option_line("only_one_perimeter_top");
|
||||||
optgroup->append_single_option_line("ensure_vertical_shell_thickness");
|
optgroup->append_single_option_line("ensure_vertical_shell_thickness");
|
||||||
optgroup->append_single_option_line("avoid_crossing_perimeters");
|
optgroup->append_single_option_line("avoid_crossing_perimeters");
|
||||||
|
optgroup->append_single_option_line("thin_perimeters");
|
||||||
line = { _(L("Thin walls")), "" };
|
line = { _(L("Thin walls")), "" };
|
||||||
line.append_option(optgroup->get_option("thin_walls"));
|
line.append_option(optgroup->get_option("thin_walls"));
|
||||||
line.append_option(optgroup->get_option("thin_walls_min_width"));
|
line.append_option(optgroup->get_option("thin_walls_min_width"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user