@@ -782,7 +782,10 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
782
782
ExtrusionLoop *eloop = static_cast <ExtrusionLoop*>(coll.entities [idx.first ]);
783
783
coll.entities [idx.first ] = nullptr ;
784
784
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 ();
786
789
eloop->inset_idx = loop.depth ;
787
790
if (loop.is_contour ) {
788
791
out.append (std::move (children.entities ));
@@ -1238,7 +1241,10 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
1238
1241
if (!paths.empty ()) {
1239
1242
if (extrusion->is_closed ) {
1240
1243
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 ();
1242
1248
// TODO: it seems in practice that ExtrusionLoops occasionally have significantly disconnected paths,
1243
1249
// triggering the asserts below. Is this a problem?
1244
1250
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_
1827
1833
}
1828
1834
1829
1835
if (need_reverse && !isExternal) {
1830
- eloop->make_clockwise ();
1836
+ eloop->reverse ();
1831
1837
}
1832
1838
}
1833
1839
}
@@ -2177,18 +2183,17 @@ void PerimeterGenerator::process_classic()
2177
2183
// at this point, all loops should be in contours[0]
2178
2184
bool steep_overhang_contour = false ;
2179
2185
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
2183
2188
steep_overhang_contour = true ;
2184
2189
steep_overhang_hole = true ;
2185
2190
}
2186
2191
ExtrusionEntityCollection entities = traverse_loops (*this , contours.front (), thin_walls, steep_overhang_contour, steep_overhang_hole);
2187
2192
// 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 ) {
2189
2194
reorient_perimeters (entities, steep_overhang_contour, steep_overhang_hole,
2190
2195
// 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 );
2192
2197
}
2193
2198
2194
2199
// if brim will be printed, reverse the order of perimeters so that
@@ -3191,18 +3196,15 @@ void PerimeterGenerator::process_arachne()
3191
3196
3192
3197
bool steep_overhang_contour = false ;
3193
3198
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
3197
3201
steep_overhang_contour = true ;
3198
3202
steep_overhang_hole = true ;
3199
3203
}
3200
3204
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 ) {
3203
3206
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 );
3206
3208
}
3207
3209
this ->loops ->append (extrusion_coll);
3208
3210
}
0 commit comments