Skip to content

Drawings: press-in hardware appears on a sheet-metal drawing as a callout and a parts-list row - #22250

Draft
KazW wants to merge 48 commits into
tangency-labs:mainfrom
KazW:hardware-callouts
Draft

KazW wants to merge 48 commits into
tangency-labs:mainfrom
KazW:hardware-callouts

Conversation

@KazW

@KazW KazW commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

This draft claims #20112. Work in progress: the parts-list rows and the callout on a view are pushed; screenshots and a check of the drawn result come next.

It builds on #18382 (press-in hardware) and #17009 (hole callouts by @CamWight), whose branches are merged in, so its diff and CI include theirs until they land.

So far

  • A callout on a press-in hardware hole: drawing.hardware_callout.add {view, feature, copy?, at} puts a note with a leader on the hole that reads its record ("2× FLUSH NUT M5", "2× STUD M4 × 10", with Drawings: hole callouts on views (#7605) #17009's units, decimals and language) and follows it when the hardware changes; a hole that goes away leaves the note lost, never on another hole. On a flat-pattern view the leader ends on the hole in the flat; on a view of the folded part it ends on the hole's circular edge, which the command finds from the record. A view's options panel lists its hardware holes, one button each, to add the callout.
  • A parts list counts the press-in hardware of the parts it lists: one row per kind, thread and length ("Flush nut M5", 2; "Stud M4", "M4 × 10 mm", 1), with every pattern copy counted, a hole a later cut removed left out, and counts multiplied by how many times the part is placed.
  • The rows are on for a new parts list and off for one saved before (press_in_hardware on the list, a drawing-format change), so old drawings keep their rows. drawing.table.add and drawing.table.edit take set.list.press_in_hardware, and the parts-list panel's Press-in hardware box changes it for a drawn list.

Closes #20112.

Changes a default: no

Test change: the parts-list records built in table_tests, balloon_tests and drawing_table_paper_tests name the new hardware: false field, as a parts list saved before this change reads; what each test checks is unchanged.

Gleinkaa and others added 24 commits November 20, 2026 12:48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WIP: HoleRef resolves to resolved, suppressed, failed or lost; the
callout's count, diameter or thread, through or blind depth from the
start face, counterbore and countersink come from the feature record
and the hole's own named faces. drawing.hole_callout returns it and its
text. Acceptance tests in progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lled hole is blind (tangency-labs#7605)

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One pass over a body's triangles for all its faces (face_spots), and
  only for bodies that have a face of the hole, not one pass per bore face.
- A bore face is told wall or floor by its surface (a cylinder on the
  axis is the wall, a plane across it or a cone on it a floor); where a
  face has no known surface, by where its spot is, as before.
- An id of a component, folder, canvas, joint, contact set, study or
  exploded view is an error, not lost.
- A Single hole drills only at its first point; another point's callout
  is lost, never moved to that hole.
- A hole a later feature cut away reads failed with that reason, not
  "cuts no material".
- Messages: "hole callouts of X features", an unknown unit echoes at most
  32 characters; the params doc says inches show at least 3 decimals.
- Tests: a Single hole at a point; a hole drilled from a sketch on the
  top plane over the pocket starts on the floor; a To object depth; a
  later cut fails the callout; the p2 callout pinned to today's failed;
  each hostile case checks its own message; a component's id; the
  1e999 mm diameter reads failed.

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

Review on tangency-labs#7618: a callout takes its default decimals from where a
dimension takes them, the length-decimals preference (2 by default),
so the two read alike on one sheet.

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

tangency-labs#4486 gave counterbored and countersunk holes an optional tip angle; the
callout keeps its text as before and ignores it for now.

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

`drawing::dimension::DEFAULT_DECIMALS` now holds the default (2) next to
`MAX_DECIMALS`. `drawing.dimension.add` uses it in place of its own
private constant, and `hole_callout::DEFAULT_DECIMALS` re-exports it, so
`drawing.hole_callout` takes the same one. No behaviour change: both
were 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed holes (tangency-labs#7605)

Review on tangency-labs#7618, items 2, 3, 4, 6 and 9:
- A tapped hole with its own thread depth, shorter than the hole, gets
  a drill line of its own and the thread line that depth
  (`Ø6.75 ↧ 15.00` / `M8 ↧ 10.00`). Without one, or as deep as the hole,
  the text stays one line.
- The thread is read with the Hole feature's own parse
  (`parse_tapped_thread`): ISO metric as written, catalogued UNC/UNF, G
  and Rp by their designation.
- A later `solid.move` of the hole's body is followed: the hole is
  looked for where the move put it, and `start` and `direction` are in
  the model as it is now (and in the hole's own component). A body moved
  some other way reads as failed, saying it may have been moved.
- Any length unit of the expression unit table, as a drawing may fix
  (one check, `drawing::is_length_unit`, for both).
- A hole in sheet metal reads as failed, not supported yet: the sheet is
  rebuilt with no face named after the hole.
- The doc comment notes that `count` is the feature's and the extent
  this hole's.

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

Review on tangency-labs#7618, items 1, 5 (schemas), 6, 8 and 9:
- `drawing.hole_callout` is `.any_part()`: it works with a drawing open
  or with none. With one open, the drawing's fixed unit and its content
  language are the defaults; with none, the design's unit and `en`, as
  before.
- Input and output schemas (`schema/hole_callout.rs`): the handler reads
  its parameters through the contract, so a wrong-typed value or an
  unknown key (`decimal`) is refused instead of ignored, and the reply is
  built from `CalloutResult`.
- The default unit is `expr::length_unit_or_mm` of the design's.
- Tests: a drawing open and its defaults, thread depth, G/Rp/UNC
  threads, a moved and turned body and a moved copy, one feature drilling
  through and blind, a hole in sheet metal (not supported yet) and a part
  placed twice; the schema's keys, strict errors and replies.

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

Review on tangency-labs#7618, item 5: `cmd.drawing_hole_callout` moves out of the
four catalogs into `assets/locales/pending/drawing-hole-callout.json`,
so no other PR conflicts with it. It gains ar, he and vi, which are
complete catalogs on `drawings` now (the i18n test requires them).

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

Review of 15ade12 (FIXLIST_W29A_1101 items 1, 2, 4, 5 and nits 12, 13):
- The feature counts its thread depth from below any counterbore or
  countersink; the callout adds that recess, so the thread and drill
  depths read from the same face. A thread at least as deep as a blind
  hole is one line.
- A bore whose wall radius or flat floor no longer matches the feature
  (offset face, scale) reads failed instead of showing stale numbers.
- "removed or moved" only when a bore face of the feature lies off all
  of its holes' axes, so a removed hole with siblings still in place
  reads "removed".
- start_face is looked up at the unmoved point; no shadowed at/dir.
- MAX_DECIMALS is re-exported from drawing::dimension; a metric thread
  gets a capital M.

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

Review of 15ade12 (FIXLIST_W29A_1101 items 1-4, 7 and nits 8-11):
- Tests: a later offset of a blind floor reads failed; one hole of a
  pair filled in reads "removed" while its sibling resolves; tapped
  holes under a counterbore and a countersink; a misspelt `decimal` is
  refused; the part placed twice is its own test, asserts the plate and
  hole are in the part, and moves the first placement off the origin.
- CalloutValues is built from a destructured HoleCallout; every schema
  field has a description; the status and params prose name every
  failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ui-text skill asks a new label for ko too (review of 15ade12, nit 6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two lines @Gleinkaa's merge of drawings (6f94406) changed in the
callout: `Vec3` comes from `solidcore_record` with the geom prelude, and
a point inside a sheet is `classify_point` = `Inside`, as `Body::contains`
is gone. The replay onto drawings 4bd7b40 keeps them as a commit, in
the merge's place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per ASME Y14.5 and ISO 6410 a tapped hole whose thread has its own depth reads thread first:
'2× M8 ↧ 14.00', then 'Ø6.75 DURCH', then the counterbore or countersink. The count goes on the
first line. A thread that runs the hole's length stays one line, '{count}{thread}{extent}'.
…cy-labs#7605)

Merging drawings brought the hole table's M8 tap drill at 6.80, not the
6.75 the tests carried. The countersink case follows: its cone reaches
(12.75 - 6.80) / 2 = 2.975 below the top, so the thread is 12.975 deep.
…ency-labs#7605)

other_item listed every other id kind but these two, so an occurrence's
id fell through to the below-the-counter branch and read as lost instead
of the error the module promises. Add both, and an occurrence id to the
hostile-input test next to the component case.
…after a point is deleted (tangency-labs#7605)

hole_spots takes the design (tangency-labs#12919), and a counterbore names its bridge (tangency-labs#11103), which a callout leaves out. Since tangency-labs#8111 a Hole drills only the points still in its sketch, so a callout's hole is its point's place among those; before, a callout after a deleted point read the next hole's place. A Move turns about its origin since tangency-labs#12659: the callout now reads a Move through eval::move_motion, the one reading the Move feature itself uses, so a hole in a body turned about a pivot is where the model puts it.

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

A Move turned about a picked edge turns about that edge where it is in
the model before the Move (tangency-labs#17974). The callout turned the hole about
the line saved when the edge was picked, so it lost a hole whose edge an
earlier step had moved.

move_motion now reads the whole Move, the edge step included, from the
Move feature and the model before it. The Move feature and the callout
both call it. Each doc comment near it now sits on its own function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t.planned (tangency-labs#7605)

The callout command now has the id drawing.hole_callout, so the planned placeholder that held the
ribbon slot takes the .planned suffix, as drawing.dimension.from_model.planned does, and the registry
has each id once (registry_is_consistent).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Cameron Wight <camfrawig@hotmail.co.uk>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
Pre-merge checks: Passed 1

Check name Status Explanation
Existing Defaults Unchanged Passed The PR's UX changes are additive, so no existing UX default changes. Evidence from the checked-out PR commits: - crates/doc/src/drawing/table.rs (lines 73-76): the new PartsList.hardware field use…
Full details: Existing Defaults Unchanged

Explanation

The PR's UX changes are additive, so no existing UX default changes. Evidence from the checked-out PR commits: - crates/doc/src/drawing/table.rs (lines 73-76): the new PartsList.hardware field uses #[serde(default)], so a saved list without it reads as false. Its doc comment says "A drawing saved without it lists none, as it always did." Existing parts lists keep their rows. - crates/engine/src/cmd/drawing_table.rs (line 63, 271): press_in_hardware is a new optional set.list key. Its help text says it is "true on a new list". This is the starting value of a new option, not a changed value of an existing one. The rows only appear for parts that carry press-in hardware. Rows are appended; existing rows and counts are not altered (rows_with, table.rs lines 145-148). - crates/ui-egui/src/drawing_workspace/panels.rs (lines 504-507): the Press-in hardware checkbox is new. It is disabled for an undrawn list. - The hole callout (drawing.hardware_callout.add) and the per-view hardware buttons are new commands and controls. Nothing existing is rerouted to them. - The hardware: false test-record change is test-only. The check's exclusion for geometry results under solidcore/ also applies to the kernel-side hole and cut tests. The description's "Changes a default: no" is arguably loose, since new lists start with the option on. However, no existing default value changes. The new default governs only a new option, and its only visible effect is added rows where hardware exists. This falls under the "purely additive" pass condition. Limitation: I inspected the checked-out commits and did not run the tests.

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

KazW and others added 17 commits November 25, 2026 13:23
…rd, on a view and on a flat pattern view (tangency-labs#20112)

drawing.hardware_callout.add puts a note on a view whose text is the hardware record's now ("2× FLUSH NUT M5"), in the hole callout's style. On a flat pattern view its leader ends on the hole in the flat; a hole that is gone makes it lost, keeping its last text. The flat pattern view's options list the holes to call out.
stray_bore and bore_floor measure along the hole axis with
services::affine::distance_along instead of Vec3::dot; same maths.

Co-authored-by: CamWight <91156642+CamWight@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Vec3

Co-authored-by: CamWight <91156642+CamWight@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/doc/src/sheet_hardware.rs
# Conflicts:
#	crates/engine/src/cmd/drawing_note.rs
KazW added 3 commits November 26, 2026 18:43
# Conflicts:
#	crates/engine/src/cmd/drawing_note.rs
# Conflicts:
#	crates/ui-egui/src/drawing_workspace/panels.rs

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drawings: press-in hardware appears on a sheet-metal drawing as a callout and a parts-list row

4 participants