Repository navigation
Drawings: auxiliary and pictorial views made from a parent view (#13044) - #13045
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
| Check name | Status | Explanation |
|---|---|---|
| Existing Defaults Unchanged | 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.projectedaccepts four new diagonalsidevalues (above_right,above_left,below_right,below_left). The six existing side names are unchanged. - New commandsdrawing.view.projection_foranddrawing.view.auxiliaryare registered. Nothing existing is renamed or removed. - Theinspectreply gainstoward. Thesidekey 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 computedside.along(theirs.max) + gap + side.along(ours.max - ours.min)/2(and the mirror for min). The newpast(...)closure withhalf = (ours.max - ours.min) * 0.5gives the same result for Right/Above and Left/Below. -needs_letterfor projected views placed at a point is unchanged. Only auxiliary views gain a letter. -copy_to_sheetandview_labelfor existing projected/section views keep their behaviour. New arms only cover the new kinds. - Thedelete.rschange 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'sChanges a default: noagrees with the code. No UX default a user already relies on changed.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
55c2404 to
e3d1b6b
Compare
…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>
f3ecf8b to
6d85708
Compare
…pt, tested in the drawing tests (tangency-labs#13044) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
drawing.view.projectedtakes the four diagonals (above_right,above_left,below_right,below_left) asside. 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 isiso_front_right.drawing.view.projection_for {parent, offset_mm}says which viewdrawing.view.projectedwould 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.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.
Two things the pictures show that this PR does not change:
drawing.view.movefor 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.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.view_tests.rs: both kinds save, read back and resolve. Each kind's record rules are kept.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 andprojection_forcommands have their own tests.For whichever PR lands second
shifted. This PR adds an auxiliary arm to it, so drop that arm with the function.PlaceParam. TheSome(PlaceParam::At(..))matches inprojectedandauxiliarybecomerequest.place.map_or(.., |place| place.0).ViewKind::Flat. Add the other kind's arms toname,parent,beside,resolve_view,view_label,copy_to_sheet,check_viewandneeds_letter. Both PRs already borrow&view.kind.Changes a default: no