-
-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cura 10732 testing 1 2 3 #1903
Cura 10732 testing 1 2 3 #1903
Conversation
Contributes to CURA-10732
Needed to get the compile database and the 3th party headers CURA-10732
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
found issue(s) with the introduced code (1/2)
Polygons Infill::generateWallToolPaths(std::vector<VariableWidthLines>& toolpaths, | ||
Polygons& outer_contour, | ||
const size_t wall_line_count, | ||
const coord_t line_width, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 adjacent parameters of generateWallToolPaths
of similar type (const cura::coord_t
) are easily swapped by mistake
const coord_t infill_overlap, | ||
const Settings& settings, | ||
int layer_idx, | ||
SectionType section_type) | ||
{ | ||
outer_contour = outer_contour.offset(infill_overlap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from cura::coord_t
(aka long long
) to signed type int
is implementation-defined
small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 | ||
&& ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty() | ||
) | ||
if (small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 && ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from long long
to signed type int
is implementation-defined
small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 | ||
&& ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty() | ||
) | ||
if (small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 && ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from long long
to signed type int
is implementation-defined
small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 | ||
&& ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty() | ||
) | ||
if (small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 && ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from long long
to double
small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 | ||
&& ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty() | ||
) | ||
if (small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 && ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10 is a magic number; consider replacing it with a named constant
small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 | ||
&& ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty() | ||
) | ||
if (small_infill_part.offset(-infill_line_width / 2).offset(infill_line_width / 2).area() < infill_line_width * infill_line_width * 10 && ! inner_contour.intersection(small_infill_part.offset(infill_line_width / 4)).empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from long long
to signed type int
is implementation-defined
generateLinearBasedInfill(result, line_distance, rotation_matrix, lines_processor, connected_zigzags, shift); | ||
} | ||
|
||
|
||
void Infill::generateZigZagInfill(Polygons& result, const coord_t line_distance, const double& infill_rotation) | ||
{ | ||
const coord_t shift = getShiftOffsetFromInfillOriginAndRotation(infill_rotation); | ||
const coord_t shift = getShiftOffsetFromInfillOriginAndRotation(infill_rotation); // and here | ||
|
||
PointMatrix rotation_matrix(infill_rotation); | ||
ZigzagConnectorProcessor zigzag_processor(rotation_matrix, result, use_endpieces, connected_zigzags, skip_some_zags, zag_skip_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from size_t
(aka unsigned long
) to signed type int
is implementation-defined
@@ -596,10 +609,10 @@ void Infill::generateLinearBasedInfill(Polygons& result, const int line_distance | |||
shift = shift % line_distance; | |||
} | |||
|
|||
AABB boundary(outline); | |||
AABB boundary__(outline); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declaration uses identifier boundary__
, which is a reserved identifier
@@ -596,10 +609,10 @@ void Infill::generateLinearBasedInfill(Polygons& result, const int line_distance | |||
shift = shift % line_distance; | |||
} | |||
|
|||
AABB boundary(outline); | |||
AABB boundary__(outline); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable boundary__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
found issue(s) with the introduced code (2/2)
|
||
int scanline_min_idx = computeScanSegmentIdx(boundary.min.X - shift, line_distance); | ||
int line_count = computeScanSegmentIdx(boundary.max.X - shift, line_distance) + 1 - scanline_min_idx; | ||
int scanline_min_idx = computeScanSegmentIdx(boundary__.min.X - shift, line_distance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from long long
to signed type int
is implementation-defined
int scanline_min_idx = computeScanSegmentIdx(boundary.min.X - shift, line_distance); | ||
int line_count = computeScanSegmentIdx(boundary.max.X - shift, line_distance) + 1 - scanline_min_idx; | ||
int scanline_min_idx = computeScanSegmentIdx(boundary__.min.X - shift, line_distance); | ||
int line_count = computeScanSegmentIdx(boundary__.max.X - shift, line_distance) + 1 - scanline_min_idx; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from long long
to signed type int
is implementation-defined
const int min_scanline_index = computeScanSegmentIdx(boundary.min.X - shift, line_distance) + 1; | ||
const int max_scanline_index = computeScanSegmentIdx(boundary.max.X - shift, line_distance) + 1; | ||
|
||
const int min_scanline_index = computeScanSegmentIdx(boundary__.min.X - shift, line_distance) + 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from long long
to signed type int
is implementation-defined
|
||
const int min_scanline_index = computeScanSegmentIdx(boundary__.min.X - shift, line_distance) + 2; | ||
|
||
const int max_scanline_index = computeScanSegmentIdx(boundary__.max.X - shift, line_distance) + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from long long
to signed type int
is implementation-defined
This version is needed for the printer-linter workflow Contributes to CURA-10732
Testing stuff Do not merge