Repository navigation
Drawing dimensions: between two cylinders' silhouettes (#4896, W20b) - #9251
Merged
bherbruck merged 4 commits intoOct 31, 2026
Merged
Conversation
This was referenced Oct 30, 2026
CamWight
force-pushed
the
w20b-silhouettes-4896
branch
from
October 30, 2026 13:35
9bb68d7 to
670ecfe
Compare
CamWight
marked this pull request as ready for review
October 30, 2026 13:36
… from (tangency-labs#4896, W20c) A linear dimension's point can be the centre of a circle or an arc, saved as its one edge's name with `centre`. It is found again as construction geometry finds a round edge's centre (`construct::as_circle`), in 3D, so any view can measure it; a split edge is ambiguous, and an edge that is no longer round can't be measured. `drawing.dimension.add` takes `{centre: edge}` wherever a corner goes, and refuses a straight edge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s#4896, W20c) A chain dimension runs through 3 to 64 points in order (corners or hole centres) and reads the distance from each to the next along one line as the view shows it: horizontal, vertical, along a direction, or aligned from the first point to the last. The line runs the way the first point to the last goes, and a point out of order is refused, never moved, so the members add up to the overall from the first point to the last (`drawing_measure::chain`). It reads projected only (true lengths of points off one line don't add up) and shows its members' numbers, never a text instead. `drawing.dimension.add` takes `{chain: {points, direction?}}` and counts the points before looking any up; `drawing.dimension.edit` changes its direction; inspect lists its members, its value being the overall. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es (tangency-labs#4896, W20b) A cylinder dimension saves a face by name (ModelFace, as ModelEdge names an edge) and reads Ø between the cylinder's two silhouettes, which any view but one along its axis shows 2r apart (`drawing_measure::silhouette_side`). The face, or the pieces it was cut into, must lie on one cylinder (the kernel's own condition for faces on a common cylinder); every face of the body on it counts, since the kernel builds a whole cylinder as two half faces; and both silhouettes must lie on those faces, so a fillet's quarter round is refused. `Document::face_reference` picks a face by a point on it or by its index; `drawing.dimension.add` takes `{cylinder: {face}}`, edit refuses its settings, and inspect can list face candidates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#4896, W20b) A dimension between a silhouette of one cylinder and a silhouette of another, as the view shows them. Each is named by a face of its cylinder and by its side: the one nearer the other cylinder on the view, or the one farther (SilhouetteSide). So it keeps to them whichever way round the view shows the cylinders. - geom: drawing_measure::between_silhouettes takes the two cylinders (Cylinder, now geom's: the type doc kept privately), their sides and a direction as a linear dimension takes it (aligned: square to the silhouettes). The silhouettes must be parallel on the view and the axes apart there. Foreshortened when the axes aren't parallel in the model, or the silhouettes lie at different depths. - doc: DimensionKind::Silhouettes { a, b: Silhouette { face, side }, direction }, read as the view shows it. Each silhouette must lie on its cylinder's faces (Lookup::on_cylinder, now shared with the cylinder kind). Document::silhouettes_kind makes two silhouettes of one cylinder of one body that cylinder's diameter (which takes no direction), else the distance between them. - engine: drawing.dimension.add takes {silhouettes: {a, b: {face, side}, direction?}}; drawing.dimension.edit changes its direction only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CamWight
force-pushed
the
w20b-silhouettes-4896
branch
from
October 31, 2026 08:43
670ecfe to
4ff59fe
Compare
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.
Part of #4896 (W19 and W20, dimensions on drawing views), into
drawings: W20b, second slice: the distance between a silhouette of one cylinder and a silhouette of another. Two shafts side by side, or a boss and a hole, are dimensioned by their outline lines as the view shows them. When both silhouettes belong to one cylinder, the dimension is that cylinder's diameter (the first slice's), never a plain distance. The plan is on #4896.Changes a default: no
It adds a dimension kind and command fields; what exists keeps its meaning.
What it does
near(the silhouette nearer the other cylinder on the view) orfar. The sides are named by where the other cylinder is, not by up or down on the paper, so the dimension keeps to the same two lines whichever way round a view shows the cylinders.geom:drawing_measure::between_silhouettestakes the two cylinders, their sides and a direction as a linear dimension takes it: aligned (square to the silhouettes, the default), horizontal, vertical or along a direction. The silhouettes must be parallel on the view, and the axes must be apart there, or near and far would mean nothing; a direction along the silhouettes is refused. It is foreshortened when the axes aren't parallel in the model, or when the silhouettes lie at different depths.Cylinderis nowgeom's type:dockept the same type privately.DimensionKind::Silhouettes { a, b, direction }, each aSilhouette { face, side }, where the face is aModelFaceas the first slice saves it. It reads as the view shows it only (noreading). Its text is the plain number.Document::silhouettes_kinddecides whatdrawing.dimension.addsaves. When both faces lie on one cylinder of one body placed once (the kernel's own condition, as the first slice uses), it saves that cylinder's diameter, which takes no direction. Otherwise it saves the distance between the silhouettes.Lookup::on_cylinderis now the one lookup for both kinds.a's first, for the layout to come.drawing.dimension.addtakes{silhouettes: {a: {face, side}, b: {face, side}, direction?}};editchanges its direction and refuses its other settings.Pictures
No visible change in the app: nothing shows dimensions yet.
Tests
geom: two shafts along X in the front view, radius 5 at the origin and radius 3 at z = 30, read near to near 22, near to far 28, far to near 32 and far to far 38, whichever is given first; up the view the same; along (1, 1) 22√2. Behind the first, or leaning back, the second still reads 22, foreshortened. In the isometric view, two posts along Z read 10√2 − 3 between their near silhouettes. Refused: silhouettes not parallel on the view, axes in one line, a reading of 0, a direction along the silhouettes, a zero direction, a cylinder seen end-on, a zero axis, a radius of 0, negative, not finite or past 1e12, an axis point not finite or past 1e12, and a bad basis. The seeded test (20,000 cases, a quarter hostile) now also measures two cylinders parallel on the view (39,976 pairs of sides): every reading is more than 0, far to far is the most of the four, and aligned is the least of the directions.doc: the record saves each face and side and its direction, and reads back the same; each face keeps a reference's rules; a zero direction, a side that is neither near nor far, areadingand edges on a face are refused.cylinderdimension and readØ10.00; with a direction they are refused. The edit namesdirectionand refuses areading. Refused, with the drawing unchanged: a flat face, the near side of a fillet's quarter round, a hole seen end-on, and a side that is neither near nor far. Hostile values anywhere in a silhouettesaddnever panic.unmeasurable); a flat cut along the small boss's top takes its far silhouette away (unmeasurable, naming it); with the small boss suppressed, it is no longer found.Planted faults: 19, all caught, then a clean run.
What no test reaches
Two faces of one cylinder on a body placed twice (each placement is its own cylinder, so they stay a plain distance); the occurrence frame (every test body is the design's own); a pick that finds pieces on two different cylinders (
ambiguous).Validation
drawings693cf91, after A lost dimension keeps its last value after the design is reopened (#4896 W19d) #9764 (a dimension's saved last good value) and Recovery: unsaved drawing work survives a crash (#3890, K9′) #9289 landed. The conflicts were doc text, command text and tests, with both sides kept, and these commits' new test dimensions now givelast_good. The gate on the top of the W20 stack, 4ff59fe (Windows, robustness goldens skipped): fmt, assets, icons, licences, lists, layers, ui-containers, both clippy runs, wasm and the offline web test pass; the tests of the 14 crates this can reach: 10,286 passed, 0 failed. The planted faults below ran before this rebase and were not run again.drawingsf87b66d after Drawing dimensions: a circle's or an arc's radius and diameter (#4896, W20a) #8959 and Drawing balloons: the record, its rules and its commands (#3874) #9126 (balloons) landed. The conflicts were indimension.rs, where both sides changed the same lines: its lookup's constructor is the oneLookup::newthat balloons and the first W20b slice use. On this commit: fmt; thegeommeasuring tests, thedocdrawing tests and the engine's drawing and schema tests; clippy with all targets ongeom,docand the engine; and, on the top of the stack, lists and the wasm build: all pass.drawingsf87b66d: fmt, assets, icons, licences, lists, layers, ui-containers, clippy, 75 test binaries, wasm and the offline web test. Four tests failed, none in this work:ui_containers::tests::new_packages_examples_and_nested_modules_cannot_escape_the_gate(it expects/in a path, and Windows gives\) andrequested_menu_icons_have_artwork_and_match_manifest(a CRLF checkout, fixed onmainby icon_audit: compare the requested-icons manifest with CRLF checkouts ignored (#4932) #4960), which fail on this PC ondrawingswithout these commits; anda_pin_seated_line_to_line_in_its_bushing_is_measuredandfillet_beside_a_modelled_thread_finishes, time limits under the gate's load, which pass alone in 15 s together.drawingsfefca6b with no conflicts, since Drawing W07: a view's lines, on paper, for the occurrences it shows (#5866) #8970, Bill of materials: stable item numbers, saved with the design (#3874) #7779, Bill of materials: virtual components and a typed quantity (#3874, P6) #9226, Drawing export: a sheet of the open drawing as SVG, from its scene (#4890 A7) #9137 and the revision rows don't touch these files. On the replayed commits: fmt; thegeom,docand engine drawing tests and the engine's schema tests; clippy with all targets ongeom,docand the engine; lists; and the wasm build: all pass.Integration status
Based on
drawings693cf91, on #9250 (W20b's first slice: a whole cylinder's diameter) and #9249 (W20c). Until they land, its diff shows them too; its own commit is the last one.Refs #4896, #860