Repository navigation
feat(app): arrange lifts a design that sits under the bed onto it - #2340
Merged
Merged
Conversation
Arrange now lifts a design whose body sits more than 0.01 mm under the bed onto it, the same way a design's landing does. That covers a body whose arcs dip a tenth of a millimeter under its lowest line as well as a part built centered on z 0. The part is only ever raised, so one built standing above the bed keeps its height, and a locked part stays where it is. Objects the arrange does not place keep their height, such as the rest of the plate when only a selection is arranged, and so do objects with no design history. Opening a project still moves nothing. The design's history keeps the lift as the third number of its landing moves, as a landing keeps it. The frame the design tools and the next edit read keeps its height, and a project saved after the arrange opens with the part on the bed. The lift is in the arrange's undo step, and it applies on every arrange route (the engine, the nest, the box packer) and to objects the arrange moves to new plates. No tool reply or version changes. Signed-off-by: subydoo-ci[bot] <343861189+subydoo-ci[bot]@users.noreply.github.com>
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.
For users (against main)
On main, Arrange keeps each object's height. A design whose body sits under the bed stays under it after an arrange, and the object list keeps marking it off the bed until its next edit lifts it. That covers anything from a body whose arcs dip a tenth of a millimeter under its lowest line to a part built centered on z 0.
Now Arrange lifts such a design onto the bed as it places it, the same way a design's landing does. The part is only ever raised, so one built standing above the bed keeps its height. A locked part stays where it is, and so does anything the arrange does not place, such as the rest of the plate when only a selection is arranged. Objects with no design history keep the height arrange gives them, as before. Opening a project still moves nothing.
The lift is part of the arrange's undo step, so one undo takes the layout and the lift back together. A project saved after the arrange opens with the part on the bed.
What
arrangePlate(packages/app/src/plate/edit.ts) passes every layout throughliftArrangedbefore it lands: the shown plate's transforms and those of objects moved to new plates, on each arrange route (the engine's arrange, the nest and the box packer). For each design the layout places, unlocked, it raises the transform with cad-history'sliftedOnto, the rule a landing already uses, so the 0.01 mm allowance and the raise-only rule come from one place. The lift goes into the design's landing moves (History.placed, its third number) throughplacedAfterandwithPlaced, as the landing stores it. The frame the design tools and the next edit read is the plate transform less those moves, so it keeps its height, and the saved file holds the lift.liftedOntonow takes only the bed'slowest, which is all it reads, and the app'slowestOf(plate/arrange.ts) is shared by the design host's landing and the arrange.No MCP tool's reply or version changes. Arrange in a client's own project (
slicerx_arrange) works on that project's models, which have no design history.How it was tested
packages/app/test/arrange-lift.test.ts, on the box packer:Three of the four fail on main (the 0.005 mm case passes on both).
At this commit, with the geometry engine built from it: the mcp and app suites pass both live and in replay mode, with no recorded reply or fixture changed, as do the native provider tests against the real engine and the viewport tests. Typecheck, the tools doc check, the change file fold check, the dash and brand checks and the web build pass. The shell stays at 185.9 KB gzip against its 188 KB budget.