Skip to content

GCodeLoader: Fix extrusion detection in relative mode. - #34895

Merged
Mugen87 merged 4 commits into
mrdoob:devfrom
scottcampbelldata:fix/gcode-relative-extrusion
Oct 8, 2026
Merged

Mugen87 merged 4 commits into
mrdoob:devfrom
scottcampbelldata:fix/gcode-relative-extrusion

Conversation

@scottcampbelldata

@scottcampbelldata scottcampbelldata commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixed #34876

Description

absoluteExtrusion() already turns line.e into an absolute value, but the extrusion check still went through delta(), which returns the raw value in G91 mode. So after G91 the check was looking at the absolute E position instead of the change, and any move with E > 0 so far counted as extrusion. A plain travel move or a retract under G91 + M82 got drawn green.

The check now just compares line.e > state.e, and the unused delta() is gone.

Added GCodeLoader.tests.js with the cases from the issue. In benchy.gcode the end-of-print retract and lift after G91 is now drawn as travel. Nothing else changes, and test_m82.gcode / test_m83.gcode give the same output as before.

line.e is already absolute after absoluteExtrusion(), so compare it to
state.e directly. With G91 the old check used the absolute E position
as the delta, so travel moves and retracts were drawn as extrusion.

Fixes #34876.
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

🖼️ E2E screenshot tests

✅ All examples render correctly again (run).

@mrdoob mrdoob added this to the r187 milestone Oct 8, 2026
@Mugen87
Mugen87 merged commit e3e482a into mrdoob:dev Oct 8, 2026
7 of 8 checks passed
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.

GCodeLoader marks relative travel moves as extrusion

3 participants