Skip to content

Drawings WE3-WE5: commands report where each object sits on a sheet, and select and delete views, dimensions and balloons (#4894) - #11047

Merged
bherbruck merged 4 commits into
tangency-labs:drawingsfrom
CamWight:bounds-selection-delete-4894
Nov 3, 2026
Merged

bherbruck merged 4 commits into
tangency-labs:drawingsfrom
CamWight:bounds-selection-delete-4894

Conversation

@CamWight

@CamWight CamWight commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Until now a drawing's sheet didn't say where its border and views sit on the paper, and its views, dimensions and balloons couldn't be selected or deleted. With this PR the sheet reports a box round each of them, so a click on the drawing page can tell what it hit; select.set selects one of them in the open drawing; and Delete removes it, a view together with its dimensions and balloons in one undo step. Nothing new shows on screen yet: the drawing page that will use these is @Nathan-Dane's.

Part of #4894 (WE3-WE5), into drawings: a sheet's objects: where they sit, selecting them and deleting them.

Changes a default: no

What it does

The sheet scene now says where its border and each view sit on paper: the box
round what each draws, and a view's boundary, so one that can't be drawn can
still be picked. It is worked out once per assembly, beside the scene rather
than in it, so no writer sees it and the page needn't inspect each view.

select.set takes {type: drawing, drawing, object} for the drawing open. It adds no
undo step and changes nothing saved, and a selected object leaves the selection
when an undo takes it or its drawing closes.

selection.delete now works with a drawing open: a view goes with its dimensions
and balloons as one undo step, and one with views projected from it is refused,
naming them, unless they are selected too or contents: delete takes them. A sheet's
delete and this one share the record's one removal rule. A delete in a drawing is a
step of the drawing, so undo in the drawing brings it back; that rule was a separate
commit on the stack (5afb8db2a) and is folded in here.

crates/geom/: this adds Seg2::bounds in profile.rs, the box round one piece of a
profile, 50 lines with its test. No kernel code is involved.

crates/ui-egui/: the new selection kind gets its arm where the Browser, the dialogs and Select Other match on a selection; nothing new draws.

The ribbon: no planned id from drawing_ui.rs is added or replaced. select.set and
selection.delete were never planned entries, so @Nathan-Dane's page can call them as they are.

Pictures

Nothing new shows on screen at this commit: the sheet isn't on the page yet, so a screenshot
of the window shows only the model. The real-program check below reads the replies instead.

Tests

  • a_sheets_objects_say_where_each_one_is
  • a_view_with_no_lines_is_an_object_at_its_boundary
  • a_views_box_is_what_it_draws
  • the_providers_objects_follow_its_views
  • a_pieces_bounds_are_the_box_round_it
  • a_drawings_objects_are_selected_without_changing_anything
  • what_isnt_on_the_drawing_open_is_not_selected
  • a_selected_object_that_goes_leaves_the_selection
  • a_views_projected_views_are_found_down_its_chains
  • a_view_goes_with_what_is_in_it_after_a_dry_run
  • a_views_projected_views_go_only_when_asked
  • a_dimension_and_a_balloon_go_alone_or_with_their_view
  • what_is_chosen_goes_in_any_order
  • hostile_deletes_in_a_drawing_are_refused_whole
  • seeded_deletes_in_a_drawing_keep_its_rules

Planted faults: 29 planted, 29 caught, each restored with a clean run after it. The first
run left four uncaught (an empty box standing for a view's lines, a fill with no bounds, a
picture with no bounds, what's chosen coming back unsorted), so a_views_box_is_what_it_draws
and what_is_chosen_goes_in_any_order were added for them, and they also catch balloons coming
back unsorted. Reading the code for the real-program check then showed
what_isnt_on_the_drawing_open_is_not_selected never tried its other drawing, because it read the
wrong field of the reply. It now tries that drawing's own view, which only the open-drawing check
refuses, and catches that check being removed.

What no test reaches

  • Text isn't measured in an object's box here, as no view draws text at this commit.
  • A dimension or balloon has no box of its own in drawing.scene yet: they are selected and deleted by
    id, and appear as objects once dimensions and balloons draw on paper, in a later slice.
  • A pick through frames::to_local from the page: the page doesn't pick yet.
  • An inner command that panics part-way through a delete; Session::execute's guard covers it, with no test of its own here.

Validation

Rebased 3 Nov onto drawings 5bf3940 (after #10515's fonts and #7745's table lines); nothing in it changed. Rechecked on the new heads: clippy with -D warnings on each of the three; on the tip, geom 350, doc 559 and engine 3133 library tests, lists, layers, i18n --check and the app build pass, and 10 planted faults across the stack are each caught again (clean run passes). The pictures above are from before the rebase; nothing they show changed.

On this commit, on drawings d5fd141: geom 346, doc 558 and engine 3126 library tests pass, the command-list and
registry tests with them. Clippy with -D warnings on geom, doc, engine and ui-egui, all targets; cargo xtask lists,
layers and i18n --check pass. The whole gate ran on this commit (Windows): fmt, assets, icons, licences, lists, layers, ui-containers, clippy, wasm and the web offline test pass. Its tests failed only where they always fail on this PC under the gate's load, and each passed run alone: kill_mid_save, help_output and pattern_of_512_hole_cuts_finishes_in_reasonable_time. The ui-egui library tests pass alone (3608) with progressive_image_controls_route_to_the_registered_host skipped, which hangs on this PC. The solidcraft_gpu library tests were stopped: they spin on this PC's drivers, and this change touches no render code. CI runs both.

The real program (solidcraft.exe --control, safe mode, plain box and cube): made a drawing of a base
view, two projected views, a dimension and a balloon.

  • drawing.scene gave the border at 0-420 by 0-297, and each view's box at its boundary.
  • Selecting a view, the dimension and the balloon left the exported SVG byte for byte the same.
  • A bad id, the sheet's id and a bad drawing were refused.
  • Deleting the base view alone was refused, naming the two projected views. With contents: delete, the dry
    run's reply and the real one matched, and only the border was left.
  • One undo gave back the same SVG, byte for byte.
  • The dimension alone went on its own; a model body was refused with the drawing open.
  • Saved after deleting the top view and opened again: the border and two views. No crash reports.

Integration status

Based on drawings 5bf3940. It waits for nothing. WE1 and WE2 stack on it. It conflicts with three open drafts, #10987, #10926 and #10469; whichever lands second rebases.

Refs #4894, #860

@github-actions github-actions Bot added area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES area:ui desktop/web front end, dialogs, viewport labels Nov 2, 2026
@CamWight
CamWight marked this pull request as ready for review November 2, 2026 08:09
@CamWight CamWight changed the title Drawing WE3-WE5: where a sheet's objects sit, selecting them and deleting them (#4894) Drawings: commands report where each object sits on a sheet, and select and delete views, dimensions and balloons (#4894) Nov 2, 2026
@CamWight CamWight changed the title Drawings: commands report where each object sits on a sheet, and select and delete views, dimensions and balloons (#4894) Drawings WE3-WE5: commands report where each object sits on a sheet, and select and delete views, dimensions and balloons (#4894) Nov 2, 2026
CamWight and others added 4 commits November 3, 2026 02:57
 WE3)


The sheet scene now says where its border and each view sit on paper: the box
round what each draws, and a view's boundary, so one that can't be drawn can
still be picked. It is worked out once per assembly, beside the scene rather
than in it, so no writer sees it and the page needn't inspect each view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on (tangency-labs#4894 WE4)


select.set takes {type: drawing, drawing, object} for the drawing open. It adds no
undo step and changes nothing saved, and a selected object leaves the selection
when an undo takes it or its drawing closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cy-labs#4894 WE5)


selection.delete now works with a drawing open: a view goes with its dimensions
and balloons as one undo step, and one with views projected from it is refused,
naming them, unless they are selected too or contents: delete takes them. A sheet's
delete and this one share the record's one removal rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y order (tangency-labs#4894 WE3, WE5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES area:ui desktop/web front end, dialogs, viewport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants