Combing polygon type#2231
Open
jellespijker wants to merge 3 commits intomainfrom
Open
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.
Contributor
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
[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.
Contributor
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.