Skip to content

Drawings: auxiliary and pictorial views made from a parent view (#13044) - #13045

Merged
bherbruck merged 3 commits into
tangency-labs:drawingsfrom
CamWight:drawings-aux-13044
Nov 16, 2026
Merged

bherbruck merged 3 commits into
tangency-labs:drawingsfrom
CamWight:drawings-aux-13044

Conversation

@CamWight

@CamWight CamWight commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Cam

A drawing can now hold two more kinds of view made from a parent view: an isometric (pictorial) view on one of the parent's four diagonals, and an auxiliary view that looks square to a sloped edge or face.

Part of #13044 (part of #860). Still a draft: the review is with the dispatcher, and the sheet page has no button for these commands yet.

What changes

  • Pictorial views. drawing.view.projected takes the four diagonals (above_right, above_left, below_right, below_left) as side. A diagonal makes an isometric view at the parent's scale and settings. It is placed at a point a gap past the parent, never lined up. In third angle, the view above right of the front view is iso_front_right.
  • Which view a point gives. drawing.view.projection_for {parent, offset_mm} says which view drawing.view.projected would make at that point: the nearest of eight directions. It reads no model and saves nothing, so a page preview can call it each frame.
  • Auxiliary views. drawing.view.auxiliary {parent, edge | face, toward?, place?} folds the parent about a line square to the side it sits on. A sloped edge then shows at its true length, and a face the parent sees edge-on shows at its true shape. The edge or face is read exactly from the model, not from a mesh. Only the side is saved (toward, a direction on the parent's paper). By default the view is unfolded from its parent, so each point lines up across the fold line, then moved until it is 20 mm past the parent. An auxiliary view gets a letter, as other views placed apart do; a pictorial view gets none.

Pictures

The real app at 1280x720, on the drawing sheet page. The model is a 100 x 50 x 20 mm block whose top front edge has a 30° chamfer. The front view is at the lower left and its right view beside it. VIEW A is the auxiliary view from the right view, square to the slope: the slope shows at its true size, 20 x 100 mm. The pictorial view, above right of the front view, is at the upper right.

The drawing sheet with the front view, the right view, auxiliary VIEW A and the pictorial view

VIEW A above its parent, the right view The pictorial view

Two things the pictures show that this PR does not change:

  • Default places can overlap. At its default place, the pictorial view overlapped VIEW A. A new view's default place keeps clear of its parent only, not of the other views on the sheet. The pictorial view was moved with drawing.view.move for these pictures. Keeping every new view clear of all views is a placement change for all view kinds, so it is a follow-up, not part of this PR.
  • A short line is missing at VIEW A's upper left. It is where the block's end face is seen edge-on. The lines come from the existing hidden-line path, which this PR does not touch.

Where the maths lives

The fold and the corner view are drawing-only maths. They live in crates/doc/src/drawing/fold.rs, not in solidcore or geom, following the ruling on #16038. Geom, the kernel and solidcore are unchanged. The tests pin the drawing code's isometric views to geom's named views, bit for bit. Toward a side, an auxiliary view is that side's projected view, bit for bit.

Tests

  • fold_tests.rs: the corner view (named views, side views, the isometric and dimetric ratios, 1000 seeded corners, refusals), the pictorial basis, the fold (each side, 1000 seeded directions, refusals), and the side for a line, a face, and each refusal.
  • doc view_tests.rs: both kinds save, read back and resolve. Each kind's record rules are kept.
  • engine drawing_view_tests.rs: a 30° chamfer's auxiliary view shows the slope at its true length, 20, at 1:1 and 1:2. It also lines up across the fold, sits 20 mm past its parent, is refused with words for each bad input, and inspects, lists and copies correctly. The pictorial and projection_for commands have their own tests.
  • Four planted faults, each caught: the first-angle sign, the side's tie rule, the auxiliary view's letter, and the gap.

For whichever PR lands second

Changes a default: no

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Pre-merge checks: Passed 1

Check name Status Explanation
Existing Defaults Unchanged Passed The PR (#13045, author CamWight) adds UX surface to drawings. Diff reviewed from 89058dc to HEAD across doc drawing view/fold, engine cmd/drawing.rs, cmd/drawing_view.rs, cmd/delete.rs and schema/d…
Full details: Existing Defaults Unchanged

Explanation

The PR (#13045, author CamWight) adds UX surface to drawings. Diff reviewed from 89058dc to HEAD across doc drawing view/fold, engine cmd/drawing.rs, cmd/drawing_view.rs, cmd/delete.rs and schema/drawing_view.rs. No ui-egui, shortcut, or geom/solidcore file changed. Additive changes: - drawing.view.projected accepts four new diagonal side values (above_right, above_left, below_right, below_left). The six existing side names are unchanged. - New commands drawing.view.projection_for and drawing.view.auxiliary are registered. Nothing existing is renamed or removed. - The inspect reply gains toward. The side key now also covers pictorial views. Existing projected/base/section replies are unchanged. Existing defaults checked: - Default place for a side-projected view is the same. The old code computed side.along(theirs.max) + gap + side.along(ours.max - ours.min)/2 (and the mirror for min). The new past(...) closure with half = (ours.max - ours.min) * 0.5 gives the same result for Right/Above and Left/Below. - needs_letter for projected views placed at a point is unchanged. Only auxiliary views gain a letter. - copy_to_sheet and view_label for existing projected/section views keep their behaviour. New arms only cover the new kinds. - The delete.rs change is a test update for the new pictorial view. The default-overlap note in the description concerns the new pictorial view's default place. It is not a change to an existing default. The description's Changes a default: no agrees with the code. No UX default a user already relies on changed.

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

@CamWight CamWight changed the title Drawings: auxiliary and pictorial views, with view labels and view rotation (part of #860) (#13044) Drawings: auxiliary and pictorial views, with view labels and view rotation (#13044) Nov 7, 2026
@CamWight CamWight closed this Nov 7, 2026
@CamWight CamWight reopened this Nov 7, 2026
CamWight and others added 2 commits November 16, 2026 05:08
…ew a point gives (tangency-labs#13044)

drawing.view.projected takes the four diagonals as `side` (above_right, above_left, below_right,
below_left) beside the four sides. A diagonal makes a pictorial view: isometric, at its parent's
scale and settings, placed at a point a gap past the parent's boundary on both axes, never lined
up. Like a side, it shows what its two neighbours show: in third angle above right of the front
view is iso_front_right, in first angle below left is.

drawing.view.projection_for {parent, offset_mm} answers which view drawing.view.projected would
make at a point that far from the parent's centre: the nearest of eight equal sectors (a side
within 22.5 degrees of its axis, which wins the tie), its direction and the parent's scale, under
the drawing's projection. It reads no model and saves nothing, for the page's preview.

- doc: the view from a frame's corner (axonometric) and the pictorial basis are drawing-only
  maths, so they live in the drawing code (drawing/fold.rs), not in solidcore or geom (the
  tangency-labs#16038 and tangency-labs#14114 ruling). Geom is unchanged; its named isometric views stay, and the tests pin
  the drawing code's isometric views to them bit for bit.
- doc: ViewKind::Pictorial {parent, diagonal}; Diagonal and Beside (the eight names, with
  of_offset and the one basis rule for a child); can_project_from is the one rule for a new view,
  a saved one and a preview: no view from a pictorial view yet (a section of one included), and
  the chain has room. A pictorial view takes no letter.
- engine: the arms (inspect, descendants, copy, the drawing's list and labels, the sheet guard),
  the default place's second arm, the new command and its schema.
- One pending drawing-format file (view-pictorial.rs) and one pending locale file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e of its parent (tangency-labs#13044)

drawing.view.auxiliary {parent, edge | face, toward?, place?} makes an auxiliary view. It is the
parent folded about a line square to the side it sits on, so a sloped edge shows at its true
length, or a face the parent sees edge-on shows at its true shape. It takes its parent's scale
and settings, and a letter, as a view placed apart does. It is placed once: unfolded from its
parent, so every model point lines up across the fold line, then moved along its side until its
boundary is 20 mm past the parent's. Given `place: {at}`, it goes there instead. Only its side is
saved (`toward`, a direction on the parent's paper), never the edge or face; a lined-up place is
refused.

- doc: drawing/fold.rs gains auxiliary_basis and auxiliary_side, with FoldFor, FoldSide and the
  typed FoldRefusal: drawing-only maths, kept in the drawing code (the tangency-labs#16038 ruling). Toward a
  paper axis the fold is that side's projected view, bit for bit. Geom is unchanged.
- doc: ViewKind::Auxiliary {parent, toward}; resolve_view's match gains its arm; the record's
  rules (placed at a point, `toward` about one unit long, a parent no pictorial view, the chain
  depth); needs_letter's arm. Document::edge_line and face_plane read the picked edge's line and
  the face's plane exactly from the body's record, never from a mesh, because which way the view
  looks is a model decision. A curved edge or face is refused.
- engine: the command and `unfolded` for its place. One ViewSessions serves the pick and both
  measures, and the parent is measured once. fold_refused words each refusal, naming what fits.
  The edge or face is read on the session the parent draws from (tangency-labs#15839). The inspect, list,
  label, copy and move arms; inspect gains `toward`. Copied alone, the view becomes a base view
  looking the way it did, as projected and pictorial views do.
- One pending drawing-format file (view-auxiliary.rs) and one pending locale file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CamWight CamWight changed the title Drawings: auxiliary and pictorial views, with view labels and view rotation (#13044) Drawings: auxiliary and pictorial views made from a parent view (#13044) Nov 16, 2026
@CamWight
CamWight marked this pull request as ready for review November 16, 2026 05:41
…pt, tested in the drawing tests (tangency-labs#13044)

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants