Commit Graph
220 Commits
Author SHA1 Message Date
Christopher OverbeckandClaude Fable 5.1 be7ba3d68e Record viewport associations for new dimensions
Removes PR3's `viewport_frame` seam in `viewport_ref.rs`; the frame is
PR1's camera-derived one everywhere.

The five dimension commands (DIMLINEAR / DIMALIGNED / DIMRADIUS /
DIMDIAMETER / DIMANGULAR) now record a real association when they
measure through a viewport. The commit path's one association gate
(`dimension_association_allowed`, added when PR2 was stacked) gains an
else-branch: where PR2 committed the dimension unassociated and PR1's
inference guard returned an empty source list, `Scene::attach_viewport_
dimension_association` now stores the whole chain — dimension ->
viewport -> block path -> entity -> feature — from the AcceptedSnaps PR1
captured, in definition-point slot order.

* `Scene::dimension_association_slot_points` names that order, including
  the radial dimensions `dimension_reference_points` does not cover.
* `OpenCADStudio::viewport_dimension_snaps` builds the slot array. A snap
  whose paper point is no longer the definition point it fills has its
  model point recomputed from that definition point through the frame:
  the object pick records one click for both extension origins, and a
  rotated DIMLINEAR projects its origins onto the measuring axis.
* Radial dimensions take their own path inside
  `attach_viewport_dimension_association`. Their single reference is an
  osnap type 10 carrying the radial marker (which circle / which polyline
  arc segment) and the angle around it; `source_reference` would hand
  back the generic curve-parameter marker -2, which
  `radial_source_for_marker` cannot find.

One measurement rule, documented in `viewport_ref::measurement_rule`:
`actual_measurement` is always the RAW measurement in the dimension's own
space (paper, for a viewport dimension), and the viewport compensation
lives only in the magnitude of the negative DIMLFAC override, applied
once by the formatter. PR2's persistence already followed it; PR3's
refresh did not — it substituted the model distance times
`model_factor()`, which made a refreshed dimension read `user_lfac` times
too much versus an identical freshly-created one. Refresh now writes the
paper measurement (a debug assert pins resolved paper points to the model
points through the frame), and `axis_distance` goes with it.

Block sub-entity snaps: verified that `block_cache` stamps the top-level
INSERT's handle onto every expanded and clipped sub-wire, so
`wire_source` can only ever report the INSERT — nested inserts included.
`OpenCADStudio::resolve_source_block_path` now descends from that INSERT
at accept time (using the object-pick path's existing
`resolve_measurable_entity`, so arbitrary depth, not just one level) and
fills `SnapSourceRef.block_path` with the real inner entity. Where the
descent cannot identify one — a non-planar-pickable type such as text,
hatch, spline or solid, or nesting past eight levels — the source stays
the INSERT with an empty path, which is coarser but never wrong. Both the
limitation and where it bites are documented on
`Scene::resolve_block_snap_source` and `SnapResult::source`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-15 12:52:00 -05:00
Christopher OverbeckandClaude Fable 5.1 43dea41498 Use viewport snap frame and accepted snaps for dimension measurement
Removes PR2's two seams now that PR1 (viewport snapping) is underneath.

* `Scene::viewport_frame` is PR1's camera-derived implementation. The
  viewport-record version is gone; PR1's returns `None` for oblique /
  perspective viewports, which is what we want — every entry point in
  `viewport_dim_seam` then declines rather than guessing a planar
  mapping. `viewport_dim_seam` is now just the dimension object-pick
  path, and its module doc says so.

* There is one accepted-snap store: PR1's `OpenCADStudio::accepted_snaps`.
  PR2's parallel `dim_accepted_snaps` (and its command-name ownership
  tracking, which PR1's clear-on-command-start/end already does) is
  deleted, along with the `record_dimension_accepted_snap` seam.
  `accepted_snap_for_point` reads PR1's list.

  Two things layer on top:
  - the explicit object pick is not a point step, so it still records its
    own snaps, now through `push_accepted_snap` into PR1's list, and now
    carrying the picked entity handle + block path as a `SnapSourceRef`
    so PR3 can associate it;
  - a typed coordinate carries no snap, so `measure_snap` re-attaches the
    content viewport under a snap that is free *and* source-less. That
    keeps `DIMLINEAR` with typed coordinates inside a 1:10 viewport
    measuring the model, without ever reinterpreting a real paper-sheet
    snap that happens to sit over a viewport.

* One association gate, not two. `dimension_association_allowed` is the
  single predicate, derived from the same `dimension_measure_space`
  classification that decides whether to compensate the measurement, so
  the two can never disagree. `infer_dimension_sources_guarded` delegates
  to it, and the commit path's "commit unassociated when measured through
  a viewport" condition is now that predicate rather than a second,
  independently-computed bool. It also covers the explicit-pick and
  explicit-source-list branches, which the old inference-only guard did
  not. Because the classification ignores the trailing dimension-line
  placement click, an ordinary paper dimension whose placement click lands
  inside a viewport rectangle keeps its association.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-15 12:45:59 -05:00
Christopher OverbeckandClaude Fable 5.1 773365a1b9 Keep the persisted representation and the seam tests consistent
Colocated unit tests pin the persisted representation: a 1:10 viewport with
no user factor writes DIMLFAC -10, a 10-unit paper span then formats as 100,
and the same dimension read back in model space does not scale. A positive
user factor folds into the magnitude, and a drawing-wide negative DIMLFAC
that already carries the compensation writes no override at all. Another
test pins the viewport model->paper affine against ViewportFrame's own
mapping, so object-pick projection and snap projection cannot drift.

Also clears the recorded snaps when a multi-dimension command commits.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-15 12:40:44 -05:00
Christopher OverbeckandClaude Fable 5.1 30c5ccbba1 Measure paper-space dimensions through the viewport they were picked in
DIMLINEAR / DIMALIGNED / DIMRADIUS / DIMDIAMETER / DIMANGULAR created on a
sheet now report the model measurement of the geometry seen through a
viewport, at any viewport scale, while definition points, the dimension line
and the text stay in paper coordinates and the annotation keeps its sheet
size (DIMSCALE is untouched).

A viewport frame is a similarity - uniform scale plus in-plane twist - so
projecting the model span onto the paper axis and compensating gives exactly
the raw paper measurement times 1/scale. No geometry is rewritten: the
compensation is persisted once as a negative DIMLFAC override on the
dimension and applied once by the linear formatter, so preview text,
dimension text, the properties measurement row and DXF/DWG export all agree.
User measurement multipliers fold into the same magnitude, and an explicit
text override still bypasses formatting entirely, so it is never re-scaled.
Angular dimensions are never compensated - a similarity preserves angles.

Mixed input (one point through viewport A, another through viewport B or on
the sheet) is refused rather than silently mis-measured: the command line
explains why and the dimension falls back to plain paper measurement.

A dimension measured through a viewport is left unassociated: its definition
points are projected paper coordinates, so inferring a paper-space
association would bind it to geometry that is not there. PR3 records the real
dimension -> viewport -> entity chain.

The result is one ordinary dimension entity carrying one style override, so
undo/redo works through the existing history with no new out-of-document
state.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-15 12:40:44 -05:00
Christopher OverbeckandClaude Fable 5.1 dbdddb7dc2 feat(app): record accepted snaps per point step and guard dimension inference
Point input now keeps an `AcceptedSnap` alongside each point a command
collects: the paper point, the model point it came from, the viewport and
frame it was seen through, and the geometry identity the snap engine
attributed. Interactive picks record in the click handler, typed / dynamic /
headless points record in `feed_command`, and the list is cleared whenever a
command starts or the active space changes. Commands that don't care keep
consuming the plain paper point unchanged; PR2 reads the model point and
frame, PR3 the source.

Dimension association inference is suppressed when the dimension's points came
through a viewport. Inference matches geometry against the dimension's own
definition points in whatever space it is handed, so paper definition points
projected from a viewport would associate with unrelated paper-sheet geometry
at those coordinates, or match model geometry using paper coordinates. An
empty source list makes `attach_dimension_association` a no-op. PR3 replaces
this with real viewport-aware associations.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-15 12:27:33 -05:00
Hakan Seven 6c0badbdc8 fix: resolve annotation pull request findings 2026-09-14 20:16:46 +03:00
ramox81 a35c996f9f fix(annotate): complete table and data workflows 2026-09-14 14:54:55 +03:00
ramox81 6505b27818 fix(annotate): align annotation ribbon workflows 2026-09-14 11:55:08 +03:00
Hakan Seven 86b059f2d4 Remove implicit sketch constraint inference 2026-09-13 14:02:32 +03:00
gianlucafiore 8a45a84c43 fix(stretch): highlight affected vertices during selection 2026-09-12 21:41:34 -03:00
Hakan Seven 3ab9e25d53 Merge pull request #1210 from Ramox81/codex/fix-split-replacement-handles-20260911 2026-09-11 16:05:56 +03:00
Hakan Seven f51d492994 Merge pull request #1205 from Ramox81/codex/fix-break-curve-spans-20260911 2026-09-11 16:04:53 +03:00
Hakan Seven 173552ed0e Merge pull request #1203 from Ramox81/codex/parity-pedit-jointype-20260911 2026-09-11 15:58:25 +03:00
Hakan Seven f0676d35dc Merge pull request #1197 from Ramox81/codex/parity-measure-20260911 2026-09-11 15:44:27 +03:00
ramox81 33429ffa4c Merge current main with measured curve markers 2026-09-11 15:23:10 +03:00
ramox81 f076db6d53 Merge current main with division marker support 2026-09-11 15:23:05 +03:00
ramox81 1e82fb9f78 Pass join settings through the shared polyline result handler 2026-09-11 15:17:42 +03:00
Hakan Seven 753fa17b68 Merge pull request #1184 from Ramox81/codex/hatchedit-command-parity 2026-09-11 15:14:43 +03:00
ramox81 0b880ccda8 Add persisted polyline join type and selected connector geometry 2026-09-11 15:07:11 +03:00
Hakan Seven 7edf0de603 Merge updated pull request #1188 from Ramox81/pedit-enhancements 2026-09-11 14:55:26 +03:00
Hakan Seven 7d28cc5256 Merge pull request #1188 from Ramox81/pedit-enhancements 2026-09-11 14:32:32 +03:00
ramox81 8ffd287c33 Avoid undo entries for unchanged break results 2026-09-11 14:09:51 +03:00
ramox81 1ad5452326 Keep the original identity on the first break fragment 2026-09-11 14:07:36 +03:00
ramox81 aa11b10c9a Extend selected polyline terminals using bounded kernel intersections 2026-09-11 14:05:50 +03:00
ramox81 6272722baa Carry hatch origin through creation and pattern editing 2026-09-11 13:40:40 +03:00
ramox81 dbd85c0559 Recreate hatch regions with holes and nested island grouping 2026-09-11 13:12:18 +03:00
Hakan Seven e11796af29 Merge pull request #1199 from ramox81/codex/join-source-workflow 2026-09-11 13:02:17 +03:00
ramox81 356c8b5a7b Keep multiple polyline editing active across selected joins 2026-09-11 12:57:58 +03:00
Hakan Seven 67768a3eca Merge pull request #1187 from ramox81/codex/complete-splinedit-options 2026-09-11 12:52:49 +03:00
ramox81 67f374c853 Apply and persist hatch origin command choices 2026-09-11 12:52:30 +03:00
ramox81 2f33ddbf1a Allocate fresh handles for split command replacements 2026-09-11 12:18:05 +03:00
ramox81 5500272f31 Allocate distinct handles for polyline break fragments 2026-09-11 12:17:59 +03:00
ramox81 57c9e93d0c Join compatible curves during spline editing with grouped undo 2026-09-11 12:04:54 +03:00
Hakan Seven bfadf1c04e Merge PR #1177: Copy picked nested objects with placement and array options 2026-09-11 11:55:43 +03:00
Hakan Seven 7886ffb973 Merge pull request #1177 from ramox81/codex/ncopy-command-parity
Copy picked nested objects with placement and array options

# Conflicts:
#	src/app/commands/blocks.rs
2026-09-11 11:41:52 +03:00
ramox81 5d0ba9cef2 Add persistent nested-copy symbol settings and transactional imports 2026-09-11 11:39:21 +03:00
Hakan Seven 929ffdcde8 Test command replacement identity 2026-09-11 11:36:32 +03:00
Hakan Seven 132c49e675 Merge pull request #1198 from ramox81/codex/preserve-command-entity-identity
Preserve entity identity for one-to-one command edits
2026-09-11 11:33:29 +03:00
ramox81 e3b1f5719c Edit polyline vertex ranges with deferred break and straighten 2026-09-11 11:31:34 +03:00
ramox81 1039f51abf Associate hatch boundaries from internal points and selected sources 2026-09-11 11:18:01 +03:00
ramox81 42439c2e50 Pick spline control vertices with the configured screen aperture 2026-09-11 11:13:09 +03:00
ramox81 6e74cc48d8 Recreate hatch boundaries as exact regions 2026-09-11 10:57:32 +03:00
ramox81 55454cbe6b Preserve entity identity for one-to-one command edits 2026-09-11 10:47:48 +03:00
ramox81 9ca2db82bf Add source-first joins with retained object identity 2026-09-11 10:39:08 +03:00
ramox81 14f6cae508 Import command interface for hatch association prompts 2026-09-11 10:28:29 +03:00
ramox81 ec723fb97b Match MEASURE marker placement behavior 2026-09-11 10:26:09 +03:00
ramox81 18569687a1 Match DIVIDE marker placement behavior 2026-09-11 10:26:08 +03:00
ramox81 376faec4db Add polyline vertex and multiple-object editing 2026-09-11 10:25:12 +03:00
ramox81 f24fdc7965 Implement nested object selection and placement for NCOPY 2026-09-11 10:23:38 +03:00
ramox81 c947e1ce50 Add hatch editing option stages and appearance association workflows 2026-09-11 10:22:55 +03:00