Skip to content

Commit bff68de

Browse files
committed
Remove "auto" wall direction
1 parent 32efc17 commit bff68de

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
@@ -4644,7 +4644,10 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
46444644

46454645
if (m_config.spiral_mode && !is_hole) {
46464646
// if spiral vase, we have to ensure that all contour are in the same orientation.
4647-
loop.make_counter_clockwise();
4647+
if (m_config.wall_direction == WallDirection::CounterClockwise)
4648+
loop.make_counter_clockwise();
4649+
else
4650+
loop.make_clockwise();
46484651
}
46494652
//if (loop.loop_role() == elrSkirt && (this->m_layer->id() % 2 == 1))
46504653
// loop.reverse();
@@ -4705,7 +4708,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
47054708
// 1 - the currently printed external perimeter and 2 - the neighbouring internal perimeter.
47064709
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) {
47074710
const bool is_full_loop_ccw = loop.polygon().is_counter_clockwise();
4708-
bool is_hole_loop = (loop.loop_role() & ExtrusionLoopRole::elrHole) != 0; // loop.make_counter_clockwise();
4711+
bool is_hole_loop = (loop.loop_role() & ExtrusionLoopRole::elrHole) != 0;
47094712
const double nozzle_diam = nozzle_diameter;
47104713

47114714
// 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
@@ -826,7 +826,10 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
826826
ExtrusionLoop *eloop = static_cast<ExtrusionLoop*>(coll.entities[idx.first]);
827827
coll.entities[idx.first] = nullptr;
828828

829-
eloop->make_counter_clockwise();
829+
if (perimeter_generator.config->wall_direction == WallDirection::CounterClockwise)
830+
eloop->make_counter_clockwise();
831+
else
832+
eloop->make_clockwise();
830833
eloop->inset_idx = loop.depth;
831834
if (loop.is_contour) {
832835
out.append(std::move(children.entities));
@@ -1295,7 +1298,10 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
12951298
if (!paths.empty()) {
12961299
if (extrusion->is_closed) {
12971300
ExtrusionLoop extrusion_loop(std::move(paths), pg_extrusion.is_contour ? elrDefault : elrHole);
1298-
extrusion_loop.make_counter_clockwise();
1301+
if (perimeter_generator.config->wall_direction == WallDirection::CounterClockwise)
1302+
extrusion_loop.make_counter_clockwise();
1303+
else
1304+
extrusion_loop.make_clockwise();
12991305
// TODO: it seems in practice that ExtrusionLoops occasionally have significantly disconnected paths,
13001306
// triggering the asserts below. Is this a problem?
13011307
for (auto it = std::next(extrusion_loop.paths.begin()); it != extrusion_loop.paths.end(); ++it) {
@@ -1890,7 +1896,7 @@ static void reorient_perimeters(ExtrusionEntityCollection &entities, bool steep_
18901896
}
18911897

18921898
if (need_reverse && !isExternal) {
1893-
eloop->make_clockwise();
1899+
eloop->reverse();
18941900
}
18951901
}
18961902
}
@@ -2244,18 +2250,17 @@ void PerimeterGenerator::process_classic()
22442250
// at this point, all loops should be in contours[0]
22452251
bool steep_overhang_contour = false;
22462252
bool steep_overhang_hole = false;
2247-
const WallDirection wall_direction = config->wall_direction;
2248-
if (wall_direction != WallDirection::Auto) {
2249-
// Skip steep overhang detection if wall direction is specified
2253+
if (!config->overhang_reverse) {
2254+
// Skip steep overhang detection no reverse is specified
22502255
steep_overhang_contour = true;
22512256
steep_overhang_hole = true;
22522257
}
22532258
ExtrusionEntityCollection entities = traverse_loops(*this, contours.front(), thin_walls, steep_overhang_contour, steep_overhang_hole);
22542259
// All walls are counter-clockwise initially, so we don't need to reorient it if that's what we want
2255-
if (wall_direction != WallDirection::CounterClockwise) {
2260+
if (config->overhang_reverse) {
22562261
reorient_perimeters(entities, steep_overhang_contour, steep_overhang_hole,
22572262
// Reverse internal only if the wall direction is auto
2258-
this->config->overhang_reverse_internal_only && wall_direction == WallDirection::Auto);
2263+
this->config->overhang_reverse_internal_only);
22592264
}
22602265

22612266
// if brim will be printed, reverse the order of perimeters so that
@@ -3274,18 +3279,15 @@ void PerimeterGenerator::process_arachne()
32743279

32753280
bool steep_overhang_contour = false;
32763281
bool steep_overhang_hole = false;
3277-
const WallDirection wall_direction = config->wall_direction;
3278-
if (wall_direction != WallDirection::Auto) {
3279-
// Skip steep overhang detection if wall direction is specified
3282+
if (!config->overhang_reverse) {
3283+
// Skip steep overhang detection no reverse is specified
32803284
steep_overhang_contour = true;
32813285
steep_overhang_hole = true;
32823286
}
32833287
if (ExtrusionEntityCollection extrusion_coll = traverse_extrusions(*this, ordered_extrusions, steep_overhang_contour, steep_overhang_hole); !extrusion_coll.empty()) {
3284-
// All walls are counter-clockwise initially, so we don't need to reorient it if that's what we want
3285-
if (wall_direction != WallDirection::CounterClockwise) {
3288+
if (config->overhang_reverse) {
32863289
reorient_perimeters(extrusion_coll, steep_overhang_contour, steep_overhang_hole,
3287-
// Reverse internal only if the wall direction is auto
3288-
this->config->overhang_reverse_internal_only && wall_direction == WallDirection::Auto);
3290+
this->config->overhang_reverse_internal_only);
32893291
}
32903292
this->loops->append(extrusion_coll);
32913293
}

src/libslic3r/PrintConfig.cpp

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

193193
//Orca
194194
static t_config_enum_values s_keys_map_WallDirection{
195-
{ "auto", int(WallDirection::Auto) },
196195
{ "ccw", int(WallDirection::CounterClockwise) },
197196
{ "cw", int(WallDirection::Clockwise)},
198197
};
@@ -1701,14 +1700,12 @@ void PrintConfigDef::init_fff_params()
17011700
def->category = L("Quality");
17021701
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.");
17031702
def->enum_keys_map = &ConfigOptionEnum<WallDirection>::get_enum_values();
1704-
def->enum_values.push_back("auto");
17051703
def->enum_values.push_back("ccw");
17061704
def->enum_values.push_back("cw");
1707-
def->enum_labels.push_back(L("Auto"));
17081705
def->enum_labels.push_back(L("Counter clockwise"));
17091706
def->enum_labels.push_back(L("Clockwise"));
17101707
def->mode = comAdvanced;
1711-
def->set_default_value(new ConfigOptionEnum<WallDirection>(WallDirection::Auto));
1708+
def->set_default_value(new ConfigOptionEnum<WallDirection>(WallDirection::CounterClockwise));
17121709

17131710
def = this->add("extruder", coInt);
17141711
def->gui_type = ConfigOptionDef::GUIType::i_enum_open;
@@ -6506,6 +6503,9 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
65066503
} else if (opt_key == "overhang_speed_classic") {
65076504
value = "0";
65086505
}
6506+
else if (opt_key == "wall_direction" && value == "auto") {
6507+
value = "ccw";
6508+
}
65096509

65106510
// Ignore the following obsolete configuration keys:
65116511
static std::set<std::string> ignore = {

src/libslic3r/PrintConfig.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ enum class WallSequence {
9393
// Orca
9494
enum class WallDirection
9595
{
96-
Auto,
9796
CounterClockwise,
9897
Clockwise,
9998
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;
@@ -544,8 +542,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
544542
toggle_field("top_shell_thickness", ! has_spiral_vase && has_top_shell);
545543
toggle_field("bottom_shell_thickness", ! has_spiral_vase && has_bottom_shell);
546544

547-
toggle_field("wall_direction", !has_spiral_vase);
548-
549545
// Gap fill is newly allowed in between perimeter lines even for empty infill (see GH #1476).
550546
toggle_field("gap_infill_speed", have_perimeters);
551547

@@ -747,8 +743,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
747743

748744
bool has_detect_overhang_wall = config->opt_bool("detect_overhang_wall");
749745
bool has_overhang_reverse = config->opt_bool("overhang_reverse");
750-
bool force_wall_direction = config->opt_enum<WallDirection>("wall_direction") != WallDirection::Auto;
751-
bool allow_overhang_reverse = !has_spiral_vase && !force_wall_direction;
746+
bool allow_overhang_reverse = !has_spiral_vase;
752747
toggle_field("overhang_reverse", allow_overhang_reverse);
753748
toggle_field("overhang_reverse_threshold", has_detect_overhang_wall);
754749
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
@@ -2406,7 +2406,6 @@ void PartPlate::set_vase_mode_related_object_config(int obj_id) {
24062406
new_conf.set_key_value("detect_thin_wall", new ConfigOptionBool(false));
24072407
new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
24082408
new_conf.set_key_value("overhang_reverse", new ConfigOptionBool(false));
2409-
new_conf.set_key_value("wall_direction", new ConfigOptionEnum<WallDirection>(WallDirection::Auto));
24102409
auto applying_keys = global_config->diff(new_conf);
24112410

24122411
for (ModelObject* object : obj_ptrs) {

0 commit comments

Comments
 (0)