Repository navigation
Description
Part of #4896, for drawings: let a drawing view automatically mark eligible circular features, including hidden holes. Marks follow model and view changes, and users can persistently exclude individual generated marks.
Proposed design
Use a per-view opt-in rule, proposed as Option<AutoMarks { exclude: Vec<ModelEdge> }>. Save the rule and exclusions, not derived strokes. Recompute candidates from the view's current shown model; enabling or updating the rule repeatedly must not accumulate records. Exclusions use persistent model references, including occurrence paths, and remain saved when a reference is lost or suppressed.
Read circular geometry through existing facilities. Body::planar_edges accepts edge indices for one evaluation and returns exact planar segments where available; indices must never become saved identity. ModelEdge carries the body, originating feature, persistent edge name and occurrence path. Reuse or extract the current named-edge resolution and its lost, suppressed, ambiguous and unmeasurable statuses where their contracts fit.
The existing exact_arcs path starts from projected line runs, after hidden lines can have been filtered out. It is useful precedent for projection and placement, but cannot itself discover every hidden hole. Enumerate eligible edges independently of the visible-line filter, respecting the bodies and occurrences the view includes. Mesh bodies and geometry that cannot be read as a face-on circle need an explicit, bounded outcome, not a guessed mark.
Use W20d's shared paper geometry, centre-mark classification, paper-mm sizes and shared dash representation. Integrate with the same scene assembly and cached provider as manual marks; do not introduce a second mark renderer or dash system. Surface exclusions and unresolved references through the agreed command and reporting interfaces.
Acceptance tests
- Enable the rule on one view of an analytic part with four face-on holes. It produces one mark per eligible centre; a repeated update adds no duplicates. Add a fifth hole and the next update adds its mark.
- Two semicircular edges forming a rim produce one mark. A face-on through hole with front and back rims produces one mark. A concentric counterbore produces one mark sized from the largest eligible circle. Candidate ordering does not change the result.
- A quarter-round fillet and an isolated partial arc do not become automatic marks under the proposed conservative full-rim rule. A circular edge seen obliquely produces no circular mark. Include a split rim whose pieces together form a complete circle, and incomplete or overlapping arc pieces that must not be mistaken for one.
- A completely occluded hole is considered even when hidden view lines are off. Test it separately from a body or occurrence excluded by the view's source/hide settings, which must not produce marks. If the necessary view filtering is not yet available, document the limitation and test integration when it lands.
- Two placed occurrences at different positions yield two marks with distinct paths. Excluding one leaves the other. Test coincident projected centres from unrelated occurrences or features: they must not be silently conflated merely because their paper coordinates match.
- Exclude a generated mark through its persistent source association. It remains excluded after save/reopen, view movement and scale changes; a lost or suppressed exclusion remains recorded and is reported, and restoring the model or undoing the change restores the exclusion. Explicit removal permits the mark again. Split and ambiguous remaps never silently attach an exclusion to an unrelated feature.
- Change hole size, position and model topology; marks move or resize with the resolved feature, disappear when no longer eligible, and return after undo. A changed view direction re-evaluates eligibility. Moving the view translates paper output; scale changes preserve W20d's paper-mm overshoot and dash sizes.
- Rule changes and exclusions invalidate the cached result even if model state and resolved view settings are unchanged. One-shot scene construction and the cached provider agree after edits, undo/redo, save/reopen and a model update. Test stale-result rejection at the W14 publication boundary when that boundary exists.
- Manual and automatic marks use the same W20d geometry and styling for the same circle and settings. Supported exports preserve the pattern; report unsupported writer behavior. Include bounded input and record-count tests, invalid references and hostile values without mutation or panic.
- Include a small real-program reproduction, descriptive image and expected versus actual behavior in the implementation PR.
Dependencies and open decisions
- W20d Drawing W20d: manual centre marks and centre lines #9419 / Drawing sheets: add manual centre marks and centre lines (#9419) #9421 must supply the shared mark geometry and interface; its dash dependency Drawing export A5: dashed lines draw dashed in SVG and PNG (#4890) #7430 or its integrated successor supplies the pattern. W20d's dimension/text gap phase separately needs the dimension-paper and measured-text interfaces; reuse that phase when available.
- W14 Drawing W13, W14: references that survive model edits, and updating drawings when the model changes #4892 is not a blanket prerequisite for enumerating or reading circles or refreshing with the current view-line provider. Its automatic/deferred updates, cancellation and late-result guarantees remain integration dependencies for those behaviors.
- Coordinate with W07 source/hide and hidden-line work Drawings: views are drawn from the model's exact shape, with the mesh only where they can't be (#5866) #9399, centre references Drawing dimensions: chains along one line, and a hole's or an arc's centre as a point (#4896, W20c) #9249, and W20d's commands and scene interface. Check dev: familiar modelling workspace #1317 for command-name conflicts.
- Still to settle: full-rim coverage tolerance and grouping identity; how one exclusion represents all edges of a split rim and concentric rims; ambiguous remaps; coexistence of manual and automatic marks at one feature; rule defaults, command names and status/reporting shape. Grouping by projected centre alone is insufficient for unrelated overlapping features. The conservative policy in the tests is proposed, not established behavior.
Phases
- Settle W20d's shared function, naming and classification with its current work. Resolve grouping and exclusion semantics against analytic models.
- Add the validated per-view rule, persistent exclusions and command/inspection lifecycle using the pending drawing-format convention. Test backwards compatibility, undo and reference statuses.
- Discover and group face-on circular candidates independently of line visibility, retain occurrence identity, apply exclusions, and feed W20d's paper function. Keep work and output bounded.
- Integrate scene construction, cache invalidation and supported export reporting. Test model and view changes, provider parity and hidden holes. Integrate W14 publication and deferred-update behavior when its interface exists.
- Run targeted checks and repository CI, then capture the real-program evidence for the implementation PR.
Activity
armin0411 commentedon Oct 30, 2026
/claim
github-actions commentedon Oct 30, 2026
Claimed by @armin0411. Please open a draft PR referencing #9462 within 72 h; the claim lapses otherwise.
/unclaimreleases it.Drawing W20e: derive automatic centre marks (tangency-labs#9462)
Merge #16144: Drawing views: add automatic centre marks (#9462)
Merge #16144: Drawing views: add automatic centre marks (#9462)