Fix flip-axis when using manual start-point for jobs - #229
Open
Kreibich04 wants to merge 2 commits into
Open
Conversation
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.
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.
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.