Repository navigation
Front-left STL placement and A1 bed park position for pickup - #11
Merged
Merged
Conversation
POST /submissions takes an optional `placement` for an .stl the gateway slices: `auto` (default, the slicer centres the part) or `front_left` (footprint `slicer.placement_margin_mm`, default 10 mm, in from the bed's front-left corner, resting on the plate). The CLI has no translate option and drops a bare STL off the plate with arrange off, so the mesh is wrapped in a one-object 3MF whose build transform carries the offset and sliced with --arrange 0. A part that does not fit, or `placement` on an already sliced file, is refused with 422. A per-printer `end_bed_y_mm` rewrites the Y of the stock end gcode's final park move (A1: G1 X-48 Y180 F3600, before M18) so the finished plate is presented further forward. Out-of-range values and end gcode without that move are refused. The value is recorded in provenance and returned by pickup-targets as `bed_park_y_mm`, since bed-frame object positions move with the bed. Checked against the real Bambu Studio CLI with the A1 presets: a cube authored at (100, 150) slices to bed X/Y 10-30 mm (first-layer toolpath 10.3-29.7), and the end gcode parks at Y250 just before M18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
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
POST /submissionstakes an optionalplacementfor an.stlthe gateway slices:auto(default, centred by the slicer) orfront_left(footprintslicer.placement_margin_mm, default 10 mm, in from the front-left corner of the printable area, resting on the plate, orientation unchanged). The mesh is wrapped in a one-object 3MF whose build transform carries the offset and sliced with--arrange 0. A part that does not fit, an unreadable STL, orplacementon an already-sliced.3mf/.gcode→ 422.slicer.machine_profiles.<id>.end_bed_y_mmrewrites the Y of the stock end gcode's final park move (A1:G1 X-48 Y180 F3600, just beforeM18) so the finished plate is presented forward. Values outside the printable area, or end gcode without that move, are refused rather than guessed. Recorded asprovenance.end_bed_y_mmand returned bypickup-targetsasbed_park_y_mm.printers.example.yaml.Robot pickup impact
Bed-frame object positions are unchanged. On the A1 the bed moves in Y, so parking at Y250 instead of the stock Y180 puts the plate and every object 70 mm further toward the front of the printer. The arm agent should use
bed_park_y_mm(null = unknown/stock) in its transform. Motors are released after the print, so the bed can still be pushed.Safety scope
No new control verb and no gate relaxed: both changes only alter the slice the gateway produces; nothing here sends a printer command. Y250 is within the A1's normal travel (its own start gcode moves to
G1 Y250). The user confirmed the forward park position will not hit the robot.Test plan
uv run pytest -q— 333 passed (14 new)uv run ruff check .autostill centres at 118–138; end gcode endsG1 X-48 Y250 F3600beforeM18bambu_a1_01withplacement=front_leftandend_bed_y_mm: 250🤖 Generated with Claude Code