Commit Graph
3954 Commits
Author SHA1 Message Date
yztink ffdde71057 feat(plugin): support analytical GPU preview wires for circles and arcs 2026-09-23 17:19:56 -07:00
yztink d218ec1451 feat(plugin): add CommitMany and CommitManyAndEnd for multi-entity interactive commands 2026-09-23 15:19:33 -07:00
yztink 358103c1e4 feat(plugin): wire on_cursor_move and preview wires through IPC plugin runner 2026-09-23 11:33:37 -07:00
Hakan SevenandClaude Opus 5.5 a479dd11d1 chore: pin cadcodec at dd1d7bf and cadkernel at 6eae7c9
Brings in the DXF round-trip fixes merged as cadcodec #48 and #51 and the
block-definition fixes for cadcodec issues #49 and #52. cadkernel moved to
the same codec revision first, so the graph keeps a single acadrust. The
Python plugin, which is outside the workspace, has its own lock moved too:
its staging script requires the plugin and the host to share one acadrust
source.

The canaries that asserted the old wrong results were flipped against the
real-IPC audits, all 60 of which pass with the plugin built: Helix, Light,
Underlay, ViewBorder and SectionSymbol now round-trip through DXF, as do the
text style flags, the dimension style's text style name, the block
description, the table's merged ranges and the leader's annotation link and
vectors. Those five kinds move to Complete in the coverage ledger.

Two narrower gaps stay pinned. The ATTDEF writer emits no group 280, so
`lock_position` is still lost on a DXF save; every other field now
survives. A true-colour leader `override_color` cannot be held by DXF group
77, which takes an ACI index, and the DWG writer does not store it.

Behaviour change for users: a text style's oblique angle is now written to
DXF in degrees, as the format defines it. DXF files written by earlier
versions carry radians there and reopen with a much smaller slant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-23 17:49:34 +03:00
ramox81andClaude Opus 5.5 a845e45100 ATTACH <file>: start the placement within the same command
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-23 16:22:17 +03:00
ramox81andClaude Opus 5.5 498a97df0f Xref attach: placement preview, relative paths on the first save, no-match messages
The reference follows the cursor while its insertion point, scale or
rotation is asked (preview-only PScale/PX/PY/PZ/PRotate included); a
relative path chosen before the drawing had a file becomes relative on the
first save, and relative paths start from "./" at or below the drawing's
folder; -XREF name options report "No matching xref names found.".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-23 15:34:06 +03:00
ramox81andClaude Opus 5.5 6bcfef5f25 New drawings use metre insertion units, as the reference's new drawing
A new drawing already follows the reference's metric template
(MEASUREMENT 1, ISO-25); its insertion units were millimetres while the
reference's new drawing uses metres (INSUNITS 6). Blocks and references
inserted into a new drawing now convert with the same factor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-23 15:10:55 +03:00
ramox81andClaude Opus 5.5 6bd55bc32e Xref attach: Attach dialog, reference prompts, and xref drawings other applications can open
Attach External Reference dialog after XATTACH / ATTACH; ATTACH routes
drawings, PDFs and images; placement prompts and messages follow the
reference (presets, Corner/XYZ, nonzero check, existing definition reuse,
missing file, self-reference); name keeps the file's case; overlay and
path type at attach; one undo step for definition and INSERT; -XREF option
prompt and `?` table; XREF opens the palette; ER alias; xref Properties
rows; dependent symbols flagged and remapped and resolved content left out
of the saved file; dialog_ok automation action; localized labels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-23 14:44:12 +03:00
Hakan SevenandClaude Opus 5.5 f2d534bf71 fix: review fixes for the Aligned 2Lines placement and DCCONVERT
The 2Lines placement (#1459) wrote the second line's new ends back with
`set_resolved_point`, which was not the inverse of the `resolve_point` it
paired with. `resolve_point` reads polyline vertices in WCS through the
polyline's OCS; the writer put that world point straight into the OCS
vertex, so a mirrored polyline (normal -Z, common in real drawings) had
its vertex flipped, and the closing segment's end marker — which names
vertex 0 on a closed polyline — found no vertex and the placement was
silently dropped. The writer now converts back into the OCS, keeps the
polyline's own elevation, and wraps the closing marker the same way.

The same arm pushed `test_pline_line_then_arc` past the default test
thread's stack: its locals, a cloned entity among them, sat in the frame
of the command-result dispatcher, which is on the stack of every click.
The placement is built out of line and handed over boxed.

Merging #1447 had left nothing setting DIMCONSTRAINT's default to
Diameter; the Dispatch arm #1461 turned into a match now covers it with
Radius and Convert. DCCONVERT's result lines go through the translation
macros.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-23 13:00:28 +03:00
Hakan Seven 1ec2f554a9 Merge pull request #1461 from ramox81:codex/convert-constraint-parity 2026-09-23 12:43:59 +03:00
Hakan Seven 3dc373659a Merge pull request #1459 from ramox81:codex/aligned-two-lines-placement 2026-09-23 12:43:58 +03:00
Hakan Seven 8f9d8cc997 Merge pull request #1458 from ramox81:codex/angular-dynamic-properties-title 2026-09-23 12:43:57 +03:00
yztink 5eda52626e feat(plugin): add on_cursor_move and PreviewWire for interactive rubber-band previews 2026-09-23 02:03:16 -07:00
ramox81andClaude Opus 5 6d36356529 Convert: turn associative dimensions into dimensional constraints
The command deleted the dimension and left a literal constraint behind. The
reference keeps the dimension, drives it with a new parameter and gathers
only associative dimensions, saying how many objects it dropped.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-23 11:30:18 +03:00
Luis Martinez 31711a4134 Harden missing font prompts for MCP sessions 2026-09-23 01:30:42 -06:00
ramox81andClaude Opus 5 48b8689fc3 Aligned 2Lines: place the second line where the reference leaves it
The second line kept its midpoint and turned around it, so it settled at a
different offset than the reference, which keeps the line's start along the
first line and moves it to the distance the picked point had from it.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-23 09:47:56 +03:00
ramox81andClaude Opus 5 207ad6e412 Properties: name a dynamic angular constraint after its dimension
The panel titled the dynamic form "Angular Dimensional Constraint"; the
reference names it after the dimension kind with the form in parentheses.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-23 09:47:35 +03:00
Luis Martinez 571dbc6847 Isolate plot previews from unit test desktop 2026-09-22 19:37:27 -06:00
Luis Martinez 464b0ec963 Fix PSETUPIN save test on Windows paths 2026-09-22 18:53:49 -06:00
Karim Jerbi 133bfddba9 chore(perf): profile frame pipeline CPU side
Adds ui_selection_overlay bench (benches/performance_benchmarks.rs + README metric 31): builds a representative selection overlay element (snap, crosshair, UCS tripod, 128 grips quick / 4096 capped full) and times widget-tree construction. Measured 0.4us typical, 2.4us at the cap (threshold 50us).

Adds ribbon/statusbar section marks to the chrome bucket in view_main (src/app/view/mod.rs) so live PERF=1 view-detail traces attribute those two costs separately. Gated on the existing perf switch; no-op otherwise.

Adds pub re-exports of CursorType/IsoPlane (src/app/mod.rs) for the bench fixture (same pattern as the existing grip re-exports).

Ranked result over all ui_* benches: ribbon view construction ~556us (largest; follow-up already tracked), everything else under 50us or synthetic-fixture shapes. No new follow-up filed. GPU and canvas-draw costs are unmeasurable in headless runs (view() never executes there).
2026-09-22 22:29:00 +01:00
Hakan Seven 0f02a74eb1 Merge origin/main 2026-09-22 23:26:44 +03:00
Hakan SevenandClaude Opus 5 41ecc0c458 Merge pull request #1423 from felixriestra:pr/python-host-model
The bundled `opencad.python` plugin drives OCS through plugin API v7: all
43 canvas entity kinds, the drawing tables, and OCS's own commands run
step by step. RustPython stays in the plugin process — the plugin crate is
outside the workspace with its own lock file, so the application's own
dependencies are unchanged.

Reconciled with the plugin command work that landed as #1425, which the
branch was written before:

- Both added `impl Drop for PluginProcessInteractiveAdapter`, which git
  merges silently into two impls that do not compile. One body now
  cancels the command and then drops it from the runner, in that order: a
  plugin waiting on a step has to be released before the runner forgets
  the command.
- `execute_command` (#1425) and `run_command` (#1423) are both routes from
  a script to the command line, and only the second was guarded. The
  SCRIPTCOMMANDS switch and the denylist are shared now, so neither route
  is the unguarded one.
- `run_command` dispatched with plugin dispatch still enabled, so a script
  naming a plugin command re-entered the plugin that was blocked waiting
  for it. It sets the suppression flag for the length of the dispatch, as
  `execute_command` does.

The denylist read the command as typed, while the dispatcher resolves
aliases: a user-defined `Q` for `QUIT` (ALIASEDIT writes those) walked
past it. It resolves the alias first.

Also: the active-command comparison ran on every message, a mouse move
included, allocating two strings for names that are already `&'static
str`; SCRIPTCOMMANDS' own messages go through the translation macros; and
`docs/.DS_Store` (now ignored) and an unrelated RTF note about constraint
commands are out of the tree.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-22 23:26:30 +03:00
Karim Jerbi 02f4ca0cf7 fix(grips): XLINE/RAY direction grip uses stretch semantics, not move
The direction handle was built with center_grip (is_midpoint), so drags
arrived as Translate, which the direction arm ignores — the grip engaged
but silently did nothing. Build it with square_grip (same marker) so the
drag arrives as Absolute and repoints the line.

Tests:
- xline_direction_grip_drag_changes_direction: press, drag, direction is +X
2026-09-22 20:41:35 +01:00
Karim Jerbi 9264559fd3 fix(boundary): clip unbounded sources in associative hatch refresh path
Same unit-stub defect as the BOUNDARY tool fix: entity_boundary_source_on_plane
tessellated rays/XLINEs to a single base-point stub. Now takes clip bounds
derived from the full source map, sharing segments_bounds and
live_segments_for_curves instead of duplicating the logic.

Tests:
- xline_source_clips_to_given_bounds: clipped to the box, not the stub
2026-09-22 20:41:35 +01:00
Karim Jerbi 652f4d6bbc feat(blocks): implement Block Definition dialog (BLOCK/BMAKE) with on-screen sequencing
Implement the complete Block Definition dialog window launched via BLOCK
and BMAKE commands, featuring standard CAD layout, workflows, and entity
creation pipelines.

- Dialog UI & Layout:
  - 2-column compact CAD grid with synchronized vertical heights (580 × 390px).
  - Editable combobox with existing block names, invalid character validation,
    and inline redefinition badge.
  - Multi-line text editor widget for block descriptions (replacing single-line input).
  - Quick Select (QSELECT) button integration restoring dialog state upon completion.
  - Confirmation guard when attempting to redefine an existing block definition.
  - Centered radio buttons, clean coordinate inputs, and accessible keyboard shortcuts.

- Base Point & On-Screen Workflow:
  - BlockOnScreenCommand strictly enforces prompt sequencing: Base point is
    prompted before object selection.
  - Dynamically recalculates world_to_block and block_to_world affine transforms
    when base point is specified on-screen, preventing stale (0,0,0) normalization.
  - Supports Retain, Convert to block (INSERT placement), and Delete modes.

- Explode Enforcement:
  - Guarded EXPLODE command to prevent decomposing blocks flagged as non-explodable.

- Dynamic Themed Icons:
  - Added pick_point.svg, select_objects.svg, quick_select.svg, and warning_triangle.svg.
  - Routed all icons through the semantic theming engine so line work (#B4B6B9)
    and accents (#6DB7ED) adapt automatically to the active theme.

- Tests:
  - Added unit tests for retain/convert/delete modes, redefinition, explodable flag,
    on-screen base point transform recalculation, and command sequencing.
2026-09-22 17:05:15 +01:00
Hakan SevenandClaude Opus 5 889a19c362 Merge pull request #1447 from ramox81:codex/diameter-constraint-parity
#1447 branched from the same commit as #1443 and rewrote the radial
dimensional constraint a second time, so the two designs had to be
reconciled rather than stacked. #1447's is the one kept: it covers
DCRADIUS and DCDIAMETER through one command, places the dimension by the
direction the location was picked in rather than storing a text point,
and names the parameters `radN` / `diaN`. #1443's radial command result,
its entity builder call and its follow-up code are gone; its own
independent work stays — the ribbon's small-button grid and tool
descriptions, the magnitude reading of a negative radius, and the centre
anchor a parameter edit resizes a circle about.

The DIMCONSTRAINT default follows #1443: running DCRADIUS or DCDIAMETER
directly leaves it alone, and the Dispatch arm sets it when DIMCONSTRAINT
is what asked for the command.

The second commit's radial drawing — the dimension line broken around the
text, the elbowed leader, the centre-mark and arrowhead rules — applied to
every radius and diameter dimension, not just a constraint's, and three
layout-parity tests said the old layout was the measured one. It is now
scoped to a dimensional constraint's own dimension, as #1443 scoped its
version, and ordinary radial dimensions draw as they did.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-22 17:51:16 +03:00
ramox81andClaude Opus 5 368aa69f4e Radial dimensions: text on the line, a short leader when it moves out
The text of a radius or diameter constraint sits on its dimension line,
which breaks around it, and no centre mark is drawn while that line is
there. Text that no longer fits inside moves beside the circle at the end
of a short leader that leaves the rim, elbows and hooks under the text,
with the arrowheads keeping the circle. A dynamic dimension now keeps
only its text at a constant screen size; arrowheads and extension lines
keep the style's size in drawing units.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-22 17:11:09 +03:00
ramox81andClaude Opus 5 19204d1b2c DCDIAMETER/DCRADIUS: the reference flow with a real radial dimension
The commands ask for the circle or arc themselves, report the measured
size, take a dimension line location and then the value or name and
value, creating a radius or diameter dimension as the constraint's
dynamic dimension with a radN/diaN parameter, refusing a second radial
constraint on the same object and any non-positive value.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-22 15:21:11 +03:00
Hakan Seven ed0cf7ba71 Merge pull request #1444 from ramox81:codex/shell-command-selection-crash 2026-09-22 13:51:05 +03:00
Hakan Seven de4387f9dc Merge origin/main 2026-09-22 13:47:03 +03:00
Hakan SevenandClaude Opus 5 4bef410abb fix: review fixes for the metric template and the radial constraint
A new drawing (#1441) recorded ISO-25 as the current dimension style by
name only. Every other place that changes it sets the header's handle as
well, and a DWG carries the current style by handle alone, so a saved new
drawing reopened on Standard. The style's handle now comes back from the
helper that adds it.

A radius constraint (#1443) anchored the circle's centre from the shape of
its references — one whole entity — but a single whole reference is also a
line's length, whose start is what stays. The entity decides now.

The two tests that encoded the replaced rules follow them: a negative
radius validates by its magnitude, as a negative distance already did, and
only zero is refused; a new drawing's dimension text reads at ISO-25's
comma separator.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-22 13:46:49 +03:00
Karim Jerbi 00e102607c fix(dist): respect units settings in DIST measurement output 2026-09-22 11:42:56 +01:00
ramox81andClaude Fable 5.1 99eadd7609 SHELL: do not index an empty selection when the command starts
`bool::then_some` evaluates its argument eagerly, so starting SHELL or
SOLIDEDIT with nothing selected indexed an empty vector and aborted the
application. The single-solid target now comes from a slice match.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 13:40:42 +03:00
Hakan Seven 6605a71fdd Merge pull request #1443 from ramox81:codex/radius-constraint-parity 2026-09-22 13:37:57 +03:00
Hakan Seven 22806e1310 Merge pull request #1441 from ramox81:codex/metric-new-drawing-defaults 2026-09-22 13:37:56 +03:00
Hakan SevenandClaude Opus 5 8fefff5d2b docs: reattach the Properties helper doc comments to their functions
Three doc paragraphs had stacked above one helper, so each described the
function after the one it sits on.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-22 13:37:55 +03:00
Hakan Seven 967d5ec9c2 Merge pull request #1431 from ramox81:codex/angular-constraint-parity (follow-up commits) 2026-09-22 13:36:16 +03:00
Hakan SevenandClaude Opus 5 fcbab57627 fix: review fixes for the merged command-line, plugin and font changes
Direct distance entry (#1429) turned every bare number at a point prompt
into a distance, so ROTATE's angle and the values automation types were
read as coordinates. The step reads the token first now — `feed_command`
reports whether it claimed it — and only an unclaimed one becomes a
distance. That also puts the token back on the unified step driver, which
owns the P / L selection keywords and the dimension-snap bookkeeping, and
stops `on_text_input` running twice for the same token. A tracking ray
carries its own base, so it no longer demands an anchor that the first
point of a command does not have yet.

Plugin command execution (#1425) re-implemented the command line inside
the plugin host: it dispatched families directly, skipping the teardown
that starts a command (grip edits, selection gestures, `last_point`, the
accepted snaps), and made every `CmdResult::Dispatch` in the application
skip plugin dispatch to avoid its own re-entrancy. A scripted line now
runs through `run_command_line`, with the trailing Enter left off while
the plugin streams the command, and the re-entrancy is handled by a flag
set for the length of the plugin's call. A pause parks the line's Enter
with the rest of its tokens instead of dropping it.

A font reference (#1432) tried the family lookup before the face-file
index, and that lookup ends in a prefix match a longer file name loses to
(`ISOCPEUI.TTF` would take `ISOCP`). The exact file answers first.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-22 13:35:25 +03:00
ramox81andClaude Fable 5.1 aab42e2aa9 DCRADIUS: reference radial dimensional constraint with a dynamic radial dimension
Select arc or circle / Dimension text / dimension line location / value or
name prompts with a radN parameter, invalid-selection, miss, duplicate and
invalid-expression messages, negative values as magnitudes, a dynamic radial
dimension on the constraints layer drawn as the reference does (mid-radius
text on the center-to-rim line, no hook, no center mark, one text grip), the
stored text position following the radius, center-anchored resizing, the
Properties title and Constraint section, DIMCONSTRAINT's Radius default,
the small-button Dimensional ribbon grid and tooltip descriptions.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 13:09:47 +03:00
ramox81andClaude Fable 5.1 64c020293a Annotative choice: use the crate translation macro
Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 12:51:57 +03:00
ramox81andClaude Fable 5.1 bdcd24179b Annotative as a Yes/No list in Properties
The Annotative row of text, MText, blocks, leaders, hatches and
dimensions is a Yes/No list, as the reference shows it; choosing a value
drives the same per-object annotative toggle as before.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 12:49:28 +03:00
ramox81andClaude Fable 5.1 8820437fa4 Metric new drawings with the ISO-25 dimension style current
A new drawing is metric (measurement 1, millimetre insertion units) and
carries the reference's ISO-25 dimension style as its current style, so
dimensions and annotational constraints draw at readable metric sizes
instead of Standard's imperial 0.18 text.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 12:29:38 +03:00
ramox81andClaude Fable 5.1 8b3c24927d Properties titles for angular dimensions
An angular dimension is titled `Angular Dimension` and a three-point
one `3 Point Angular Dimension`, as the reference names them.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 12:28:31 +03:00
Hakan Seven 0cbaf18551 Merge pull request #1425 from yztink:feat/plugin-run-command 2026-09-22 12:28:09 +03:00
Hakan Seven d37ce4d617 Merge pull request #1431 from ramox81:codex/angular-constraint-parity 2026-09-22 12:28:04 +03:00
Hakan Seven ba8d828c3e Merge pull request #1424 from swit33:feat/trackpad-pan-pinch 2026-09-22 12:28:03 +03:00
Hakan Seven 925146134a Merge pull request #1429 from yztink:fix/direct-distance-entry-no-dyn 2026-09-22 12:28:02 +03:00
Hakan Seven 5719fcc86f Merge pull request #1430 from yztink:fix/viewcube-visibility 2026-09-22 12:28:01 +03:00
Hakan Seven 4a8f8af36c Merge pull request #1432 from swit33:fix/text-fallback-empty-outline 2026-09-22 12:27:59 +03:00
ramox81andClaude Fable 5.1 2db393155f CCONSTRAINTFORM system variable
Reads and sets the form new dimensional constraints take (0 dynamic,
1 annotational), the same state DCFORM sets.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 12:11:11 +03:00