Skip to content

Drawing sheets: balloons draw on the sheet, a numbered circle with a leader to its part (#3874) - #16842

Merged
bherbruck merged 6 commits into
tangency-labs:drawingsfrom
CamWight:balloons-on-sheet-3874
Nov 16, 2026
Merged

bherbruck merged 6 commits into
tangency-labs:drawingsfrom
CamWight:balloons-on-sheet-3874

Conversation

@CamWight

@CamWight CamWight commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Cam

Change

A balloon on a drawing view now draws on its sheet: a circle round the part's item number, with a leader to the part's edge. A balloon numbers one part of an assembly, and the number is that part's row in the sheet's parts list. Before this PR, a drawing saved its balloons, but the sheet did not draw them.

Part of #3874, into drawings. One commit, 2d3dd241b4.

Builds on #3876; until it merges the diff shows its commits too; this PR's own commit is the last one. #3876 prints the parts list whose numbers the balloons show.

Changes a default: no
No setting changes. A sheet without balloons looks the same. One command answers more: Check Drawing now lists a balloon off the paper (below).

What a user sees

  • Each balloon draws at its place from its view's centre. Moving the view moves the balloon with it.
  • The circle holds the part's item number. A wide number gets a wider circle.
  • The leader runs from the middle of the balloon's edge to the circle's rim. It ends in a dimension's arrowhead.
  • A balloon on a posed or exploded view ends where that view draws the edge. It does not end where the edge sits in the assembled design.
  • A balloon whose edge is lost keeps its circle and number, with no leader, and says it is lost.
  • A balloon with no row in a parts list keeps an empty circle and says why.
  • Balloons paint with their view's dimensions and notes. Parts lists, the sheet's own notes and the title block paint over them.
  • Deleting a balloon takes it off the sheet.
  • Check Drawing now lists a balloon that lies off the paper as outside_sheet, as it lists a dimension or a note. Before this PR, balloons were not among the sheet's objects, so Check Drawing could not see them.

How it works

  • A balloon is one more kind on the path dimensions and notes take (Annotation::Balloon). It is read with its view, kept across a close, and read again after any change to the design. Its number reads a parts list, and any change to the design can change the list.
  • The balloon's edge is read through read_with, the one seam that dimensions and notes use since Drawings: dimensions, balloons and notes on posed and exploded views (#13048) #15839. So a posed or exploded view gives the edge as that view draws it.
  • The balloon's number is read on the open design, as drawing.balloon.inspect and the parts list on the sheet read it. The number belongs to the parts list, and the list belongs to the design, not to one view.
  • The row rule moves to doc as Document::balloon_rows. It makes one parts list for each list the balloons read, not one for each balloon. drawing.balloon.inspect now reads its row through the same function. So the sheet and inspect give the same number and the same word.
  • drawing_balloon_paper.rs draws one balloon. It uses the dimension module's arrowhead, text size and text setting, with no copy.
  • The gap between text and its outline is now one constant, drawing_dimension_paper::GAP_MM. Notes and balloons both use it. Before, the note module had its own copy.
  • ObjectKind::Balloon is a new sheet object kind, in paint band 3 (ObjectKind::band). Its export layer is BALLOON.
  • drawing.scene and drawing.export replies gain a balloons list. Each entry gives the balloon, its view, its edge's status, its row's status, its item number, whether it drew, and why not. The list is left out when a sheet has no balloons.
  • drawing.scene.hit can now answer with a balloon.
  • drawing.check gets one more match arm: ObjectKind::Balloon => CheckedKind::Balloon. That arm makes the Check Drawing change above.
  • reads_fields becomes reads_document, since a balloon reads the document as a note's fields do.
  • Nothing new is saved, so the file format does not change.

One line in the Drawing workspace UI. crates/ui-egui/src/drawing_sheet_page.rs gets ObjectKind::Balloon => "balloon" in kind_name. The match covers every kind, so the app does not compile without the line. @Nathan-Dane, this is your file: please check that the name fits your sheet page. Your #16229, merged since, changed the same file in other places.

Cost: a view's balloons are read in one balloon_rows call. That call makes one parts list for each list the balloons read, then does one lookup for each balloon. On a sheet with 300 balloons in 3 lists, one read makes 3 lists. The window keeps each balloon's lines between reads.

Rebased onto the newest drawings

This commit is replayed as 2d3dd241b4 onto #3876's new head d83948d4b7, on drawings 8647608. That base adds view labels (#16838), another sheet object kind. The conflicts are resolved with both kinds kept: ObjectKind has ViewLabel and Balloon, both in band 3 with dimensions, with export layers VIEW_LABEL and BALLOON; drawing.check and the sheet page's kind_name get one arm each; the scene schema's kinds list stays in paint order. One long line was formatted.

Validation

Local, Windows, dev profile, on 15 Nov. One group check ran on the whole stack, #3876's four commits with this commit on top, at 2d3dd241b4 on drawings 8647608:

  • rustfmt (edition 2024) of every changed file at each of the five commits: clean. cargo fmt --check on geom, doc, engine and ui-egui: clean.
  • Clippy -D warnings on geom, doc and engine, all targets: pass. cargo check of ui-egui: pass.
  • Tests: geom table and paper, 88 of 88; doc drawing::balloon and drawing::table, 14 of 14; engine drawing_balloon, drawing_table, drawing_scene, drawing_check, drawing_export, drawing_dimension_paper, drawing_note_paper and schema::, 950 of 950.
  • The full suite and wasm are left to CI. Earlier runs (10-14 Nov) passed the wasm check, the format pending check and cargo xtask lists. The replay adds no crate, dependency, catalog entry or format file.
  • New tests:
    • crates/engine/src/drawing_balloon_paper_tests.rs: a balloon is a circle round its number with a leader to its arrow; a wide number gets a wider circle; what a balloon can't draw leaves the rest and says why; hostile places and arrows never panic.
    • crates/engine/src/cmd/drawing_balloon_tests.rs: a balloon draws on its sheet with its number and its leader, at places worked out by hand, and moves, exports and deletes with it; a lost balloon keeps its circle and number; the sheet and inspect read a balloon's row alike, for all five row words; the window keeps a balloon until what it reads changes; a held drawing keeps its balloons and exports them from a scratch copy.
    • crates/engine/src/cmd/drawing_check_tests.rs: a_balloon_off_the_paper_is_listed, beside the dimension and note tests. A balloon on the paper is not listed. The same balloon moved off the paper is listed as outside_sheet. And a_held_views_balloon_is_out_of_date_as_a_balloon: a held view's balloon is listed as a balloon, not as a note.
  • Planted faults, on the rebased code: F3, balloons paint over tables (band 5), caught by paper::tests::each_kind_paints_in_its_band; F4, Check Drawing calls a balloon a note, caught by a_balloon_off_the_paper_is_listed. A clean run then passed. This PR's other faults ran on 10-14 Nov, before this replay.

What the tests don't reach:

  • A balloon on a posed or exploded view, drawn on the sheet. The existing tests from Drawings: dimensions, balloons and notes on posed and exploded views (#13048) #15839 check where such a balloon's arrow ends through drawing.balloon.add and drawing.balloon.inspect. The sheet reads the edge through the same read_with call that Drawings: dimensions, balloons and notes on posed and exploded views (#13048) #15839 tests for dimensions and notes. No test draws such a balloon on a sheet; the exploded picture below shows it in the app.
  • In a background export, the edge and the row both read on the job's copy of the design, as notes' fields do. No test tells the two reads apart there.
  • An item number still waiting for its font in the window. The dimension's pending test covers the shared text setting, and the balloon passes the same flag.
  • Check Drawing refuses an out-of-date id that is not a view, dimension, balloon or note of the drawing. Every id on that list comes from the drawing's own records, so no test reaches that refusal.

Screenshots of the behavior

Real app, sheet page, 1280 x 720 window, with this PR on #3876. The same plain test assembly as #3876's pictures: a 40 x 20 x 3 mm plate placed three times (item 1) and an 8 x 8 x 20 mm post on two of them (item 2).

Balloons on a sheet. Three on the iso view and one on the exploded front view, each a circle round its row's item number, with a leader to its part's edge:

The whole sheet: balloons 1, 2 and 1 on the iso view, balloon 2 on the exploded view, the parts list at the top right The iso view close up: balloon 1 on the first plate, balloon 2 on its post, balloon 1 on the second plate, each leader ending on the part's edge

A balloon on an exploded view. The front view draws the exploded view Apart, which lifts the posts 25 mm. The balloon's leader ends on the lifted post's bottom edge, where the view draws it:

Balloon 2 on the exploded front view, its leader ending on the bottom of the post drawn above the plates

A lost balloon. A fillet takes the post's top front edge that balloon 2 points at. The balloon keeps its circle and number, with no leader, and drawing.balloon.inspect reads lost:

After the fillet: balloon 2 above the rounded post with no leader; balloons 1 keep theirs

Check Drawing listing a balloon off the paper. Balloon 3 moved to at: [1000, 20] with drawing.balloon.edit, then drawing.check on the sheet:

{"kind": "outside_sheet", "object": {"kind": "balloon", "id": "3rf6qd1s38e2c"}, "why": "it lies off the paper"}

Its counts on that sheet: 1 lost (balloon 2, above), 1 outside_sheet, and 7 empty title block fields.

Small-window check. The same sheet in an 800 x 520 window: the balloons, both tables and the title block still draw:

The sheet in an 800 x 520 window, Fit, balloons and tables still drawn

Steps: make the assembly and the drawing as in #3876's pictures, then drawing.balloon.add with an edge point and its occurrence path. For the exploded view: explode.create, then a base view with exploded: "Apart". For the lost balloon: a fillet on the post's top front edge. For the check: drawing.balloon.edit with at: [1000, 20], then drawing.check.

Integration status

On drawings 8647608, checked 15 Nov 2026, 10:05 UTC. git merge-tree of #3876's head and of this PR's head against each open PR into drawings that shares a file:

Open PRs on the same files:

Follow-ups, not in this PR:

  • Dimensions, notes and balloons now share line, arrowhead, gap and text from the dimension module. One shared annotation module would hold them.

  • Assembly::finish returns a six-part tuple. A named struct would read better.

  • The stale lists for dimensions, notes and balloons could be one list keyed by kind.

  • The drawing.export parameter text names the views, tables and title block, but not dimensions, notes or balloons.

  • Rebased again, 16 Nov, onto this PR's base Drawing sheets: parts lists and revision tables print on the sheet, and a parts list can show only the parts its balloons number (#3874) #3876 at 7b93592, on drawings e069e4e. This PR's own commit applied cleanly.

  • Checked: on ab2b556, 194 engine, 14 doc and 88 geom tests passed, and clippy, rustfmt and xtask lists are clean. On e069e4e, the table and balloon tests give 47 passed, and ui-egui builds.

  • Follow-up, not in this PR: the balloons' rows in doc read the design without Session::drawn. They should go through it, as the parts list now does. That is its own small change.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor
Pre-merge checks: Passed 1

Check name Status Explanation
Existing Defaults Unchanged Passed Summary: the pull request changes no existing UX default. Its changes are additive, so the check passes. Evidence from HEAD 7cb31e0 ("Drawings: balloons on the sheet ... (#3874)"), which is the rep…
Full details: Existing Defaults Unchanged

Explanation

Summary: the pull request changes no existing UX default. Its changes are additive, so the check passes. Evidence from HEAD 7cb31e0 ("Drawings: balloons on the sheet ... (#3874)"), which is the replayed commit of this PR: - Default settings, preferences, shortcuts and UI layout: the 19-file diff adds no setting, preference, shortcut or layout default. The only UI change is one ObjectKind::Balloon => "balloon" arm in drawing_sheet_page.rs. - Note gap constant: drawing_note_paper.rs previously had a local GAP_MM: f64 = 1.0. It now imports GAP_MM from drawing_dimension_paper.rs, where GAP_MM = SIZES.gap and SIZES.gap is 1.0. The value is unchanged, so existing note layout does not move. - Object paint order: ObjectKind::Balloon is a new variant placed in band 3. Existing kinds keep their bands. - drawing.scene and drawing.export gain a balloons list. The list is omitted when a sheet has no balloons (skip_serializing_if = "Vec::is_empty"). This is additive. - drawing.check gains a Balloon kind. Balloons are now checked for outside_sheet and out_of_date. Existing finding kinds and their logic for views, dimensions, notes and tables are unchanged. The new findings only add entries for balloons. - The sheet now draws balloons that already exist in saved drawings. This is the feature itself, not a change to any existing object's place or style. Caveat: in the drawing_check.rs diff, an id that matches no view, dimension, balloon or note now returns an error. Before, it was listed as a note. The PR's description says that path is unreachable for ids from the drawing's own records, so normal use is unaffected. The description's Changes a default: no agrees with the code. No UX default is changed. Kernel and geometry results are outside this check's scope.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@CamWight

Copy link
Copy Markdown
Contributor Author

A note for whichever of this PR and #13033 (flat pattern views, now ready) lands second. #13033 adds crate::drawing_view::no_model_edges(&View): a flat pattern view draws its body's flat, not the model's edges, so check_drawn refuses a balloon on one. This PR draws balloons on the sheet, so the second of the two to land also leaves a balloon saved by hand on a flat view out of the sheet, with NO_PLACE. #13033 does the same for dimensions and leader notes in draw_dimensions and drawn_notes.

CamWight and others added 6 commits November 16, 2026 00:03
…rd places them (tangency-labs#3874)

A sheet's tables are read with its title block's text, laid out at the origin to learn their
size, then placed at their anchor inside the drawing border (or the paper without one). Each is
its own kind of object in the scene, export and sheet replies say whether each one drew and why
not, and a table that can't be read leaves the rest of the sheet drawn. drawing.table.inspect
says where a table sits, its rows, overrides and warnings. The words in the cells come next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…their cells (tangency-labs#3874)

Each line of a cell stands on the anchor its layout gives, left, middle or right as its column
aligns, set as it was measured for the layout, so no word is shaped twice. The words' fonts join
the sheet's. A word no font can set is left off and the table says why; in the window, a word
whose font is still being looked for leaves the table off until the search answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngency-labs#3874)

The rows a parts list draws hold the count in their ballooned field, worked out where the rows
are built with the rule drawing.inspect uses, so the editor's column and drawing.inspect read one
count. drawing.table.inspect gives each row's count.

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

A table's filter gains `ballooned: sheet | drawing`. A list with it shows the
rows whose ballooned count is over 0, numbered and counted as in the whole
list; with none, its heading alone. The count is worked out where the list's
balloons are counted already (Drawing::balloons_by_list): for `sheet`, only
the balloons on the list's sheet, so the drawn rows and drawing.inspect agree.
A revision table refuses the filter: no balloon reads its rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r filled from this design (tangency-labs#3874)

The rows of a parts list come from the design its record lists, asked through Session::drawn as
every other reader of a source asks. A list a file made that names a linked design says why it
can't be read and draws nothing, as a sheet documenting one does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h a leader to its edge (tangency-labs#3874)

A balloon on a view now draws on its sheet: a circle round its number in its
parts list, at its place from the view's centre, with a leader from its edge's
middle to the circle's rim, ending in a dimension's arrowhead. It rides the
annotation path that dimensions and notes use (one more `Annotation` arm): read
with its view, kept across a close, and read again after any document change,
as its number reads a parts list. A lost balloon keeps its circle and number
with no leader; one with no row keeps an empty circle and says why.

`drawing.scene` and `drawing.export` list each balloon (balloon, view, status,
row_status, item, drawn, why). The row rule moves to doc as
`Document::balloon_rows`, one BOM list per parts list, and
`drawing.balloon.inspect` reads its row through it, so the sheet and inspect
give the same answer. The text gap is one constant, shared by notes and
balloons. `reads_fields` becomes `reads_document`.

Nothing is saved: no format change. Deleting a balloon already works through
`selection.delete`; the sheet now shows it gone.

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