Repository navigation
Drawings: a sheet prepares each body once for all its views (#13218) - #13220
Merged
bherbruck merged 6 commits intoNov 16, 2026
Merged
Conversation
Contributor
|
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
|
CamWight
force-pushed
the
drawing-prepare-once-13218
branch
from
November 8, 2026 15:24
f398629 to
059f37c
Compare
This was referenced Nov 8, 2026
Collaborator
|
drawings now includes main as of today; please merge drawings into your branch. Thanks! |
This was referenced Nov 15, 2026
CamWight
force-pushed
the
drawing-prepare-once-13218
branch
from
November 15, 2026 16:51
6d0c92d to
331bd85
Compare
CamWight
marked this pull request as ready for review
November 15, 2026 16:51
This was referenced Nov 15, 2026
… edges it draws mesh_lines::prepare grouped the placed bodies (which placements share one copy of a definition's geometry, and which are their own group, such as a mirror image) and chose the edges a view draws inline. Both now live in their own functions in meshes.rs, `placed` and `drawn_edges`, so the exact hidden lines can use the same rules. Nothing a view draws changes. A new test checks the grouping: a copy moved by a rigid transform shares its original's geometry, and a mirror image is a group of its own. Part of tangency-labs#5866. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… only for bodies the exact lines can't draw A drawing view now draws its visible and hidden lines with hlr, from each body's exact faces and edges: straight edges and circles come out exact, other curves as chords within the asked error. A body falls back to the old mesh projection when the exact lines can't draw it (mesh bodies, split round faces, faces or trims hlr can't read, a mesh body that may stand in front of it), and the view's status names how many bodies fell back and why. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn to fail in hlr (tangency-labs#2455) A cylinder seen from each upper corner at 1:2: each side line must end where a piece of its bottom rim ends, visible and hidden, to 1e-6 mm. Two corners miss by 0.75 mm on paper: hlr gives the rim no split where the side line touches it, and the visibility change falls in the first tenth of the rim's one stretch, which classify_range doesn't search. The other sides are 7.7e-6 mm off, at the grazing ray's own-face margin. The test is listed in tests/KNOWN_FAILING_TESTS until hlr splits the rim there; the fix drops the line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gency-labs#2455) A reference part's lines now come from a second hidden_lines call, not from the mesh. That call holds every reference part first, then each model body that may hide one. So reference lines are tested against everything, the model still sees through reference parts unless the view says they hide it, and a reference line on a model line keeps all of it. Reference lines still stop at the view's boundary: a piece inside keeps its exact curve, a line is cut exactly, and an arc is cut on its chords and put back on its circle, as the mesh projection does. Views with reference parts get faster (83 to 63 ms with one, 103 to 79 ms with three, on a plate with four holes and a boss) and certify any max_error_mm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…angency-labs#2455) A body with a face split on one cylinder, cone, sphere or torus stays drawn from its exact curves. Only the split edge, which hidden lines don't draw, comes from the mesh projection, picked by body and edge. The provenance and the max_error_mm refusal name those edges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ency-labs#13218) A sheet's views each prepared every body for hidden-line removal, though preparing a body does not depend on the view. The sheet now hands its views one PreparedBodies set, keyed by each body's place in the model state, so a body is prepared once and later views reuse it. A view of another model state prepares its own. A cancelled prepare keeps nothing. Each view still checks the edges it draws against the body it uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CamWight
force-pushed
the
drawing-prepare-once-13218
branch
from
November 16, 2026 11:26
331bd85 to
b5c018e
Compare
CamWight
added a commit
to CamWight/solidcraft
that referenced
this pull request
Nov 30, 2026
tangency-labs#4892) tangency-labs#13220's test on main calls draw without the design walk that this branch added as draw's second argument; it now walks the design once and passes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A drawing sheet with several views of the same part now exports faster. Before drawing its views, the sheet used to prepare every body for exact hidden lines once per view. Now it prepares each body once, and every view on the sheet uses it.
This is #13218. It stacks on #9399 (views drawn from the model's exact shape), so the diff shows #9399's five commits until #9399 lands in
drawings. The one commit of this PR is the last: "Drawing views: prepare each body for exact lines once per sheet (#13218)".How it works:
PreparedBodiesholds the bodies one model state's views have prepared forhlr, keyed by each body's place in that state. A body is prepared when the first view that shows it asks, and later views use it.drawing_scene::buildkeeps one set per assembly state the sheet's views draw (assembled, exploded, a pose). A view of another state prepares its own, so nothing is lent across states.hlrcalls (the model's lines and the reference parts' lines, from Drawings: views are drawn from the model's exact shape, with the mesh only where they can't be (#5866) #9399) use the same set.Cost, measured in the app on 8 Nov on the W23 plate's four views (fresh apps, before, after, after, before): the sheet's SVG export took 152-177 ms before and 71-83 ms after. The SVG is the same size to within a few bytes. Each view's own work (projection, hiding) is unchanged.
Changes a default: no
Validation
On this branch's head, on
drawings864760834f, dev profile:cargo test -p solidcraft-engine --lib -- drawing_view drawing_scene mesh_lines: 266 passed. The one failure isa_cylinders_sides_meet_its_rims_from_every_corner, listed intests/KNOWN_FAILING_TESTSby Drawings: views are drawn from the model's exact shape, with the mesh only where they can't be (#5866) #9399.a_sheets_views_prepare_each_body_once(one body prepared for three views; a mesh body beside it still drawn from its mesh in every view; two copies and a pin give two prepared bodies),views_of_one_shown_set_share_their_prepared_bodies,a_view_without_a_parts_first_copy_prepares_the_nextanda_cancelled_prepare_keeps_nothing.cargo fmt --checkandcargo clippy -p solidcraft-engine --all-targets -- -D warnings: clean.Screenshots of the behavior (when observable)
None: nothing drawn changes. Every view draws the same lines; only the time to export a sheet goes down (numbers above).
Integration status
drawingse18eb89474(the latest, checked 16 Nov 11:37 UTC). One conflict: the signature ofdraw, beside the flat pattern view's early return (Drawings: a flat pattern view of a sheet-metal part, with its bend lines (#13030) #13033). Both are kept: the flat view returns first and takes no prepared bodies.