@@ -826,7 +826,10 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
826
826
ExtrusionLoop *eloop = static_cast <ExtrusionLoop*>(coll.entities [idx.first ]);
827
827
coll.entities [idx.first ] = nullptr ;
828
828
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 ();
830
833
eloop->inset_idx = loop.depth ;
831
834
if (loop.is_contour ) {
832
835
out.append (std::move (children.entities ));
@@ -1295,7 +1298,10 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
1295
1298
if (!paths.empty ()) {
1296
1299
if (extrusion->is_closed ) {
1297
1300
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 ();
1299
1305
// TODO: it seems in practice that ExtrusionLoops occasionally have significantly disconnected paths,
1300
1306
// triggering the asserts below. Is this a problem?
1301
1307
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_
1890
1896
}
1891
1897
1892
1898
if (need_reverse && !isExternal) {
1893
- eloop->make_clockwise ();
1899
+ eloop->reverse ();
1894
1900
}
1895
1901
}
1896
1902
}
@@ -2244,18 +2250,17 @@ void PerimeterGenerator::process_classic()
2244
2250
// at this point, all loops should be in contours[0]
2245
2251
bool steep_overhang_contour = false ;
2246
2252
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
2250
2255
steep_overhang_contour = true ;
2251
2256
steep_overhang_hole = true ;
2252
2257
}
2253
2258
ExtrusionEntityCollection entities = traverse_loops (*this , contours.front (), thin_walls, steep_overhang_contour, steep_overhang_hole);
2254
2259
// 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 ) {
2256
2261
reorient_perimeters (entities, steep_overhang_contour, steep_overhang_hole,
2257
2262
// 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 );
2259
2264
}
2260
2265
2261
2266
// if brim will be printed, reverse the order of perimeters so that
@@ -3274,18 +3279,15 @@ void PerimeterGenerator::process_arachne()
3274
3279
3275
3280
bool steep_overhang_contour = false ;
3276
3281
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
3280
3284
steep_overhang_contour = true ;
3281
3285
steep_overhang_hole = true ;
3282
3286
}
3283
3287
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 ) {
3286
3289
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 );
3289
3291
}
3290
3292
this ->loops ->append (extrusion_coll);
3291
3293
}
0 commit comments