Conversation
Implements #359 as a new builtin addon plus the core head/capability groundwork it needs. Core: - MachineCapability: new DRAG_KNIFE and TANGENTIAL_KNIFE values with labels and descriptions. - machine/models/knife.py: DragKnifeHead (blade offset setting) and TangentialKnifeHead; both dispatch correctly in head_from_dict and are editable in the machine settings heads page. - The encoder heads table now includes non-laser heads so knife head UIDs resolve for tool changes. Addon (rayforge-addon-dragknife): - DragKnifeCutStep: cuts contours with a trailing-blade drag knife. Internally attaches a DragKnifeTransformer (backed by raygeo's DragKnifeSpec) that compensates the blade offset, swivels around corners within the swivel tolerance, lifts at sharper corners, and emits arc-in/arc-out blade alignment moves. - TangentialKnifeCutStep: cuts with a rotary knife whose A axis follows the path heading (TangentialKnifeSpec). Heading changes beyond the angle tolerance, or arcs tighter than the radius tolerance, lift the knife to a safe Z. Stamps an M3-only spindle command for the blade motor. - Both steps cut on the centerline via the contour assembler, are gated to machines whose heads provide the matching capability, expose their settings through recipe varsets (head picker, blade offset, swivel/angle tolerances, safe Z, speeds), and keep the internal transformer dicts in sync via setters. - Settings pages registered per assembler name; symbolic icons and a locale template included. - Tests: transformers, step setters/serialization/sync, create() head resolution, and frontend page registration.
CI installs the raygeo pin from PyPI, which predates the knife transform specs (barebaric/raygeo#28). The addon now gates its registration on a raygeo availability check: without the specs it logs a warning and registers nothing instead of failing to import, the transformers import their specs lazily, and the addon test suite is ignored via collect_ignore_glob so test collection no longer errors. Once the raygeo pin includes the knife transforms, everything activates automatically.
The CI lint job also runs flake8 (79 char limit). Replace the compat module's static imports with importlib.import_module so no pyright ignore comments are needed, and shorten the lazy-import ignore comments to fit within the line limit.
knipknap
marked this pull request as draft
September 10, 2026 20:18
knipknap
commented
Sep 10, 2026
- Drop the raygeo availability gate: the dragknife steps and transformers register unconditionally again, importing the knife specs directly (raygeo 1.51.0 provides them). - Pin raygeo to 1.51.0 in pixi.toml, requirements.txt, and the Debian bundle requirements; refresh pixi.lock. - Make HEAD_SERIALIZED_KEYS public so the knife head module does not import private names. - Replace the getattr fallbacks with explicit isinstance branches in the encoder heads table, the knife head detail widget, and the drag knife step's head defaults hook. - Move the addon maturity marker to the top of the manifest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements knife-cutting support requested in #359 as a new builtin
addon (
rayforge-addon-dragknife) plus the core head/capabilitygroundwork it needs.
Depends on raygeo PR barebaric/raygeo#28 (
DragKnifeSpec/TangentialKnifeSpectransformers). CI for the pipeline tests needsthe
raygeopin bumped after that merges.Core (part C)
MachineCapability: newDRAG_KNIFEandTANGENTIAL_KNIFEvalues with labels/descriptions. Step offering is gated through
the existing
REQUIRED_MACHINE_CAPSsubset check, so the newsteps only appear on machines with a matching head.
machine/models/knife.py:DragKnifeHead(reviewable bladeoffset setting) and
TangentialKnifeHead, dispatched inhead_from_dictand editable in the machine settings heads page(new add-head popover entries + detail widget).
knife head UIDs resolve (e.g. for tool changes); non-laser heads
never scale laser power.
Addon (part B)
contour assembler and internally attaches a
DragKnifeTransformer(raygeoDragKnifeSpec): blade-offsetcompensation, arc-in to align the blade, swivel arcs within the
swivel tolerance, lift–pivot–plunge at sharper corners, arc-out.
the path heading (
TangentialKnifeSpec): heading changes beyondthe angle tolerance or arcs tighter than the radius tolerance
lift to a safe Z; stamps an M3-only spindle command for the blade
motor (no M4).
blade offset, tolerances, safe Z, speeds), serialization
round-trips, setters keep the internal transformer dicts in sync
(the transformer is an implementation detail — users configure
the knife through the step).
locale template.
Test plan
round-trips/clamping, step setters + signals, transformer dict
sync, serialization round-trips,
create()head resolution,create_initial_opsspindle command, frontend page registrytests/machine/models,tests/core,tests/addon_mgr,tests/pipeline,tests/doceditorall greenruff+pyrightclean for all new/changed filesAddon.load_from_directoryFollow-ups (not in this PR): device-profile wizard integration for
knife heads, example device profiles for cutter conversions.