-
-
Notifications
You must be signed in to change notification settings - Fork 913
CURA-11978 Retract and unretract in a travel #2204
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-11978 Retract and unretract in a travel #2204
Conversation
CURA-11978 Unretraction during travel computed but not applied yet
…-in-a-travel' into CURA-11978_retract-and-unretract-in-a-travel
…d-unretract-in-a-travel
…-in-a-travel' into CURA-11978_retract-and-unretract-in-a-travel
jellespijker
left a comment
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.
Overal it looks good and well thought out, a couple of minor remarks and suggestions. But I do suggest adding some UT
given the complexity of splitting travel moves into multiple phases, maybe add unit and integration tests that cover:
- A travel move with enough duration for all retraction/priming to happen during travel.
- A travel move where extra stationary time is required.
- Edge cases with only one travel segment.
- Both “forward” (retraction) and “reversed” (priming) computations.
…-in-a-travel' into CURA-11978_retract-and-unretract-in-a-travel
jellespijker
left a comment
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.
LGTM
…d-unretract-in-a-travel
…avel CURA-11978 This is better than adding an extra retract/prime while stationary, which will definitely create quality inconsistencies
rburema
left a comment
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.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: ba9a413 | Previous: 9407398 | Ratio |
|---|---|---|---|
SimplifyTestFixture/simplify_slot_noplugin |
1.8991011594283138 ns/iter |
1.2622070236637801 ns/iter |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @nallath @jellespijker @wawanbreton @casperlamboo @saumyaj3 @HellAholic
CURA-11978 Z-Hop processing now requires the layer_height setting to be set
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 implements changes for CURA-11978 by updating the retraction and unretraction behavior during travel moves. Key changes include renaming of PrintFeature types (e.g. MoveCombing → MoveUnretracted, MoveRetraction → MoveRetracted), extending function signatures (e.g. adding optional retraction distances in travel functions), and introducing new tests and utilities (such as AntiOozeAmountsTest and TravelAntiOozing types) to validate the retraction/priming logic.
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/* | Updates to test cases and CMakeLists, adding AntiOozeAmountsTest |
| src/settings/* | Minor signature updates for Settings::add |
| src/plugins/converters.cpp | Renaming of PrintFeature types for consistency |
| src/gcodeExport.cpp | Extensive refactoring of travel/retraction functions and API signature improvements |
| src/communication/* | Mapping updates for PrintFeature type names in communications |
| src/LayerPlan.cpp | New functions for computing travel durations and anti-ooze amounts, and integration in writeGCode |
| include/* | Adjustments in header definitions and enum changes to reflect the new API |
Comments suppressed due to low confidence (1)
src/LayerPlan.cpp:2267
- [nitpick] The rationale behind adding 1.0 to the calculated ratio may not be immediately clear. Adding an inline comment to explain the purpose of this adjustment would improve readability and future maintainability.
const Ratio allocated_amount_ratio = (free_time_during_travel / total_anti_ooze_expected_duration_during_travel) + 1.0;
CURA-11978 When switching from an extruder to an other one, the current_position_ of the GCodeExport is no more consistent, because this position includes nozzle offset, which depends on the extruder. We now apply the delta of the offsets so that the new position is relative to the new extruder, and subsequent algorithms use the expected position. In this case, calculations over travel move, which now requires the start position.
CURA-11978 In a case where e.g. the prime would be 100% done during travel, but we don't have enough time to perform it, we would reduce the prime but not reduce the retract amount during stationary accordingly. Now we retract stationary amounts so that the global retract/prime ratio remains the same.
StationaryRetractUnretract = 14; NumPrintFeatureTypes = 15;
Applies retraction and priming during travel move, partially or completely according to the given settings.
Most calculations are done according to durations, because we want to respect both the travel speed and the retraction/prime speed. If we don't have enough time to process the retraction/prime during travel, we will make a stationary retraction/prime irregardless of the setting, because there is no other way to respect the speeds.
Requires Ultimaker/Cura#20240
CURA-11978