Skip to content

Commit c2b304b

Browse files
committed
Remove "auto" wall direction
1 parent fb032cd commit c2b304b

File tree

6 files changed

+27
-29
lines changed

6 files changed

+27
-29
lines changed

src/libslic3r/GCode.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -4565,7 +4565,10 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
45654565

45664566
if (m_config.spiral_mode && !is_hole) {
45674567
// if spiral vase, we have to ensure that all contour are in the same orientation.
4568-
loop.make_counter_clockwise();
4568+
if (m_config.wall_direction == WallDirection::CounterClockwise)
4569+
loop.make_counter_clockwise();
4570+
else
4571+
loop.make_clockwise();
45694572
}
45704573
if (loop.loop_role() == elrSkirt && (this->m_layer->id() % 2 == 1))
45714574
loop.reverse();
@@ -4626,7 +4629,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
46264629
// 1 - the currently printed external perimeter and 2 - the neighbouring internal perimeter.
46274630
if (m_config.wipe_before_external_loop.value && !paths.empty() && paths.front().size() > 1 && paths.back().size() > 1 && paths.front().role() == erExternalPerimeter && region_perimeters.size() > 1) {
46284631
const bool is_full_loop_ccw = loop.polygon().is_counter_clockwise();
4629-
bool is_hole_loop = (loop.loop_role() & ExtrusionLoopRole::elrHole) != 0; // loop.make_counter_clockwise();
4632+
bool is_hole_loop = (loop.loop_role() & ExtrusionLoopRole::elrHole) != 0;
46304633
const double nozzle_diam = nozzle_diameter;
46314634

46324635
// note: previous & next are inverted to extrude "in the opposite direction, and we are "rewinding"

src/libslic3r/PerimeterGenerator.cpp

+17-15
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,10 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
782782
ExtrusionLoop *eloop = static_cast<ExtrusionLoop*>(coll.entities[idx.first]);
783783
coll.entities[idx.first] = nullptr;
784784

785-
eloop->make_counter_clockwise();
785+
if (perimeter_generator.config->wall_direction == WallDirection::CounterClockwise)
786+
eloop->make_counter_clockwise();
787+
else
788+
eloop->make_clockwise();
786789
eloop->inset_idx = loop.depth;
787790
if (loop.is_contour) {
788791
out.append(std::move(children.entities));
@@ -1238,7 +1241,10 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
12381241
if (!paths.empty()) {
12391242
if (extrusion->is_closed) {
12401243
ExtrusionLoop extrusion_loop(std::move(paths), pg_extrusion.is_contour ? elrDefault : elrHole);
1241-
extrusion_loop.make_counter_clockwise();
1244+
if (perimeter_generator.config->wall_direction == WallDirection::CounterClockwise)
1245+
extrusion_loop.make_counter_clockwise();
1246+
else
1247+
extrusion_loop.make_clockwise();
12421248
// TODO: it seems in practice that ExtrusionLoops occasionally have significantly disconnected paths,
12431249
// triggering the asserts below. Is this a problem?
12441250
for (auto it = std::next(extrusion_loop.paths.begin()); it != extrusion_loop.paths.end(); ++it) {
@@ -1827,7 +1833,7 @@ static void reorient_perimeters(ExtrusionEntityCollection &entities, bool steep_
18271833
}
18281834

18291835
if (need_reverse && !isExternal) {
1830-
eloop->make_clockwise();
1836+
eloop->reverse();
18311837
}
18321838
}
18331839
}
@@ -2177,18 +2183,17 @@ void PerimeterGenerator::process_classic()
21772183
// at this point, all loops should be in contours[0]
21782184
bool steep_overhang_contour = false;
21792185
bool steep_overhang_hole = false;
2180-
const WallDirection wall_direction = config->wall_direction;
2181-
if (wall_direction != WallDirection::Auto) {
2182-
// Skip steep overhang detection if wall direction is specified
2186+
if (!config->overhang_reverse) {
2187+
// Skip steep overhang detection no reverse is specified
21832188
steep_overhang_contour = true;
21842189
steep_overhang_hole = true;
21852190
}
21862191
ExtrusionEntityCollection entities = traverse_loops(*this, contours.front(), thin_walls, steep_overhang_contour, steep_overhang_hole);
21872192
// All walls are counter-clockwise initially, so we don't need to reorient it if that's what we want
2188-
if (wall_direction != WallDirection::CounterClockwise) {
2193+
if (config->overhang_reverse) {
21892194
reorient_perimeters(entities, steep_overhang_contour, steep_overhang_hole,
21902195
// Reverse internal only if the wall direction is auto
2191-
this->config->overhang_reverse_internal_only && wall_direction == WallDirection::Auto);
2196+
this->config->overhang_reverse_internal_only);
21922197
}
21932198

21942199
// if brim will be printed, reverse the order of perimeters so that
@@ -3191,18 +3196,15 @@ void PerimeterGenerator::process_arachne()
31913196

31923197
bool steep_overhang_contour = false;
31933198
bool steep_overhang_hole = false;
3194-
const WallDirection wall_direction = config->wall_direction;
3195-
if (wall_direction != WallDirection::Auto) {
3196-
// Skip steep overhang detection if wall direction is specified
3199+
if (!config->overhang_reverse) {
3200+
// Skip steep overhang detection no reverse is specified
31973201
steep_overhang_contour = true;
31983202
steep_overhang_hole = true;
31993203
}
32003204
if (ExtrusionEntityCollection extrusion_coll = traverse_extrusions(*this, ordered_extrusions, steep_overhang_contour, steep_overhang_hole); !extrusion_coll.empty()) {
3201-
// All walls are counter-clockwise initially, so we don't need to reorient it if that's what we want
3202-
if (wall_direction != WallDirection::CounterClockwise) {
3205+
if (config->overhang_reverse) {
32033206
reorient_perimeters(extrusion_coll, steep_overhang_contour, steep_overhang_hole,
3204-
// Reverse internal only if the wall direction is auto
3205-
this->config->overhang_reverse_internal_only && wall_direction == WallDirection::Auto);
3207+
this->config->overhang_reverse_internal_only);
32063208
}
32073209
this->loops->append(extrusion_coll);
32083210
}

src/libslic3r/PrintConfig.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(WallSequence)
176176

177177
//Orca
178178
static t_config_enum_values s_keys_map_WallDirection{
179-
{ "auto", int(WallDirection::Auto) },
180179
{ "ccw", int(WallDirection::CounterClockwise) },
181180
{ "cw", int(WallDirection::Clockwise)},
182181
};
@@ -1589,14 +1588,12 @@ void PrintConfigDef::init_fff_params()
15891588
def->category = L("Quality");
15901589
def->tooltip = L("The direction which the wall loops are extruded when looking down from the top.\n\nBy default all walls are extruded in counter-clockwise, unless Reverse on even is enabled. Set this to any option other than Auto will force the wall direction regardless of the Reverse on even.\n\nThis option will be disabled if spiral vase mode is enabled.");
15911590
def->enum_keys_map = &ConfigOptionEnum<WallDirection>::get_enum_values();
1592-
def->enum_values.push_back("auto");
15931591
def->enum_values.push_back("ccw");
15941592
def->enum_values.push_back("cw");
1595-
def->enum_labels.push_back(L("Auto"));
15961593
def->enum_labels.push_back(L("Counter clockwise"));
15971594
def->enum_labels.push_back(L("Clockwise"));
15981595
def->mode = comAdvanced;
1599-
def->set_default_value(new ConfigOptionEnum<WallDirection>(WallDirection::Auto));
1596+
def->set_default_value(new ConfigOptionEnum<WallDirection>(WallDirection::CounterClockwise));
16001597

16011598
def = this->add("extruder", coInt);
16021599
def->gui_type = ConfigOptionDef::GUIType::i_enum_open;
@@ -6232,6 +6229,9 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
62326229
else if(opt_key == "counterbole_hole_bridging") {
62336230
opt_key = "counterbore_hole_bridging";
62346231
}
6232+
else if (opt_key == "wall_direction" && value == "auto") {
6233+
value = "ccw";
6234+
}
62356235
else if (opt_key == "draft_shield" && value == "limited") {
62366236
value = "disabled";
62376237
} else if (opt_key == "overhang_speed_classic") {

src/libslic3r/PrintConfig.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ enum class WallSequence {
8585
// Orca
8686
enum class WallDirection
8787
{
88-
Auto,
8988
CounterClockwise,
9089
Clockwise,
9190
Count,

src/slic3r/GUI/ConfigManipulation.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
293293
config->opt_int("enforce_support_layers") == 0 &&
294294
! config->opt_bool("detect_thin_wall") &&
295295
! config->opt_bool("overhang_reverse") &&
296-
config->opt_enum<WallDirection>("wall_direction") == WallDirection::Auto &&
297296
config->opt_enum<TimelapseType>("timelapse_type") == TimelapseType::tlTraditional))
298297
{
299298
DynamicPrintConfig new_conf = *config;
@@ -307,7 +306,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
307306
new_conf.set_key_value("enforce_support_layers", new ConfigOptionInt(0));
308307
new_conf.set_key_value("detect_thin_wall", new ConfigOptionBool(false));
309308
new_conf.set_key_value("overhang_reverse", new ConfigOptionBool(false));
310-
new_conf.set_key_value("wall_direction", new ConfigOptionEnum<WallDirection>(WallDirection::Auto));
311309
new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
312310
sparse_infill_density = 0;
313311
timelapse_type = TimelapseType::tlTraditional;
@@ -540,8 +538,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
540538
toggle_field("top_shell_thickness", ! has_spiral_vase && has_top_solid_infill);
541539
toggle_field("bottom_shell_thickness", ! has_spiral_vase && has_bottom_solid_infill);
542540

543-
toggle_field("wall_direction", !has_spiral_vase);
544-
545541
// Gap fill is newly allowed in between perimeter lines even for empty infill (see GH #1476).
546542
toggle_field("gap_infill_speed", have_perimeters);
547543

@@ -735,8 +731,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
735731

736732
bool has_detect_overhang_wall = config->opt_bool("detect_overhang_wall");
737733
bool has_overhang_reverse = config->opt_bool("overhang_reverse");
738-
bool force_wall_direction = config->opt_enum<WallDirection>("wall_direction") != WallDirection::Auto;
739-
bool allow_overhang_reverse = !has_spiral_vase && !force_wall_direction;
734+
bool allow_overhang_reverse = !has_spiral_vase;
740735
toggle_field("overhang_reverse", allow_overhang_reverse);
741736
toggle_field("overhang_reverse_threshold", has_detect_overhang_wall);
742737
toggle_line("overhang_reverse_threshold", allow_overhang_reverse && has_overhang_reverse);

src/slic3r/GUI/PartPlate.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -2393,7 +2393,6 @@ void PartPlate::set_vase_mode_related_object_config(int obj_id) {
23932393
new_conf.set_key_value("detect_thin_wall", new ConfigOptionBool(false));
23942394
new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
23952395
new_conf.set_key_value("overhang_reverse", new ConfigOptionBool(false));
2396-
new_conf.set_key_value("wall_direction", new ConfigOptionEnum<WallDirection>(WallDirection::Auto));
23972396
auto applying_keys = global_config->diff(new_conf);
23982397

23992398
for (ModelObject* object : obj_ptrs) {

0 commit comments

Comments
 (0)