Skip to content
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

Closed
wants to merge 7 commits into from
Closed

Cura 10732 testing 1 2 3 #1903

wants to merge 7 commits into from

Conversation

jellespijker
Copy link
Member

Testing stuff Do not merge

Copy link
Contributor

@github-actions github-actions bot left a 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-easily-swappable-parameters ⚠️
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-avoid-magic-numbers ⚠️
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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-reserved-identifier ⚠️
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable boundary__

Copy link
Contributor

@github-actions github-actions bot left a 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-narrowing-conversions ⚠️
narrowing conversion from long long to signed type int is implementation-defined

@github-actions
Copy link
Contributor

github-actions bot commented Jul 12, 2023

Unit Test Results

26 tests  ±0   24 ✔️  - 2   12s ⏱️ -1s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     2 +2 

For more details on these failures, see this check.

Results for commit 0dd4893. ± Comparison against base commit ef46801.

♻️ This comment has been updated with latest results.

This version is needed for the printer-linter workflow

Contributes to CURA-10732
@jellespijker jellespijker deleted the CURA-10732_testing_1_2_3 branch July 19, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants