Repository navigation
Drawings: views draw tapped holes and threaded shafts with standard thread lines - #13051
Conversation
Pre-merge checks:
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Existing Defaults Unchanged | The PR changes a default drawing view output, and the description says Changes a default: no. Evidence from the committed code (HEAD 9687469, with b0f8145 and d518127): - `crates/engine/src/drawi… |
1. Name the changed default in the PR description. Set Changes a default: yes and describe the before and after: default drawing views of tapped holes and threaded shafts now draw thread root and limit lines, and existing sheets re-render… |
Full details: Existing Defaults Unchanged
-
Explanation
The PR changes a default drawing view output, and the description says
Changes a default: no. Evidence from the committed code (HEAD 9687469, with b0f8145 and d518127): -crates/engine/src/drawing_view_lines.rs(lines_with,paper_lines) now callsthreads(...)on every view build. It adds the thread pieces toLinesand paints them. No option or setting turns this off. -crates/engine/src/drawing_view_threads.rsruns for every shown non-mesh body that has cosmetic threads. The only gates are "has threads" and "is not a mesh body". -drawing_view_lines.rsalso adds thread pieces to theMAX_RECORDScount. A view that was under the cap before can now be refused with "the view has more than … line pieces". This is a non-additive effect on usual use, but only near the cap. -drawing_scene.rschanges the sheet's cached view key, so existing sheets re-render with the new lines. What a user sees before and after, in the default drawing view: - Before: a tapped hole or a threaded shaft shows only its plain crest and drilled circles and edges. No root arcs, root lines, or limit lines are drawn. - After: each such thread also draws root arcs (seen end on) or root lines and limit lines (seen from the side), and hidden threads draw dashed lines. Existing drawings with threaded parts change appearance on regeneration, with no user action. - The snapshot (drawing.view.snapshot) gains athreadsfield. This field is additive. The default drawing output is not. The "purely additive" exception does not clearly apply. The existing lines are kept, but the default rendering of existing designs changes, and the record cap can now refuse a view that rendered before. The check also states that aChanges a default: nodeclaration fails when the code changes a UX default. Kernel or geometry results under solidcore/ are not in scope here. This change is in drawing output, which the check counts as the default behaviour of a command used the usual way. Not checked: whether any user has relied on the old drawings. The code shows the default output changes for every view with threaded parts.Resolution
- Name the changed default in the PR description. Set
Changes a default: yesand describe the before and after: default drawing views of tapped holes and threaded shafts now draw thread root and limit lines, and existing sheets re-render with them. 2. Add an opt-out (for example a view setting, default on or off as the team decides) so a user can keep the previous default rendering. Alternatively, keep the new lines behind a setting that defaults to the old output. 3. Count thread pieces separately, or exclude them fromMAX_RECORDSin the usual path, so that existing views near the cap do not start to fail. Add a test for that boundary. 4. If the new default is intended, the maintainers must accept it explicitly as a default change. Then the PR can be reviewed again under this check.
- Name the changed default in the PR description. Set
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
5c1a6c8 to
8d38692
Compare
Drawings draw threads by ISO 6410's convention, not turn by turn. This adds the geometry in the drawing code: for a thread's axis, span and crest and root radii, its lines on a view's plane. Seen end on, the crest's circle and the root's three-quarter arc with its gap in the upper right; seen from the side, the crest and root lines and the limit lines asked for; seen at a slant, none. A thread that can't be drawn gives none, never a panic. The next commit draws them in views. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…angency-labs#13050) A drawing view now draws each cosmetic thread its bodies carry by the ISO 6410 convention. End on, a thin three-quarter arc at the root, its gap in the upper right; from the side, two thin root lines along the thread and a limit line where it stops inside its face. The crest is the face's own edge or silhouette, which the view already draws. A root line lies inside its own body's material, so no hidden-line test can see it. Each thread line takes, stretch by stretch, the visibility of the crest line the view drew beside it (end on, the crest circle's at that angle). Hidden ones are dashed and appear only when the style draws hidden lines; a reference part's are thin; a shaded part's are left to its picture. Thread strokes can't be picked. The pairing is paper geometry in the drawing code (`thread_lines::on_paper`), with the chord-sag tolerance the view's exact arcs already use, now one function. The engine finds each shown body's threads and calls it at the end of a view's lines, so the sheet and the snapshot draw the same; the snapshot reports them as `threads`. A view's cache key holds each body's threads, since a cosmetic thread changes no geometry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8d38692 to
9687469
Compare
Requested by Cam
Change
SolidCraft's drawings now show a part's threads the way drafting standards draw them. Before this PR, a tapped hole or a threaded shaft looked plain in a drawing view, the same as an unthreaded one. Part of #13050 (part of #860).
A view now draws each cosmetic thread by the ISO 6410 convention:
Each thread line takes its visibility from the crest line the view drew for it. So a thread is visible or hidden exactly where its hole or shaft is. Where crests overlap, a visible one wins. Nothing is drawn where the view drew no crest. The crest lines are matched on paper, within the same body, with the tolerance the view's own lines were made with.
drawing.view.snapshotgets athreadslist: each thread's body and the occurrences that place it, and its pieces. Each piece is arootorlimitstroke,visibleorhidden, with its path on paper. Scripts and agents can check a view's threads without reading pixels.Changes a default: no
What it touches
crates/doc/src/drawing/thread_lines.rs(new): where a thread's lines lie on paper, and the pairing with the drawn crest lines. This is drawing-only maths, so it lives in the drawing code, not ingeom. The first commit moves the earliergeomversion here unchanged, with its tests.crates/engine/src/drawing_view_threads.rs(new): reads each shown body's cosmetic threads. Mesh bodies and bodies without threads cost nothing.drawing_view_lines.rs: paints the thread pieces with the view's thin and hidden styles. Limit lines are drawn as edges.drawing_scene.rs: a sheet's cached view now includes the threads in its key. A cosmeticsolid.threadedit keeps the body's geometry key, so without this the sheet kept showing the old thread.threadsfield.Not in this PR
Validation
Only the changed code's tests were run, plus planted faults:
solidcraft-docdrawing::thread_lines: 16 of 16. All of docdrawing: 154 of 154.solidcraft-engine: the 21 new tests, anddrawing_view,drawing_sceneandschema: 961 of 961.-D warnings(doc and engine, all targets), rustfmt on every touched file,cargo xtask layers,lists,mesh-decisions(no new mesh decisions) andwasm: all pass.drawing::194 of 194; enginedrawing_view,drawing_scene,drawing_picture,mesh_lines,schemaand the command checks 1042 of 1043, the one failure beinga_cylinders_sides_meet_its_rims_from_every_corner, listed intests/KNOWN_FAILING_TESTS(Drawing W06a: exact orthographic hidden lines for the analytic subset #2455). clippy, rustfmt,kernel-cases --coverageandwasmpass. 3 more planted faults, all caught. One of them needed a new test,a_tapped_block_drawn_from_the_mesh_draws_its_thread: a body drawn from the mesh still gets its thread lines.Cost (
solidcraft-cli run --timings; a 100×80×20 block with 20 holes, Ø6.8 drilled 16 deep, either plain or tapped M8 12 deep; median of 5 snapshots per run):The difference is inside the run-to-run noise. The tapped runs did draw their threads: 20 threads and 60 pieces from the front, and 20 root arcs from the top.
Screenshots of the behavior
A plain test design in the real app: a 60×40×20 block with an M8 hole tapped 12 deep in a 16 mm drilled hole, and a separate M8 shaft threaded 15 mm down from its top. The front view is at 2:1 with hidden lines, with the top view above it.
Top view: both crest circles with their thin three-quarter root arcs, the gap in the upper right. The tapped hole's arc is outside its circle; the shaft's arc is inside.
Front view: the hole's dashed root lines, 8 mm apart, stop 12 mm deep at a dashed limit line. The drilled hole's dashed sides go on to 16 mm. The shaft's thin root lines end at a limit line 15 mm down.
The whole sheet at 1280×720:
A small window (800×500): the sheet still fits.
Integration status
drawings, d518127 (checked 16 Nov 14:54 UTC). Two commits: the move of the thread maths into the drawing code, then the drawing in views.git merge-treeagainst the open PRs nearby (only conflicts this PR adds are counted):drawing_scene_tests.rs. Both PRs add tests at the end of the file, so whichever lands second keeps both. When both are in, the centre mark's cross and the root arc's gap meet in the upper right quarter of a hole; I'll check the two together and fix anything that clashes.drawingsnow, and this PR sits on them. Views draw most bodies from the exact model and only fall back to the mesh for the rest. The thread step now runs once at the end oflines(), after both kinds of lines, and one record cap counts both. The chord tolerance that pairs a thread with its crest is one function,near(), now shared by the exact and the mesh lines.