Skip to content

Drawings: hole callouts on views (#7605) - #17009

Merged
tangency-repo-manager[bot] merged 33 commits into
tangency-labs:mainfrom
CamWight:w29a-hole-callouts-7618
Nov 28, 2026
Merged

tangency-repo-manager[bot] merged 33 commits into
tangency-labs:mainfrom
CamWight:w29a-hole-callouts-7618

Conversation

@CamWight

@CamWight CamWight commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Hole callouts on drawing views: a callout reads a Hole feature and writes its note, such as 5× Ø9.00 THRU or Ø8.00 ↧ 12.00 with its counterbore. The callout work is @Gleinkaa's, from #7618, which closed while it waited. This PR carries it on, up to date with main. Their 19 commits are here in their name, and three small commits on top fit the callouts to what has changed since.

Closes #7605.

Changes a default: no
The callout is a new read-only command; nothing that exists changes what it does.

Change

@Gleinkaa's commits add the callout itself:

  • crates/doc/src/drawing/hole_callout.rs reads a Hole feature (its count, diameter or thread, through or blind depth, counterbore and countersink) and writes its note. A hole is named by its feature and sketch point, and a callout whose hole is gone reads lost;
  • drawing.hole_callout (crates/engine/src/cmd/hole_callout.rs) answers with the callout for a view's hole, read-only, with its schemas;
  • the label lives in assets/locales/pending/drawing-hole-callout.json.

The three commits on top:

What changed since 20 Nov

  • @bherbruck's commits (on the branch, unchanged): the bore's axial and radial distances go through the kernel's affine::distance_along (4cd2dfd, for cargo xtask app-geometry), a merge of main, and the surface axis passed to cosine as a Vec3 (891f802). Everything below is on top of them.
  • A hole at sketch points is found by its point's name. With main's Hole: removing a sketch point keeps joints on their original holes #21485, each sketch point's bore is named after its point (F<id>:point:<p>:bore:…). The callout looked only for F<id>:bore:, so it read "cuts no material" for those holes. It now asks for the name the evaluator gives (hole_point_role), so the two can't drift.
  • CodeRabbit's review, one commit with its tests:
    • a callout that names a note, a rigid group or a configuration row is refused as "is a note, not a Hole feature" (and so on), like a joint's id. They take ids from the design's one counter;
    • a hole at sketch points is measured as the evaluator drills it: in its sketch's frame, against the bodies where they are shown (Make a hole on one side of your demo hinge, and get another hole that should not happen. #17623), with the evaluator's own frames. Its start and direction are given in the frame of the part the bore is in;
    • a blind hole whose wall a later feature widened or narrowed reads failed. The wall's radius is checked wherever the wall lies, not only near the axis;
    • the flange test's six points are written out, not worked out with sin and cos.
  • A callout that can't be sure now reads failed, with the reason (from @BT-USA's findings of 22 and 26 Nov, each with a test built from their repro). A callout that reads resolved promises the drawing is right:
    • a later feature moved or covered the face the hole starts on: "a later feature moved or covered the face the hole starts on". The check is an exact ray along the hole, from just outside its rim (the counterbore's or countersink's rim, if it has one), on both sides of the wall;
    • a through hole that a later join closed, or that a boss now covers: "a later feature closed the hole or put material on its axis: it is now blind, … mm deep". Through means through all, as a Hole with no depth drills; another body below the part doesn't count;
    • copies that a pattern or a mirror makes of the hole: "not supported yet: the copies a pattern or mirror makes of a hole are not counted", until the copies are counted;
    • if the start face can't be checked at all, it says "could not check the face the hole starts on", never that a feature moved it.
  • The kernel-cases list names the new command. drawing.hole_callout has no geometry to grade, so its line in tests/kernel-cases/EXEMPT says where it is tested.
  • Test change: a_later_edit_that_widens_or_narrows_a_holes_wall_reads_failed widens the last through hole first. After any other wall's offset, the kernel refuses that widen ("the wall is too thick: it leaves no room inside the body"), though the walls stay 8 mm apart: Offset face: widening a through hole's wall is refused as NoRoom after an offset of another hole's wall solidcore#3449. The test keeps its four holes, four offsets and expected results; only the order changes.
  • Already right, now pinned by tests from the same reports: a radial hole in a cylinder reads its depth; two holes of one feature in two plates on one line each read their own plate; a hole at a corner of its part still reads; a later feature elsewhere on the start face leaves the callout resolved.

Merges of main

  • 25 Nov (main 49392c8195): no text conflict. main's cfcd82e moved the placement maths behind the kernel interface, so the callout imports solidcraft_kernel::affine, not services::affine.
  • 27 Nov (main 235991e554): one conflict, the Move arm in crates/doc/src/eval.rs. This branch reads a Move's motion through move_motion, which the callout shares. main's Move: Keep Axes With Body, so a Center Pole can follow its body #20139 (Move: Keep Axes With Body) gave the Move carry and leave for its constructions. The arm keeps both: move_motion for the motion, and main's two fields for move_constructions_with. main changed no callout file, and none of the eval functions the callout calls.

Validation

On Windows, --profile ci, head b68add5391:

  • Tests first. On the tests alone (before the fix), start face, through closed and copies FAIL. Radial, two plates, corner and "a feature elsewhere" PASS.
  • Library tests of solidcraft-doc and solidcraft-engine named hole, drawing_dimension or drawing_view: 904 run. The only failures are four tests on tests/KNOWN_FAILING_TESTS (a_new_hole_never_takes_the_dimension_of_an_undone_one, renaming_the_plate_keeps_its_five_dimensions, a_cylinders_sides_meet_its_rims_from_every_corner, a_hole_wider_than_the_part_says_it_removes_all_of_it), plus the widen test before its order change. All 36 hole_callout tests pass on the head.
  • Planted faults, each caught by a failing test:
    • no start-face check;
    • no ray along a through hole;
    • copies not refused;
    • the ray meets every body;
    • no wall-radius check;
    • only a narrowed wall counts;
    • a changed hole not reported.
  • cargo xtask fast --base 235991e554: every test failure outside this PR also fails on main here. That covers the known-failing list, 21 solidcraft-ui-egui tests that fail the same way on 235991e554 itself, and five tests that need a long %TEMP% path or Python.
  • Checks by name: kernel-cases, app-geometry, mesh-decisions, ui-containers, lists, i18n, i18n-cli, assets, icons, licences, skills and layers pass. rustfmt --check is clean on the 13 changed Rust files. Two steps fail on this PC for reasons outside this PR:

Screenshots of the behavior

A callout isn't drawn on a sheet in this PR: drawing.hole_callout is read-only and answers with the callout. So the evidence is the real app's model at each step, with the command's reply beside it. The steps are the new test's: a 60 × 30 × 8 mm plate with a 5 mm blind hole, 4 mm deep, at (45, 15).

  1. The plate as drawn. The callout reads Ø5.00 ↧ 4.00, and the hole starts at (45, 15, 8), drilled downwards.
17009-1-plate-with-its-blind-hole
  1. The plate turned 180° about its bottom front edge (seen from below). The callout still reads Ø5.00 ↧ 4.00. The hole now starts at (45, −15, −8), drilled upwards.
17009-2-turned-about-its-bottom-edge
  1. A lift of 50 mm is added and dragged before the turn, so the edge is at z = 50 when the plate turns about it. The callout follows the model: it is still resolved, and the hole now starts at (45, −15, 42). Before the turn commit, the callout turned the hole about the edge's old place (z = 0), so it read failed for a hole that was still there.
17009-3-lifted-before-the-turn

Pictures from the real app, window 1280×720, driven over the control channel, taken on 18 Nov at 1fb85974e5. The "before" for step 3 is the new test, which failed before the fix. The steps are tests that run on this head (results above); nothing that changed since makes them look different.

Known gaps

  • A later feature that covers only part of the rim, and misses both rays, still reads resolved.
  • A start face renamed by an unrelated later feature would read "moved or covered". No test makes one.
  • A thread's class and hand are left out (M22x1-6H-LH, 1/4-20 UNC-2B). The Hole feature already holds them (thread_class, hand), so it is text only.
  • Text: M8X1 is kept as typed, a coarse pitch is not left out (M8x1.25 for M8), a countersink's angle takes the length's decimals, and a size that rounds to zero is drawn as 0.

@BT-USA offered a PR on top of this one for the thread text, and a rewrite that counts copies and reads the hole from its exact faces.

Follow-ups

  • The ribbon's Hole Callout button stays a planned placeholder. It could start the real command once the callout has an interactive tool.

Integration status

On main 235991e554 (merged in 27 Nov), head b68add5391. #13031 (chamfer notes) is built on this PR. #22250 (press-in hardware callouts, draft) carries its commits.

Summary by CodeRabbit

  • New Features
    • Added a Hole Callout command that reports hole dimensions, form, and extent, with formatted text and support for unit and language options.
    • Callouts can distinguish resolved, suppressed, failed, and lost hole references.
    • Added translations for the Hole Callout label in eight languages.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Adds model-based hole callout resolution and text formatting. Exposes the results through a read-only command and schema. Updates drawing UI labels and translations, and adds tests for resolution, formatting, and command responses.

Changes: Hole Callout

Layer / File(s) Summary
Model contracts and evaluation access
crates/doc/src/drawing.rs, crates/doc/src/drawing/dimension.rs, crates/doc/src/drawing/hole_callout.rs, crates/doc/src/eval.rs, crates/engine/src/cmd/drawing_dimension.rs
Adds document-level callout types and validation helpers. Shares the default decimal setting and exposes evaluation helpers used by resolution.
Hole resolution and measurement
crates/doc/src/drawing/hole_callout.rs
Resolves persistent feature and point references. Measures hole data from evaluated features and named bore faces. Reports unresolved, unsupported, or changed holes.
Callout text formatting
crates/doc/src/drawing/hole_callout.rs
Formats callout lines from hole values, units, decimals, and language. Handles thread depth, counterbores, and countersinks.
Command, schema, and drawing UI
crates/engine/src/schema/hole_callout.rs, crates/engine/src/schema/mod.rs, crates/engine/src/cmd/hole_callout.rs, crates/engine/src/cmd/mod.rs, crates/engine/src/cmd/drawing_ui.rs, crates/ui-egui/src/workspace.rs, assets/locales/pending/drawing-hole-callout.json
Adds command parameters and result types, registers the command, and updates drawing UI labels and translations.
Command behavior validation
crates/engine/src/cmd/hole_callout_tests.rs, crates/engine/src/schema/hole_callout_tests.rs, crates/doc/src/drawing/hole_callout.rs
Adds tests for hole geometry, persistent references, statuses, formatting options, model edits, and schema-conforming command responses.

Estimated code review effort: 4 (Complex) | ~60 minutes

Merge Risk: Moderate · up to e1dbe

The new hole-callout command can report a failure for a hole that was drilled correctly when its sketch is in a moved component. It can also show a stale diameter when a later feature enlarges a blind hole's wall. It is read-only and does not place callouts on sheets. Resolve these correctness gaps, and the layer-boundary issue, before merging.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "Drawings: hole callouts on views (#7605)" names the main change: read-only hole callouts for drawing views, as the linked issue and PR objectives describe. It is specific and concise. It is…
Linked Issues check Passed Directly linked issue #7605 asks for a read-only, model-derived hole-callout content slice below the UI. The reviewed head adds that slice: crates/doc/src/drawing/hole_callout.rs defines `HoleRef { …
Out of Scope Changes check Passed Changes outside the new callout files each support the callout or the command surface. (a) crates/engine/src/eval.rs: the move_motion helper is shared by the Move evaluator and the callout, so the…
Description check Passed The description follows the template's main sections: Change, Validation, Screenshots, and Integration status. It explains the callout command, its scope, and the three follow-up commits. It gives con…
Existing Defaults Unchanged Passed The PR changes no existing UX default. The description's "Changes a default: no" matches the diff. Changes checked against base 235991e (git diff): - Additive: the drawing.hole_callout comm…
Full details: Title check

Explanation

The title "Drawings: hole callouts on views (#7605)" names the main change: read-only hole callouts for drawing views, as the linked issue and PR objectives describe. It is specific and concise. It is slightly broad because the PR does not place callouts on sheets, which the objectives state is deferred. That makes it partially aligned, but it still refers to the primary change.

Full details: Linked Issues check

Explanation

Directly linked issue #7605 asks for a read-only, model-derived hole-callout content slice below the UI. The reviewed head adds that slice: crates/doc/src/drawing/hole_callout.rs defines HoleRef { feature, point } with the outcomes resolved, suppressed, failed, and lost, and it reads the Hole feature's evaluated parameters. drawing.hole_callout (crates/engine/src/cmd/hole_callout.rs) is the read-only command, and crates/engine/src/schema/hole_callout.rs supplies its schemas. Against the acceptance criteria: (1) through versus blind comes from the feature extent (Extent::Through and Blind), and the summary says the blind test covers a hole with a depth and no floor. (2) Depth from a pocket floor or target object is covered by tests. (3) Counterbore and countersink keep diameter and depth through Form. (4) Count comes from the feature's points, and deleting a point yields lost, with the per-point fix in the follow-up commit. (5) Suppress, undo, and parameter-edit tests exist. (6) Thread is reported in thread and thread_depth. (7) Hostile input is covered by validation (HoleRef::validate, TextStyle::validate, HoleFeatureParam, DecimalsParam, and the 10,000-point limit) and by tests. The summary reports 24 doc and 191 engine tests passing for the filtered set. Limit: this verdict relies on the summary and test names. I did not read the resolve code or the test bodies. Patterned or mirrored copies and sheet placement are deferred as the issue states.

Full details: Out of Scope Changes check

Explanation

Changes outside the new callout files each support the callout or the command surface. (a) crates/engine/src/eval.rs: the move_motion helper is shared by the Move evaluator and the callout, so the callout reads a Move the same way the model does. This is needed for the issue's requirement that the callout follow model edits. (b) crates/engine/src/cmd/drawing_ui.rs and crates/ui-egui/src/workspace.rs: the placeholder ribbon ID changes to drawing.hole_callout.planned, which removes the duplicate registry ID with the real command. The ribbon label mapping is updated to match. (c) crates/doc/src/drawing.rs: unit validation now uses the shared is_length_unit helper, which the callout's TextStyle::validate depends on. (d) crates/doc/src/drawing/dimension.rs and crates/engine/src/cmd/drawing_dimension.rs: DEFAULT_DECIMALS moves to a shared constant, and the callout uses it as its default. Locale and mod.rs edits register the pending label and the new modules. No change was found that is unrelated to hole callouts. The PR description states that the placeholder stays planned and that sheet placement is a follow-up, so the change does not add placement behavior. The bridge and tip_angle exclusion is documented in the PR description and matches the callout schema.

Full details: Description check

Explanation

The description follows the template's main sections: Change, Validation, Screenshots, and Integration status. It explains the callout command, its scope, and the three follow-up commits. It gives concrete validation (test counts, planted faults, named checks) and includes three screenshots with steps. Two template items are weak. The 'Changes a default' line is present and set to 'no' with a reason. The title line is absent from the body, so the first template comment (title) is not addressed in the text itself. The screenshots are linked from an external user-attachments URL, which is acceptable, but they show a non-UI flow, which the template allows. Known gaps and follow-ups are documented. Overall the description is mostly complete and specific.

Full details: Existing Defaults Unchanged

Explanation

The PR changes no existing UX default. The description's "Changes a default: no" matches the diff. Changes checked against base 235991e (git diff): - Additive: the drawing.hole_callout command and its schemas, the hole_callout doc module, the pending locale file, and a tests/kernel-cases/EXEMPT line. None of these alters an existing command. - Constant moved, same value: DEFAULT_DECIMALS moved from a private const in drawing_dimension.rs to pub const in dimension.rs. The value stays 2, so dimension behaviour is unchanged. - Validation refactor, same logic: the drawing-unit check now calls is_length_unit. The new helper, unit.trim() == unit &amp;&amp; expr::unit_info(unit) is a length kind, is the same expression as the old inline check, so accepted units do not change. - Move evaluation refactor: move_motion takes over the same computations that the Move arm ran inline. The turn-line fallback and the copy-placement check are kept. Any change in Move geometry would be kernel behaviour, which the check excludes. - Ribbon placeholder id: drawing.hole_callout is renamed to drawing.hole_callout.planned in drawing_ui.rs and workspace.rs. The button was already a planned placeholder with no action. Its section, position and label ("Hole Callout") are unchanged. A search found no keybinding or shortcut that references the old id. No default setting, preference, shortcut, default layout or usual-use behaviour of an existing command changes. The check passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

@github-actions github-actions Bot added the area:doc timeline, components, parameters, naming label Nov 14, 2026
@bherbruck
bherbruck changed the base branch from drawings to main November 18, 2026 05:06
@bherbruck

Copy link
Copy Markdown
Collaborator

Drawings landed on main (#18615), so I've retargeted this PR to main. It may need a rebase onto main; once it's green and out of draft it goes through review and the merge queue as usual.

CamWight added a commit to CamWight/solidcraft that referenced this pull request Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CamWight
CamWight force-pushed the w29a-hole-callouts-7618 branch from 2803826 to a4982af Compare November 18, 2026 06:54
@bherbruck bherbruck added the status:decision Waiting on a maintainer group decision; don't merge or close label Nov 18, 2026
@bherbruck

Copy link
Copy Markdown
Collaborator

Holding this one for now. I'm resetting the direction for drawings before more lands on top:

  • A drawing view is a projected sketch on a white sheet, drawn as lines. Views use the sketch Project path; hidden lines and silhouettes get added to that shared path rather than living in a separate projector.
  • Annotations use the same references as projected sketches, so they follow the model exactly like projected sketch geometry does.
  • Dimensions use the sketch Dimension tool (picking, circle/arc/line/angle detection, placement), writing a drawing annotation instead of a constraint.
  • Controls are the shared ones: selection, box select, Delete, Esc, undo/redo, shortcuts and the tool lifecycle are the same as in Design and Sketch.
  • No workspace ever locks the model. Design drives the drawing; the drawing just shows out-of-date views.

I'll lift the hold once that base is on main. Then please rebase onto it, and rework anything here that carries its own version of views, projection, references, dimensions, selection or controls. Drawing-only pieces (title blocks, parts lists, tables, balloons, revision tags, templates, PDF/DXF export) are very welcome on top of the shared pieces.

Gleinkaa and others added 15 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>
Gleinkaa and others added 5 commits November 21, 2026 01:46
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>
@BT-USA

BT-USA commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Thank you Gleinkaa for the hole callouts, first in #7618, and CamWight for carrying them onto main here. The callout reads the thread, the extent, the countersink and the count from the Hole feature, and says failed with a reason instead of guessing. The commands are well covered by tests, and that made it easy to see what the model has and what the callout says.

I know this PR is on hold while drawings move to the shared sketch base. The findings below are about how the callout reads a hole from the model, not about views or controls, so they should still matter after the rework.

I tested drawing.hole_callout on this PR's head e1dbe7acc against the exact geometry of the model (point classification on the B-rep, not the display mesh). A callout that reads resolved is a promise that the drawing is right, so I looked for cases where it is not.

Each repro is a JSON script. Run it with solidcraft-cli run file.json --results --param-check strict. The expected value is what the exact model has.

1. A later feature moves the face a blind hole starts on, and the callout keeps the old depth

[{"command":"solid.box","params":{"length":60,"width":30,"height":20}},
 {"command":"solid.hole","params":{"position":[15,15,20],"diameter":6,"depth":10,"name":"H"}},
 {"command":"sketch.create","params":{"plane":{"origin":[0,0,20],"x_dir":[1,0,0],"y_dir":[0,1,0]}}},
 {"command":"sketch.rectangle.two_point","params":{"p0":[0,0],"p1":[30,30]}},
 {"command":"sketch.finish","params":{}},
 {"command":"solid.extrude","params":{"distance":4,"direction":"negative","operation":"cut"}},
 {"command":"drawing.hole_callout","params":{"feature":2}}]

The cut lowers the top round the hole to z = 16. The floor stays at z = 10, so the hole is 6 deep now.

Expected: failed, saying the hole is 6.00 mm deep where the feature drills 10.00 mm. Actual: resolved, Ø6.00 ↧ 10.00. A press-pull of the top face does the same.

2. A through hole closed by a later join still reads THRU

[{"command":"solid.box","params":{"length":60,"width":30,"height":8}},
 {"command":"solid.hole","params":{"position":[15,15,8],"diameter":6,"name":"H"}},
 {"command":"sketch.create","params":{"plane":{"origin":[0,0,0],"x_dir":[1,0,0],"y_dir":[0,1,0]}}},
 {"command":"sketch.rectangle.two_point","params":{"p0":[0,0],"p1":[60,30]}},
 {"command":"sketch.finish","params":{}},
 {"command":"solid.extrude","params":{"distance":5,"direction":"negative","operation":"join"}},
 {"command":"drawing.hole_callout","params":{"feature":2}}]

The slab joined underneath closes the exit, so the hole is blind and 8 deep.

Expected: failed, saying it is now blind and 8.00 mm deep. Actual: resolved, Ø6.00 THRU. A boss joined on top, which buries the hole, also reads THRU.

3. A valid radial hole in a cylinder reads failed

[{"command":"solid.cylinder","params":{"radius":20,"height":50}},
 {"command":"solid.hole","params":{"position":[20,0,25],"diameter":6,"depth":8,"name":"Radial"}},
 {"command":"drawing.hole_callout","params":{"feature":2}}]

Expected: resolved, Ø6.00 ↧ 8.00. Nothing after the hole changes it.
Actual: failed, "a later feature changed the hole: its diameter or depth no longer is the feature's".

The evaluation moves the position onto the round face before it drills. The callout measures from the position as saved. Taking the position as the evaluation stored it fixes this.

4. Pattern copies: resolved with one hole, where the module says copies are not supported yet

[{"command":"solid.box","params":{"length":100,"width":30,"height":8}},
 {"command":"solid.hole","params":{"position":[10,15,8],"diameter":6,"name":"H"}},
 {"command":"solid.pattern.rectangular","params":{"features":["H"],"dir1":[1,0,0],"count1":4,"spacing1":20}},
 {"command":"drawing.hole_callout","params":{"feature":2}}]

The model has four identical holes. Expected: 4× Ø6.00 THRU, or, until copies are counted, failed with "not supported yet". Actual: resolved, Ø6.00 THRU, count 1. A mirror of the hole does the same.

5. The thread's class and hand are dropped

[{"command":"solid.box","params":{"length":60,"width":30,"height":20}},
 {"command":"solid.hole","params":{"position":[15,15,20],"thread":"M22x1","thread_class":"6H","hand":"left","depth":15,"name":"T"}},
 {"command":"solid.hole","params":{"position":[45,15,20],"thread":"1/4-20 UNC","thread_class":"2B","depth":15,"name":"U"}},
 {"command":"drawing.hole_callout","params":{"feature":2}},
 {"command":"drawing.hole_callout","params":{"feature":3}}]

Expected: M22x1-6H-LH ↧ 15.00 and 1/4-20 UNC-2B ↧ 15.00. Actual: M22x1 ↧ 15.00 and 1/4-20 UNC ↧ 15.00. A left-hand thread called out as right-hand is the one that matters most here.

6. Thread names, angles and small sizes

[{"command":"solid.box","params":{"length":100,"width":60,"height":40}},
 {"command":"solid.hole","params":{"position":[90,30,40],"thread":"M8X1","depth":15,"name":"Upper"}},
 {"command":"solid.hole","params":{"position":[10,30,40],"thread":"M8x1.25","depth":15,"name":"Coarse"}},
 {"command":"solid.hole","params":{"position":[10,52,40],"diameter":6.6,"depth":15,"type":"countersink","cs_diameter":12,"cs_angle":"90 deg","name":"CS"}},
 {"command":"solid.hole","params":{"position":[50,5,40],"diameter":0.05,"depth":0.2,"name":"Tiny"}},
 {"command":"drawing.hole_callout","params":{"feature":2}},
 {"command":"drawing.hole_callout","params":{"feature":3}},
 {"command":"drawing.hole_callout","params":{"feature":4,"decimals":6}},
 {"command":"drawing.hole_callout","params":{"feature":5,"decimals":0}}]
Hole Expected Actual
M8X1 as typed M8x1 ↧ 15.00 M8X1 ↧ 15.00
M8x1.25, the coarse pitch M8 ↧ 15.00 (ISO 965-1 leaves out a coarse pitch) M8x1.25 ↧ 15.00
Countersink at 6 decimals ⌵ Ø12.000000 × 90° ⌵ Ø12.000000 × 90.000000°
Ø0.05, 0.2 deep, at 0 decimals Ø0.05 ↧ 0.2 Ø0 ↧ 0

The angle takes the length's decimals. A size that rounds to zero is drawn as 0.

A related problem outside this PR

A Hole picked on a curved face starts on the display mesh's facet, a little inside the exact surface, so its depth from the exact surface is off by the facet's sag (about 0.02 mm for a Ø40 cylinder). That is in the Hole feature, not in the callout. We report it in a separate issue.

Patches

We have patches with a regression test for each finding, in hole_callout_tests.rs. Each test fails on e1dbe7acc.

  • 5 and 6 (the text): ready. A few existing expected values change from × 90.00° to × 90°, each with a derivation in its commit message. They need a small rebase to stand on their own.
  • 1 to 4 (depth, through and count): not ready to offer. Our version samples the model with rays round the hole's axis. It still misreads some cases (a smaller hole below a bore, a chamfered rim, a copy that lands on a hole already counted), and it is slow on a part with many holes, where the callout today is fast. We are rewriting it to read the hole from its own exact faces (the bore walls, the floor and the start face of the feature's result). There is no code yet. We will say here before we open a PR, so that nobody does the same work twice.

Happy to open a PR for 5 and 6 on top of this one, or after the rework, whichever you prefer.


Generated by Claude Code

@bherbruck bherbruck removed the status:decision Waiting on a maintainer group decision; don't merge or close label Nov 24, 2026
@bherbruck

Copy link
Copy Markdown
Collaborator

The drawings hold is lifted now that the projected-sketch base is on main. Next step: please run git fetch upstream && git merge upstream/main, resolve crates/doc/src/eval.rs and crates/engine/src/schema/mod.rs, and push. Reviews follow docs/design/drawing-ui (the drawing UI spec): drawings are always on and use the app's shared controls.

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

Copy link
Copy Markdown
Collaborator

I merged main into your branch for you (ed64f7b). Conflicts: the module lists in crates/doc/src/drawing.rs and crates/engine/src/schema/mod.rs and the dimension imports (all kept, in order), and hole_spots in crates/doc/src/eval.rs, which main changed to return HoleSpots (a point plus the sketch point it drills at). I kept it pub(crate), made HoleSpot and its at field pub(crate), and the hole callout now reads spot.at in its two places. It builds; CI runs on it now. Please pull before your next push.

bherbruck and others added 3 commits November 25, 2026 17:29
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>
@bherbruck

bherbruck commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

I fixed the app-geometry failure in Format and repository checks for you (891f802) and merged main (merge commit, only your files differ from main). The callout's two new sites now call the kernel's existing ops and do the same maths:

  • stray_bore and bore_floor in crates/doc/src/drawing/hole_callout.rs take the distance along the hole axis with solidcraft_kernel::services::affine::distance_along instead of Vec3::dot.
  • the three "is this surface along the axis" tests use a small cosine helper over the same function.

cargo xtask app-geometry reports no new sites, and it builds. CI runs on the new head. Please pull before your next push.

Update, Nov 27: it conflicts with main again, in one place, crates/doc/src/eval.rs at the Move arm: main's #20139 (Keep Axes With Body) added carry and leave to FeatureKind::Move and passes them to move_constructions_with(…, carry, leave) further down the arm, while your branch moved the motion into move_motion. Keeping your side, the arm's pattern becomes

FeatureKind::Move { bodies, copy, copy_frames, carry, leave, .. } => {

with main's move_constructions_with call kept as it is. I didn't push that myself because the arm needs a build to confirm; could you merge main with that, run cargo check -p solidcraft-doc --tests, and push? CI runs on the merge.

@tangency-repo-manager tangency-repo-manager Bot added the approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) label Nov 25, 2026
@BT-USA

BT-USA commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Hi @CamWight, thank you for carrying this on. I have been trying hole callouts against a few awkward designs and found three places where the note can read the wrong hole, or can't say something a drawing usually needs. These are suggestions for you to take or leave, since you own the feature. I have not opened a PR or touched your branch. My own fixes were written against a different callout reader, so I could not offer a patch that applies cleanly to yours; each item below has a small repro and what I'd expect, which you can turn into a test in hole_callout_tests.rs if you like.

1. Two holes of one feature on one line.
Make two boxes, PlateA (40 x 40 x 8) and PlateB (40 x 40 x 1.5, placed at x = 100, top flush with PlateA's top). Sketch two points on the top plane, q1 = (10, 15) and q2 = (110, 15), and drill one Hole feature (diameter 6, depth 2) with both plates as targets. PlateA's hole is blind (2 deep), PlateB's goes right through. Then solid.move PlateB by [-100, 0, 0] so both holes lie on the same line.
Expected: the callout for q1 reads Ø6.00 ↧ 2.00 and the one for q2 reads Ø6.00 THRU. A reader that picks "the first body whose bore matches the stored line" gives q2 the blind note, because the two bodies' bore faces carry the same names. Remembering which body each hole was drilled into (settled at the end of the Hole feature, from the exact faces) and reading the hole from that body only fixes it. The same holds after moving PlateB into another component with a translated occurrence.

2. A hole keeps its identity when the design is rebuilt.
Same design as above, but instead of moving, split PlateA through the bore with a plane at x = 10, or pattern the hole. The bodies now share face names, so a name-based reader can answer "ambiguous", or the wrong body. Every face a Hole drills can carry the point it was drilled for as a second role (for example bore:side:0:hole-spot:<k>, with the pattern copy's suffix after it). That survives a rename, a move, a split and a save, so each drawing.hole_callout for point k finds its own bore. Expected: after the split, the callout for q1 still reads its blind note and no callout says ambiguous.

3. Chamfer and thread callouts measured on the view, and "x2" after the note.

  • A chamfer on a 20 mm diameter shaft end, 0.5 mm at 45 degrees: a linear dimension between the cone's two rims on the silhouette, reading 0.5 x 45°. Expected: extension lines come from the chamfer's own edges, so it moves with the model.
  • An M8 tapped hole seen from the side: a dimension across the thread's major lines (the thin root line for a tapped hole, never the drill), reading M8. Expected: refused for a thread seen end-on or a modelled thread, since neither draws thread lines.
  • A feature of two identical holes: an option to put the count after the note, Ø6.00 THRU (x2), as well as the 2x before it that you already have.
    I'm happy to describe any of these in more detail, or to look at your branch and say which of them it already covers.

Generated by Claude Code

@CamWight

Copy link
Copy Markdown
Contributor Author

@BT-USA Thanks BT! I'll feed this back in 👍🏼👍🏼

@CamWight

Copy link
Copy Markdown
Contributor Author

Thanks @bherbruck. That's the same resolution I have locally: your pattern for the Move arm, with main's move_constructions_with call kept. It goes up together with the fixes for CodeRabbit's five threads, once their test run is done on my side today.

CamWight and others added 6 commits November 27, 2026 17:40
…s name


Main's hole spots with sketch points (tangency-labs#21485) name each point's hole after its point
(`F3:point:p2:bore:side:0`), where the callout looked only for `F<id>:bore:`. So a callout
on a hole at a sketch point found no bore and read "the hole cuts no material". The callout
now names the bore it looks for from the hole's own point with main's `hole_point_role`, and
the stray-bore check takes a bore of the feature at any of its points.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… from another part's sketch, a widened wall


- A callout that names a note, a rigid group or a configuration row is refused as "is a note,
  not a Hole feature" (and so on), like a joint's id: they take ids from the design's one counter.
- A hole at sketch points is measured as the evaluator drills it: in its sketch's frame, against
  the bodies where they are shown (tangency-labs#17623), with the evaluator's own frames. Its start and
  direction are given in the frame of the part the bore is in.
- A blind hole whose wall a later feature widened or narrowed reads failed: the wall's radius is
  checked wherever the wall lies, not only near the axis.
- The flange test's six points are written out as coordinates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's cfcd82e moved the placement maths behind the kernel interface: the hole callout's
import of affine is now solidcraft_kernel::affine, not services::affine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t or closed it


A callout that reads resolved promises the drawing is right. Three cases
read resolved with the wrong note:

- A later cut, press-pull or boss moves or covers the face the hole starts
  on. The bore keeps its faces at the old depth, so the callout kept the
  feature's depth. Now an exact ray along the hole, from above the widest
  rim (the counterbore's or countersink's), must meet the start face first,
  as far down as it did just after the hole.
- A later join closes a through hole's far end. Its exit face is not one
  of the bore's, so the hole read THRU. A Hole without a depth drills
  through all, so now an exact ray along a through hole's axis, as far as
  it drills, must meet nothing of the bodies with the hole's faces.
- A pattern or mirror copies the hole. The count was the feature's own
  points. Copies are not counted yet, so such a hole now reads failed,
  not supported yet.

The repros come from review comments on the pull request. Tests also pin
three cases that already read right: a radial hole in a cylinder, two
holes of one feature in two plates moved onto one line, and a plate split
through its hole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eval.rs's Move arm conflicted: this branch reads the move's motion through `move_motion`, which
the callout shares, and main's Move gained `carry` and `leave`. The arm keeps `move_motion` and
binds main's two new fields for its constructions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l-cases list

The kernel-cases coverage check asks every new command for a case or an EXEMPT line; a callout has
no geometry to grade, and its tests are in hole_callout_tests.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rnel allows

After any other wall's offset the kernel refuses a through hole's widen with "the wall is too thick:
it leaves no room inside the body", though the walls stay 8 mm apart (tangency-labs/solidcore#3449).
The test keeps its 4 holes, 4 offsets and expected results; only the order changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CamWight

Copy link
Copy Markdown
Contributor Author

Thank you @BT-USA, this is a really careful set of findings, and the repros make each one easy to check. I went
through both comments against this PR's current head. Here is what the new head (b68add5) does with each.

In this PR, a callout that can't be sure says failed with the reason, instead of resolved:

Each of these has a test built from your repro.

Already right on this head, now pinned by tests from your repros:

All of these tests pass on the new head.

The thread text (5 and 6): yes please! A PR on top of this one would be very welcome: the class and hand
(LH most of all), the coarse pitch, the case, the angle's decimals and sizes that round to zero.

Counting copies, and reading the hole from its exact faces: I'll leave that to your rewrite and won't start
a second one. Please say here when you begin.

The drawing ideas in your 26 Nov #3:

Thanks again, this made the callouts much more honest.

@bherbruck bherbruck added the ready to merge reviewed, every ask addressed; merge once CI is green label Nov 28, 2026
@bherbruck

Copy link
Copy Markdown
Collaborator

Thanks @CamWight, and @Gleinkaa for the original work. The Move arm merge is right, and the callouts now say failed instead of guessing in every case BT found. Everything is green on b68add5, so I'm putting this in the merge queue now. Nothing more is needed from you; BT's thread-text and copy-counting work can come as PRs on top once this lands.

@tangency-repo-manager
tangency-repo-manager Bot merged commit 7914630 into tangency-labs:main Nov 28, 2026
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) area:doc timeline, components, parameters, naming ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drawing W29a: hole callouts (part of #860)

4 participants