Skip to content

Drawings: a full section view shows the part cut open along its line (#13046) - #17610

Merged
bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:drawings-section-cut-13046
Nov 16, 2026
Merged

bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:drawings-section-cut-13046

Conversation

@CamWight

@CamWight CamWight commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Cam

Change

On a drawing sheet, a full section view now shows the part cut open along its cutting line. A section view is a view of a part sliced along a line drawn across another view, looking the way the line's arrows point. Until now a section view could be saved (#13047, merged) but drew only a placeholder that said "not supported yet: cutting a section view's bodies". Now each part is cut along the line, and the view draws what the arrows keep: its outline, the holes the cut passes through, and the parts beyond the cut.

This is a later part of the series for #13046 (part of #860). The first part, #13047, set the shape: the view kind, its saved form and the cut it gives to whoever draws it.

Changes a default: no

Test change: a_section_view_inspects_copies_and_draws (#13047's test) checked the placeholder words that this PR removes, so it now checks the drawn lines instead. Its helper's cutting line moved so that it crosses the test block.

What it does

  • The cut. ModelBody::section(&plane) cuts one body along a plane with the kernel's existing half-space cut and keeps the side the arrows point to. The result keeps the body's name, placement and component, so picking a line on the section still names its part.
  • Made once. Each body remembers its last two sections, keyed by its geometry, its name and the plane, as it already remembers its cuts. Every copy of the body shares them, so redrawing the sheet or changing another part doesn't cut it again.
  • One rule for every reader. measured, which every reader of a view's lines and size goes through, cuts the bodies of a full section view. So the sheet, its fit, drawing.view.inspect and the "outside the sheet" check all see the same cut part.
  • What isn't cut, and says so. Reference parts are drawn whole, as a drafter expects. Mesh bodies, and bodies whose cut fails, are drawn whole too, and the view's message names them.
  • Nothing kept. A line that keeps none of the parts shows the placeholder with its own reason, cut_away ("its cutting line keeps none of the parts").
  • Sharing kept. A section view prepares its cut bodies apart from the sheet's other views, so those keep sharing their prepared bodies (Drawings: a sheet prepares each body once for all its views (#13218) #13220). A body without a geometry key no longer shares lines with another body.
  • Still waiting. Half, offset and aligned section views, and shaded ones, still say "not supported yet". Section views still have no dimensions or pictures. Hatching, the command that makes a section view, and the line and letters on the parent come in the next parts.

Validation

Only the changed crates' tests, plus planted faults:

  • solidcraft-doc section_tests: 1 of 1 (a body's section is remembered by its copies, and another plane cuts again).
  • solidcraft-engine section tests: 7 of 7. Six are new: the view draws the cut bodies; copies of a part are cut apart; reference parts are not cut; a mesh body is drawn whole and the view says so; a line that keeps nothing shows the placeholder; other sections and shaded ones wait. One changed (above).
  • solidcraft-engine drawing tests (drawing_view, drawing_scene, drawing::, delete, schema): 194 of 194. On the branch as pushed (drawing_view, drawing_scene, mesh_lines): 273 passed, and the one known failure below.
  • 5 planted faults, 5 caught, each by a failing test: the view isn't cut; the wrong side is kept; the remembered cut ignores the plane; lines share a cut body's geometry; reference parts are cut too.
  • clippy -D warnings (doc, engine, all targets), rustfmt, cargo xtask layers, mesh-decisions, lists and wasm: all pass.
  • Real app: the plate below, its top view at 1:1, and a full section view along the holes' centre line, written into the drawing file (no command makes one until the next part). ui.inspect shows both views drawn and up to date.

Not reached by a test: a body whose cut fails (no input is known to fail it).

Screenshots of the behavior

A 100 x 60 x 20 mm plate with three 12 mm holes and a 25 mm rib. The lower view is its top view; the upper one is a full section along the line through the three holes, looking towards the rib. The cut passes through each hole, so each shows as a pair of edges 12 mm apart, and the rib beyond the cut is drawn too. The view is turned the way a view projected from the top view is turned, so it sits above its parent in third-angle projection.

In the app at 1280x720, light theme (the upper view is the section):

A drawing sheet in SolidCraft with the plate's top view and, above it, its full section view cut through the three holes

Close-up of the two views, cropped from the shot above:

Close-up: the section view above, with each hole as a pair of edges, and the top view below with three circles

Dark theme, and a 760x520 window:

The same sheet in the dark theme The same sheet in a 760 by 520 window

Before this PR, the same file showed the section view's box with "not supported yet: cutting a section view's bodies".

Integration status

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

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

Check name Status Explanation
Existing Defaults Unchanged Passed The check passes. The pull request changes no UX default that a user already relies on. Evidence from HEAD commit 5832128 (#13046): - No default setting, preference, shortcut or UI layout value cha…
Full details: Existing Defaults Unchanged

Explanation

The check passes. The pull request changes no UX default that a user already relies on. Evidence from HEAD commit 5832128 (#13046): - No default setting, preference, shortcut or UI layout value changes. A search of the diff for default, preference, shortcut, layout, theme and setting found no changed value. The only Default hit is DefaultHasher in test-only or hashing code. - The only user-visible change is for full section views. Before, a section view showed the placeholder "not supported yet: cutting a section view's bodies". Now it draws each body cut along its line. The PR body says no command creates a section view until the next part, so users reach these views only through saved drawing files. Such views were not usable before. This is completion of the feature from #13047, not a change to a behaviour that users depend on. - The drawing.view parameter help only adds cut_away to the list of placeholder reasons (additive). - In drawing_dimension.rs, drawing_picture.rs and drawing_scene.rs, section views are still refused for dimensions and pictures, as before. The refusal now uses view.cut.is_some() instead of not_cut_yet. Non-section views keep the same outcome. - In mesh_lines/meshes.rs, the change to unambiguous only affects bodies with no geometry key, which are the section cut bodies. It groups geometry for sharing and does not change the kernel result. - Kernel and geometry code under solidcore/ is not changed in this commit, which is consistent with the check's exclusion. The description's Changes a default: no agrees with the code. No failure condition applies.

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

@github-actions github-actions Bot added area:doc timeline, components, parameters, naming area:ui desktop/web front end, dialogs, viewport labels Nov 15, 2026
@CamWight
CamWight force-pushed the drawings-section-cut-13046 branch from f5ff610 to 3dca354 Compare November 15, 2026 23:21
@CamWight
CamWight marked this pull request as ready for review November 15, 2026 23:23
@CamWight
CamWight force-pushed the drawings-section-cut-13046 branch from 3dca354 to e9afe26 Compare November 16, 2026 11:26
… line (tangency-labs#13046)

A full section view now cuts each model body along its cutting line and draws
what the arrows keep. Each body's cut is made once per plane and remembered on
the body, so every copy of the body shares it. Reference parts, mesh bodies
and bodies whose cut fails are drawn whole, and the view says which. A line
that keeps none of the parts shows the placeholder with its own reason,
cut_away. Half, offset and aligned sections, and shaded ones, still say "not
supported yet". Pictures and dimensions still leave section views out.

A section view prepares its cut bodies apart from the sheet's other views, so
they keep sharing theirs. A body with no geometry key no longer shares lines
with another body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CamWight
CamWight force-pushed the drawings-section-cut-13046 branch from e9afe26 to 5832128 Compare November 16, 2026 11:59
@bherbruck
bherbruck merged commit d518127 into tangency-labs:drawings Nov 16, 2026
36 checks passed
@CamWight
CamWight deleted the drawings-section-cut-13046 branch November 16, 2026 13:22
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:ui desktop/web front end, dialogs, viewport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants