Skip to content

Feat/bidir offset table - #536

Merged
knipknap merged 7 commits into
barebaric:mainfrom
switch87:feat/bidir-offset-table
Oct 12, 2026
Merged

knipknap merged 7 commits into
barebaric:mainfrom
switch87:feat/bidir-offset-table

Conversation

@switch87

@switch87 switch87 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Added

Fixed

…former

Since the pipeline moved to raygeo intents, _transformer_settings()
only carried machine-wide values, so BidirScanOffsetTransformer always
saw an offset of 0 and the Engrave step's Bidirectional Scan Offset had
no effect.

Build the transformer settings per step and add the step's cut speed
and bidir_x_offset_mm. Fold both into the workpiece compute token, as
the offset is applied inside the compute stage and a changed value must
not be served from the cache.

Refs barebaric#307
On machines where the laser fires with a fixed delay, the skew between
left-to-right and right-to-left raster passes grows with the speed, so
one offset per step only fits one speed.

- Machine.bidir_offset_table holds (speed mm/min, offset mm) rows,
  sorted by speed, saved with the machine profile.
- interpolate_bidir_offset() interpolates linearly between rows and
  clamps to the first and last row; an empty table means 0.
- BidirScanOffsetTransformer keeps a non-zero per-step offset and
  otherwise looks up the step's speed in the table, which the intent
  builder passes along and folds into the compute token.

Refs barebaric#307
The Advanced page of the machine settings gains a "Bidirectional Scan
Offset by Speed" group: one expandable row per speed with unit-aware
speed and offset fields, an add button that appends a row 1000 mm/min
above the fastest one (or at the maximum cut speed for an empty table)
and a remove button per row.

Refs barebaric#307
@knipknap

Copy link
Copy Markdown
Contributor

Thanks for this very useful PR! I added some commits on top, it looks ready to me.

@knipknap
knipknap merged commit c9ac566 into barebaric:main Oct 12, 2026
32 checks passed
@switch87
switch87 deleted the feat/bidir-offset-table branch October 12, 2026 18:58

This branch was successfully deployed

1 active deployment
pypi — c5494479 Deployed Oct 11, 2026 by knipknap via Build and Publish Wheel #2230
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.

2 participants