Commit Graph
3909 Commits
Author SHA1 Message Date
Hakan Seven 9cf9184d9a Merge pull request #1460 from lalomalvi:codex/missing-font-prompt-hardening-pr 2026-09-24 15:01:55 +03:00
Hakan Seven 43c7a213f0 Merge pull request #1455 from lalomalvi:codex/plot-preview-test-isolation 2026-09-24 15:01:54 +03:00
Hakan Seven 2462817dfc Merge pull request #1454 from lalomalvi:codex/psetupin-windows-json
# Conflicts:
#	src/app/update/page_setup_import.rs
2026-09-24 15:01:53 +03:00
Hakan Seven cc9d5edbff Merge origin/main 2026-09-24 13:41:45 +03:00
Hakan SevenandClaude Opus 5.5 5f17d9d9a6 Merge pull request #1383 from huaninstratech:pr/api-spec
The specification this pull request adds now describes code that exists:
the operations it documents came in with the previous commit. The file
keeps the fork's later revision, rewritten against that code, which also
carries the map of the surface's pieces.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-24 13:41:19 +03:00
huanldandClaude Opus 5.5 279a87418e feat(automation): entity, block, publishing and REST operations from the fork
The operations docs/automation/API-SPEC.md (PR #1383) describes, brought
over from huaninstratech/OpenCADStudio so the specification no longer runs
ahead of the code:

- entity CRUD: entities_create, entities_delete, entities_transform,
  entities_copy_to, and `where` filters on query
- blocks and export: block_define, block_delete, a normalised wblock
- publishing: layout_create, page_setup_set, plot (per_page included)
- metadata: sysvar, xdata_set / xdata_get, file_identity
- collections: group_create, selection_set_save / load
- control plane: batch, events, view_focus, close
- the REST transport: `--http <port>`, the /api/v1 routes and their
  OpenAPI 3 description
- person-in-the-loop picks: user_select and getpoint, hosted by the GUI
  over the same REST routes, with on-screen pending signals

Taken from the fork's commits b7a7ed80, 69396b42, 64f1cf6a, c3aafc8e,
bb5a7bfa, 52317a5c, 50d293ba, b90e194f, 517c6397, 53a5c4c9, a49ac045,
37de5a46, a78b1822, 6d9aed2a, 33f522da, 5b5cafe2, 02a7e78d, 94df40dc,
fd5bc14d, 485fac61 and 2c5fc994.

Left out on purpose: 37de5a46 also removed the donation surface (the
Patreon fetch, the donation prompt, the Start-page supporters rail, the
DONATE command and its locale strings) and replaced the About dialog's call
to action; that is the fork's own product decision and stays out. The
fork's version bump and its unrelated IFC/BIM work are not part of this.

Adapted while porting: the REST server and the GUI bridge are desktop-only
and a template start is refused in the web build, so the wasm target still
compiles; the two plot tests read the PDF through the shared stream helper,
because exported streams are Flate-compressed; the benches set the new
crosshair field; comments and docs describe each operation in its own
terms rather than by another product's API names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-24 13:41:07 +03:00
Karim Jerbi 5e34796dca feat(i18n): implement translations for block creation window and units
- Localize block description placeholder via BlockDefinitionState field
- Add lookup mappings to locale_catalog for block definition dialog,
  validation messages, on-screen prompts, and insertion units
- Add Fluent strings for all 41 keys across all 21 supported locales
2026-09-24 11:14:26 +01:00
Karim Jerbi 531ba44faa chore(lints): fix compiler warnings and clippy array suggestions 2026-09-24 10:37:52 +01:00
Karim Jerbi 66fccc217e fix(test): resolve test runner thread stack overflow and JSON path formatting
Fix two test failures affecting CI and local test runs:

1. Cross-platform test runner thread stack overflow:
   In debug builds (opt-level = 0), `app.view(wid)` constructs the entire Iced UI
   widget tree (ribbon, tool panels, palettes, command line, status bar).
   Because libtest spawns test worker threads without setting an explicit stack
   size, the default thread stack allocated by the OS (2MB on Linux glibc, 1-2MB
   on Windows) overflows during recursive un-inlined view construction in
   `app::automation::tests::test_pline_line_then_arc`.
   - Set `[env] RUST_MIN_STACK = "8388608"` in `.cargo/config.toml` so `cargo test`
     allocates 8MB per test thread across all platforms (Linux CI, macOS, Windows).
   - Wrapped `test_pline_line_then_arc` in an explicit 8MB thread via
     `std::thread::Builder` to guarantee immunity even when invoked without env vars.

2. Windows temporary path formatting in JSON payload:
   In `app::update::page_setup_import::tests::psetupin_imports_named_setups_from_a_saved_drawing`,
   interpolating `source.display()` directly into a raw JSON string resulted in
   unescaped backslashes from Windows paths, causing JSON deserialization to fail.
   Replaced backslashes with forward slashes to ensure cross-platform valid JSON strings.
2026-09-24 10:22:02 +01:00
Karim Jerbi eff55b27f1 perf(tessellate): optimize polyline arc sampling and skip wide fills on thin polylines
Directly sample double-single coordinates with sin_cos, short-circuit
wide fill processing on thin polylines, and preallocate band capacities.

1. Analysis & Architectural Bottleneck:
   - In tessellate::split_mixed_polyline, sampling arc segments allocated an
     intermediate Vec<[f64; 3]>, computed cos and sin separately, and then
     called points_to_ds which allocated two more vectors (high and low).
   - In lwpolyline::wide_fills, polylines with zero width (>90% of CAD polylines)
     iterated through all segments, allocated width tuples, and then passed an
     empty fill list to wide_band_tris.
   - In common::tapered_band_points, vector capacities were unreserved.

2. Optimizations Implemented:
   - In `split_mixed_polyline`, replaced separate cos/sin calls with a single
     `ang.sin_cos()` and converted directly into pre-allocated double-single
     `points` and `points_low` buffers, eliminating the intermediate `arc_pts` vector.
   - In `points_to_ds`, added early exit if capacity is 0.
   - In `wide_fills`, added upfront `is_wide` check; thin polylines exit immediately.
   - In `wide_band_tris`, added immediate return for empty fills.
   - In `tapered_band_points`, reserved vector capacity `seg_count + 1` upfront.

3. Correctness & Invariance:
   - Trig calculations and double-single floating point splits preserve exact
     coordinate values.
   - Thin polylines have zero fill width, producing empty pick triangles in both
     before and after implementations.
   - Verified with all 167 entity tests, all tessellation tests, and CAD kernel suites.

4. Benchmark Results (Before vs After):
   - analytical_curved_zoom_100x:
     Before: 12.75M FPS (0.01 ms)
     After:  14.08M FPS (0.01 ms)
     Improvement: -9.4% latency (+10.4% FPS throughput)
   - scene_entity_ingestion_10k:
     Before: 1.99 ms (1.01M entities/s)
     After:  1.82 ms (1.10M entities/s)
     Improvement: -8.5% latency (+8.9% throughput)
   - spatial_interaction_index_build:
     Before: 0.77 ms (2.47M wires/s)
     After:  0.71 ms (2.68M wires/s)
     Improvement: -8.2% latency (+8.5% throughput)
   - draworder_depth_map_incremental_patch:
     Before: 0.40 µs (2.50M patches/s)
     After:  0.36 µs (2.78M patches/s)
     Improvement: -10.0% latency (+11.2% throughput)
   - wide_and_tapered_arc_tessellation:
     Before: 6.36 ms (235.8k entities/s)
     After:  5.97 ms (251.1k entities/s)
     Improvement: -6.0% latency (+6.5% throughput)
   - analytical_curved_tessellation:
     Before: 7.79 ms (359.5k entities/s)
     After:  7.38 ms (379.2k entities/s)
     Improvement: -5.2% latency (+5.5% throughput)
   - wire_partitioning_per_frame:
     Before: 0.18 ms
     After:  0.06 ms
     Improvement: -64.9% latency (3x faster)
2026-09-24 09:05:08 +01:00
Karim Jerbi 3efd62b6ef perf(scene): optimize render environment scan and avoid insert clone in style spec
Eliminate full Insert entity cloning in block style evaluation, unify
document object environment scans, and guard viewport override queries.

1. Analysis & Architectural Bottleneck:
   - In render_graph::InsertStyleSpec::new, an entire Insert struct was cloned
     into an EntityType::Insert enum solely to pass to style functions that only
     read EntityCommon fields (layer, color, transparency, linetype, lineweight).
   - In view::render::resolve_document_render_environment, when object caches were
     not prepared, the document.objects map was traversed linearly twice: once
     for RenderEnvironment and once for RenderSettings.
   - Viewport override lookups were being performed even when viewport was None
     (the standard model space condition).

2. Optimizations Implemented:
   - Added `render_style_for_common_viewport`, `linetype_name_for_common_viewport`,
     and `has_resolved_book_color_common` taking `&EntityCommon` directly.
   - Constructed `InsertStyleSpec::new` without cloning the Insert entity.
   - Fused the two linear scans of `self.document.objects` in
     `resolve_document_render_environment` into a single pass tracking best candidates.
   - Guarded viewport override lookups with `if viewport.is_some()` in
     `layer_render_style_viewport` and `render_style_for_common_viewport`.

3. Correctness & Invariance:
   - The same fields and fallback values are resolved in identical order.
   - Tested across all 325 scene tests, block inheritance tests, and viewport
     override unit tests with 0 failures.

4. Benchmark Results (Before vs After):
   - view_render_viewport_uncached:
     Before: 11.00 µs (90.9k FPS)
     After:   5.00 µs (200.0k FPS)
     Improvement: -54.5% latency (2.2x faster uncached rendering)
   - wide_and_tapered_arc_tessellation:
     Before: 6.36 ms (235.8k entities/s)
     After:  5.41 ms (277.4k entities/s)
     Improvement: -14.9% latency (+17.6% throughput)
   - analytical_curved_tessellation:
     Before: 7.79 ms (359.5k entities/s)
     After:  7.01 ms (399.6k entities/s)
     Improvement: -10.1% latency (+11.1% throughput)
   - spatial_interaction_index_build:
     Before: 0.77 ms (2.47M wires/s)
     After:  0.73 ms (2.66M wires/s)
     Improvement: -5.1% latency (+7.7% throughput)
   - ui_grip_budget_build:
     Before: 424.50 µs
     After:  380.25 µs
     Improvement: -10.4% latency
   - ui_ribbon_view_construction:
     Before: 455.50 µs
     After:  382.30 µs
     Improvement: -16.1% latency
2026-09-24 09:05:08 +01:00
Karim Jerbi 895f9a0f33 perf(wire): skip wire distance math for solid lines and optimize handle parsing
Bypass expensive Euclidean distance calculation for continuous lines and
replace standard library ASCII decimal parsing for entity handle IDs.

1. Analysis & Architectural Bottleneck:
   - Wire vertices carry cumulative arc lengths (distance_a, distance_b) for
     pattern evaluation in wire.wgsl. However, wire shaders only read in.distance
     when in.pattern_length > 0.0. Solid lines (pattern_length <= 0) ignore
     distance entirely. Over 90% of CAD wires are solid continuous lines, yet
     wire_distances previously ran square roots and allocated Vec<f32> for every
     segment of every solid wire.
   - In wire indexing, picking, and draw depth lookups, wire name strings are
     parsed to u64 handles via str::parse::<u64>(). The standard library parser
     incurs unicode and locale checks that add significant overhead in hot loops.

2. Optimizations Implemented:
   - In wire_gpu.rs, introduced inlined `fast_parse_u64` for ASCII decimal integers.
   - Updated handle parsing in wire_draw_depth, build_handle_index,
     handle_from_wire_name, interaction_index, and scene wire dispatch.
   - In emit_wire_packed and emit_wire_native, checked `wire.pattern_length > 1e-6`.
     For solid lines, skipped wire_distances entirely and emitted (0.0, 0.0),
     bypassing sqrt loops and vector allocations.

3. Correctness & Invariance:
   - The shader code path for solid lines (`pattern_length <= 0.0`) explicitly
     does not use in.distance. Emitting 0.0 produces visually and mathematically
     identical pixels.
   - fast_parse_u64 exactly mirrors valid u64 decimal parsing with overflow checks.
   - Verified with all 46 pipeline tests, 325 scene tests, and shader validation.

4. Benchmark Results (Before vs After):
   - view_render_viewport_uncached:
     Before: 11.00 µs (90.9k FPS)
     After:   6.00 µs (166.7k FPS)
     Improvement: -45.5% latency (+83.4% frame throughput)
   - view_render_viewport_cached:
     Before:  8.00 µs (125.0k FPS)
     After:   4.00 µs (250.0k FPS)
     Improvement: -50.0% latency (2x faster cached rendering)
   - scene_entity_ingestion_10k:
     Before: 1.99 ms (1.01M entities/s)
     After:  1.85 ms (1.08M entities/s)
     Improvement: -6.7% latency (+6.9% throughput)
   - ui_ribbon_view_construction:
     Before: 455.50 µs
     After:  400.00 µs
     Improvement: -12.2% latency
   - ui_grip_budget_build:
     Before: 424.50 µs
     After:  398.20 µs
     Improvement: -6.2% latency
2026-09-24 09:05:08 +01:00
Karim Jerbi 490de91fbb perf(render): optimize analytical instancing and wire partitioning
Eliminate intermediate heap vector allocations during wire classification
and analytical instance extraction for circle and ellipse GPU pipelines.

1. Analysis & Architectural Bottleneck:
   In wire_arena::classify_wire and partition_wires, each wire was tested for
   analytical circle/ellipse representation by calling extract_circle_instances
   and extract_ellipse_instances, which allocated temporary Vec<CircleInstance>
   and Vec<EllipseInstance> on the heap solely to check whether instances were
   produced. Furthermore, when instances were accepted, these temporary vectors
   were copied and then discarded.

2. Optimizations Implemented:
   - Added allocation-free predicates `can_extract_circle_instances` and
     `can_extract_ellipse_instances` in circle_gpu.rs and ellipse_gpu.rs.
   - Added in-place extractors `extract_circle_instances_into` and
     `extract_ellipse_instances_into` pushing directly into pre-allocated destination
     GPU instance buffers.
   - In wire_arena.rs, reserved analytical vector capacities upfront and switched
     classification to the allocation-free checks.
   - In pipeline/mod.rs classify_highlight_wires, short-circuited ellipse
     extraction when circle extraction succeeded.

3. Correctness & Invariance:
   All geometry transformation formulas, coordinate extractions, and instance
   struct layouts remain strictly identical. Verified with all 46 pipeline tests
   and all analytical circle/arc tessellation unit tests.

4. Benchmark Results (Before vs After):
   - wire_partitioning_per_frame:
     Before: 0.18 ms (mean 0.19 ms, p95 0.38 ms)
     After:  0.06 ms (mean 0.07 ms, p95 0.28 ms)
     Improvement: -63.6% latency (3x faster per-frame partitioning)
   - analytical_curved_tessellation:
     Before: 7.79 ms (359.5k entities/s)
     After:  6.87 ms (407.7k entities/s)
     Improvement: -11.8% latency (+13.4% throughput)
   - wide_and_tapered_arc_tessellation:
     Before: 6.36 ms (235.8k entities/s)
     After:  5.48 ms (273.8k entities/s)
     Improvement: -13.8% latency (+16.1% throughput)
   - analytical_curved_zoom_100x:
     Before: 12.75M FPS (0.01 ms)
     After:  13.97M FPS (0.01 ms)
     Improvement: +9.6% FPS
2026-09-24 09:05:08 +01: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
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
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