-
-
Notifications
You must be signed in to change notification settings - Fork 909
Combing polygon type #2231
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
base: main
Are you sure you want to change the base?
Combing polygon type #2231
Conversation
A new setting `combing_polygon_type` was introduced that allows you to specify which polygons should be used for combing. The available options are: - `OuterWall`: Uses the original combing boundaries (default behavior). - `Outline`: Uses the general layer outlines for combing. - `SecondWall`: Uses the second wall polygons for combing. The `Comb::calc` function has been modified to read this setting and select the appropriate polygons for combing. If the selected polygon type results in no usable polygons or if an invalid type is specified, the logic falls back to the default behavior.
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.
Pull Request Overview
This PR introduces a new combing_polygon_type setting to let users choose between outer wall, outline, second wall, or plugin boundaries for combing paths.
Key changes:
- Added
CombingPolygonTypeenum and its mapping in settings. - Updated
Comb::calcto branch on the selected polygon type and fall back to outer wall if unavailable. - Added unit tests covering the new combing polygon options (outer wall, outline, second wall, and fallback).
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| include/settings/EnumSettings.h | Added CombingPolygonType enum. |
| src/settings/Settings.cpp | Specialization of Settings::get<CombingPolygonType> for parsing. |
| src/pathPlanning/Comb.cpp | Read new setting, select appropriate boundary shapes, and adjust comb logic. |
| tests/src/pathPlanning/CombTest.cpp | New tests for each combing polygon type and fallback behavior. |
Comments suppressed due to low confidence (1)
tests/src/pathPlanning/CombTest.cpp:234
- There are no tests covering the PLUGIN polygon type or invalid setting values. Adding at least one test for the PLUGIN case (and an invalid-string fallback) would ensure full coverage of the new branches.
}
| bool use_original_boundaries = true; | ||
|
|
||
| // Determine if alternative boundaries are needed based on the setting | ||
| switch (combing_polygon_type) |
Copilot
AI
May 23, 2025
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.
[nitpick] The switch block for selecting boundaries is fairly large and duplicated for optimal/minimum handling. Refactoring into a helper function or strategy pattern could reduce duplication and improve readability.
Co-authored-by: Copilot <[email protected]>
This PR is made by jules.google.com, I did not review or test it, but according to Jules it should be a solution to #2193
The following changes were made:
A new setting
combing_polygon_typewas introduced that allows you to specify which polygons should be used for combing. The available options are:OuterWall: Uses the original combing boundaries (default behavior).Outline: Uses the general layer outlines for combing.SecondWall: Uses the second wall polygons for combing.The
Comb::calcfunction has been modified to read this setting and select the appropriate polygons for combing. If the selected polygon type results in no usable polygons or if an invalid type is specified, the logic falls back to the default behavior.