Repository navigation
feat(frame): let the user choose whether the frame includes overscan - #566
Conversation
The machine frame traces the whole job artifact rect, which includes the engraving overscan margin: the overscan transformer extends raster lines with zero-power lead-in/lead-out moves for acceleration room, so the framed outline overshoots the artwork, mainly in X (issue #563). The frame button now opens a popover (like the one for equidistant tabs) with an 'Include Overscan Margin' switch. When the switch is off, the frame is built from the envelope the laser actually burns — Ops.burning_rect(), added to raygeo — instead of the full machine path. On raygeo releases without burning_rect the frame keeps the previous behavior. The travel warning keeps using the traced frame; catalogs gained the two new strings.
|
Updated: the PR now requires raygeo 1.65.0 directly — the pin is bumped and the fallback for older raygeo releases is removed. Depends on raygeo#61 / raygeo 1.65.0 only. |
Rebase the frame-overscan change onto the released raygeo: Ops.powered_rect() (raygeo#61, released as 1.65.0) is now a hard requirement and the only envelope source — the getattr fallback for older raygeo releases and the skip-guarded test are gone. Bumps the pin to ==1.65.0 in pixi.toml, requirements.txt and debian/requirements-bundle.txt, and re-locks pixi.lock (raygeo-only change).
..doceditor from mainwindow resolves to the controller package rayforge.doceditor, where DocEditor lives; the popover widget is a Gtk class in rayforge.ui_gtk.doceditor, so the relative import needs a single dot (as the toolbar's AddTabsPopover import does).
🤖 Estimated LLM implementation costReplayed each of the 3 commits in this pull request and counted the code lines each commit added or rewrote:
Added lines by language: Python 174, Plain Text 2, TOML 1 Full estimate
Cost model: ≈10 tokens per code line at $15/Mtok output and $3/Mtok input (assuming heavy prompt caching); input ≈ 15× output for conversation replay; a review round ≈ 42,000 tokens; a failed CI run ≈ 21,000 tokens; file reads capped at 20 kB each. Active window from first commit to merge: <1 day.
|
Fixes #563
What
The frame button no longer starts the frame-up immediately. It opens a
popover (same look as the one for "Add Equidistant Tabs") with an
Include Overscan Margin switch and a Frame button:
burns — the job boundary — so it no longer overshoots the artwork by
the engraving overscan on the left/right sides;
overscan acceleration margin, as before.
How the tight frame is found
The overscan only exists in the final ops as zero-power cutting moves
and zero-value scanline padding, so the boundary is computed by the new
Ops.burning_rect()in raygeo (submitted as a separate raygeo PR),in one O(n) Rust pass.
_run_frame_actionbuilds the frame from thatenvelope; on raygeo releases without
burning_rect(currently pinned1.64.0) the code falls back to the plain ops rect, i.e. the previous
frame behavior. The rayforge test that exercises the tight frame is
therefore skipped until the raygeo pin moves to a release containing
raygeo#60 — after that release, bump
raygeo = "==1.65.0"(or newer)in
pixi.tomland the behavior activates without any further change.The travel warning (
_warn_if_frame_exceeds_travel) is unaffected: itkeeps checking the frame that is actually traced.
Tests
tests/machine/test_machine_cmd.py::TestFrameOverscan: framing anartifact with overscan-style zero-power lead-out corners at the
burned area (10..30) by default and at the full path (10..35) with
the switch on; plus
_job_frame_rectfallback behavior.rayforge.potand all shipped catalogs.