Skip to content

Conversation

@wawanbreton
Copy link
Contributor

@wawanbreton wawanbreton commented Feb 5, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2025

Test Results

0 tests   - 27   0 ✅  - 27   0s ⏱️ -5s
0 suites  -  1   0 💤 ± 0 
0 files    -  1   0 ❌ ± 0 

Results for commit d0a8857. ± Comparison against base commit c4663ef.

♻️ This comment has been updated with latest results.

Copy link
Member

@jellespijker jellespijker left a 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.

Copy link
Member

@jellespijker jellespijker left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@rburema rburema left a 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
@jellespijker jellespijker requested a review from Copilot June 12, 2025 08:42
Copy link

Copilot AI left a 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;

wawanbreton and others added 6 commits June 12, 2025 15:47
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;
@HellAholic HellAholic merged commit dda8cea into main Jun 20, 2025
11 of 15 checks passed
@HellAholic HellAholic deleted the CURA-11978_retract-and-unretract-in-a-travel branch June 20, 2025 12:51
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.

5 participants