#197 fix random seam : forgot that the '&' operator has a low priority.

This commit is contained in:
supermerill 2020-04-17 16:05:14 +02:00
parent 66aaad2489
commit e28213b6eb
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ enum ExtrusionRole : uint8_t {
// Special flags describing loop
enum ExtrusionLoopRole : uint16_t {
elrDefault = 0,
elrDefault = 1 << 0, //1
// doesn't contains more contour: it's the most internal one
elrInternal = 1 << 1, //2
elrSkirt = 1 << 2, //4

View File

@ -2664,7 +2664,7 @@ std::string GCode::extrude_loop_vase(const ExtrusionLoop &original_loop, const s
// extrude all loops ccw
//no! this was decided in perimeter_generator
bool is_hole_loop = loop.loop_role() & ExtrusionLoopRole::elrHole != 0;// loop.make_counter_clockwise();
bool is_hole_loop = (loop.loop_role() & ExtrusionLoopRole::elrHole) != 0;// loop.make_counter_clockwise();
bool reverse_turn = loop.polygon().is_clockwise() ^ is_hole_loop;
split_at_seam_pos(loop, lower_layer_edge_grid);
@ -3055,7 +3055,7 @@ void GCode::split_at_seam_pos(ExtrusionLoop &loop, std::unique_ptr<EdgeGrid::Gri
loop.split_at(polygon.points[idx_min], true);
} else if (seam_position == spRandom) {
if (loop.loop_role() & elrInternal == 0) {
if ( (loop.loop_role() & elrInternal) == 0) {
// This loop does not contain any other (not-hole) loop. Set a random position.
// The other loops will get a seam close to the random point chosen
// on the inner most contour.