Skip to content

Fix flip-axis when using manual start-point for jobs - #229

Open
Kreibich04 wants to merge 2 commits into
t-oster:masterfrom
Kreibich04:master
Open

Fix flip-axis when using manual start-point for jobs#229
Kreibich04 wants to merge 2 commits into
t-oster:masterfrom
Kreibich04:master

Conversation

@Kreibich04

Copy link
Copy Markdown

Commits

Fix flip-axis math for jobs using a manual start point

isFlipXaxis()/isFlipYaxis() mirror coordinates around bedWidth/bedHeight,
which is only valid when the job is referenced to the machine's homed
origin. applyStartPoint() re-references job coordinates to a manually
jogged start point instead, but the mirror kept using the bed-size pivot,
overshooting the flipped axis by roughly bedWidth/bedHeight (X-axis
overtravel on machines with the home switch on the flipped side, e.g.
OmTech). Pivot is now 0 once a start point is in effect.

Also fixes Ruida's bounding-box (E703/E707/E750-E762) min/max: mirroring
around a pivot reverses which bound is min vs max, so each pair needs to
be re-sorted after flipping rather than flipped independently.


Fix stale bounding-box cache after applyStartPoint

VectorPart caches min/max bounds incrementally as points are added,
but applyStartPoint() only shifted the command coordinates, never
that cache. Ruida's bounding-box/frame commands (E7 03, per-layer
E752/E753) read the cached bounds directly, so they kept describing
the design's pre-shift position while the actual move commands were
correctly shifted.

VectorPart.shiftBounds() keeps the cache in sync.

RuidaTest decodes the actual RD byte stream to verify E7 03 reflects
the shifted position, flipped and unflipped.


Test

I tested it with our OMTech Turbo-756 Laser @FabLab-Ansbach which has the X-Axis flipped. Relative positioning with right-click and "Set startpoint" works now with these changes.

isFlipXaxis()/isFlipYaxis() mirror coordinates around bedWidth/bedHeight,
which is only valid when the job is referenced to the machine's homed
origin. applyStartPoint() re-references job coordinates to a manually
jogged start point instead, but the mirror kept using the bed-size pivot,
overshooting the flipped axis by roughly bedWidth/bedHeight (X-axis
overtravel on machines with the home switch on the flipped side, e.g.
OmTech). Pivot is now 0 once a start point is in effect.

Also fixes Ruida's bounding-box (E703/E707/E750-E762) min/max: mirroring
around a pivot reverses which bound is min vs max, so each pair needs to
be re-sorted after flipping rather than flipped independently.
VectorPart caches min/max bounds incrementally as points are added,
but applyStartPoint() only shifted the command coordinates, never
that cache. Ruida's bounding-box/frame commands (E7 03, per-layer
E752/E753) read the cached bounds directly, so they kept describing
the design's pre-shift position while the actual move commands were
correctly shifted.

VectorPart.shiftBounds() keeps the cache in sync.

RuidaTest decodes the actual RD byte stream to verify E7 03 reflects
the shifted position, flipped and unflipped.
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.

1 participant