Commit Graph
4092 Commits
Author SHA1 Message Date
Hakan Seven df8ea089d7 Merge pull request #1532 from yztink/fix/ellipse-block-transform
fix(ellipse): accurately transform ellipse and elliptical arcs in blocks and standard transforms
2026-09-29 22:58:23 +03:00
Hakan SevenandClaude Opus 5.5 7ea5c3d459 chore: bump codec 8464e0a, kernel 7dc1e79, graph 2e40a7b (ellipse transform)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 22:58:12 +03:00
Karim Jerbi 77fbb79917 feat(text): native OS spell-checker for text_audit (Windows/macOS/Linux)
Add cross-platform SystemSpeller abstraction with three backends:
- Windows: direct COM vtable calls to ISpellChecker (Win32 Spell API),
  no external crate — uses the same hand-rolled FFI pattern as
  file_association.rs. Handles ALL-CAPS words by also testing lowercase.
- macOS: NSSpellChecker via objc2/objc2-app-kit (already in deps).
- Linux: Hunspell .dic file reader + hunspell CLI pipe fallback.

text_audit gains three new parameters:
  system_spellcheck: true  — activate OS spell-checker
  language: en-US        — BCP-47 language tag (default: OS default)
  suggest: true            — include spelling suggestions

The agent dictionary and system speller work as a layered pipeline:
words matching the agent dictionary are accepted immediately; only
remaining words are forwarded to the OS checker.

Response includes a system_speller object (enabled, available, backend,
language) and an unrecognized_words array with handle, position, and
optional suggestions.

Integration test: text_audit_system_spellcheck_flags_misspelled_words
(20/20 p1_tests pass). Release build verified.
2026-09-29 13:48:27 +01:00
Karim Jerbi 97ea84d99a feat(text): add text_audit spell-check and dry-run replacement simulation
- Adds 	ext_audit operation under ocs_read, control bridge, and headless server
- Implements pairs / dry_run_pairs simulation returning diffs, coordinates, and unmatched queries
- Implements check_terms suspect matching and dictionary vocabulary verification
- Adds dry_run: true to 	ext_replace to preview modifications without mutating entities or pushing undo
- Supports bounds, layers, handles, and scope filtering
- Updates MCP tool definitions, schemas, and automation test suites
2026-09-29 13:01:31 +01:00
Karim Jerbi 88169c1d7a feat(mcp): add text_search and text_replace with multiline MText and accent-insensitive matching
- Add text_search (read) and text_replace (mutating) operations to control bridge, automation, and MCP
- Support single and batch find/replace pairs under atomic undo transactions
- Safely parse and preserve MText formatting tags, inline fonts, colors, and margins
- Add flexible multiline MText matching and replacement across paragraph breaks (\n <-> \P)
- Add accent/diacritic-insensitive matching across Unicode and ASCII character sets
- Support Windows-1252 / ISO-8859-1 code decoding (%%nnn), DXF Unicode escapes (\U+XXXX), and special character codes
- Expose ignore_accents parameter across ocs_read and ocs_execute MCP tool schemas
2026-09-29 12:42:00 +01:00
Hakan SevenandClaude Opus 5.5 ea91315ba8 fix(layers): turning layers on no longer re-places associative dimensions
Layer, text-style, dimension-style and object-style invalidation bumped
every dependent entity as Modified, which also re-resolved associative
dimensions, centre marks and hatches and re-ran the parametric solve.
A dimension whose association disagrees with its own points (as older
saves can) jumped its dimension line on LAYON. A restyle moves no
geometry, so it now refreshes display only.

Fixes #1536

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 14:16:07 +03:00
Hakan SevenandClaude Opus 5.5 e682f29ce6 fix(render): block text no longer hides behind its own background box
Inside a block, text-bearing and wide wires got their child rank as a
depth override, but fill-only wires stayed at the bare insert level. A
dimension's baked MTEXT with a DIMTFILL background therefore drew its
box in front of its own text whenever the text's rank fell below zero:
cyan boxes with no numbers. Fill-only wires now take the rank as well,
so a background ties with its text and the text pass wins.

Refs #774

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 14:01:56 +03:00
Hakan SevenandClaude Opus 5.5 07f25f4bca fix(grips): a grip lands on the snap marker it shows
While a grip drags, the edited entity is hidden from snapping and its
drag-start shape got a reference-only pass: the marker appeared on the
old edge's midpoint or corner, but the grip stayed at the raw cursor,
and the pass ran only with object snap tracking on. The reference pass
now always runs, still limited to discrete points (never nearest-style,
so the point cannot be pulled back onto the old shape) and skipping the
grip's own start point, and when no snap on the rest of the drawing wins
it places the grip too.

Fixes #1528

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 09:12:31 +03:00
Hakan SevenandClaude Opus 5.5 80372abf2c fix(render): transparency toggle also governs hatches, text and fills
Only the wire shaders read transparency_enable; hatch (solid, gradient
and pattern), text and 3D/fill-triangle fragments always drew the
entity's alpha, so turning Show Transparency off left them see-through.

Fixes #1529

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 09:09:42 +03:00
Hakan SevenandClaude Opus 5.5 5e8b86df65 chore: bump kernel 52a9ebe, graph 597c8b8 (sphere booleans)
Booleans now cut a sphere wherever the other solid crosses it — box
edges and corners, planes through its centre, another sphere, a
cylinder on its axis — instead of refusing or keeping the wrong piece.
Reported in discussion #1499.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 08:07:59 +03:00
Hakan SevenandClaude Opus 5.5 60f35e2b1d fix(color): only colour 7 swaps with the background; true colours draw as authored
Every near-white colour turned black on a light background (and near-black
white on a dark one), including true colours. A 255,255,255 solid used as a
white mask became a black block. Now only colour 7 swaps: true colours and
ACI 255 resolve a hair off pure white/black and keep their value on screen
and in plots.

Discussion #1500

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 06:16:18 +03:00
Hakan SevenandClaude Opus 5.5 ac2a1e1166 fix(lock): other applications can open a drawing read-only while OCS edits it
On Windows the drawing was held with an exclusive byte lock, which also
refuses reads, so AutoCAD / BricsCAD could not open it at all. The lease
now reads through a handle that shares reads but refuses write opens, with
a shared lock that refuses writes; the sidecar still keeps a second OCS
session out. Unix keeps its advisory lock, which never blocked readers.

Discussion #1416, issue #739

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 06:03:54 +03:00
yztink a35fc949f3 fix(ellipse): accurately transform ellipse and elliptical arcs in blocks and standard transforms
- Add transform_ellipse_geometry helper in scene::view::transform to compute exact principal semi-axes, normal, ratio, and shifted arc parameters under any affine transform (negative scales, reflections, negative rotations, non-uniform scaling, and translations).
- Use transform_ellipse_geometry in block_cache::transform_tangent for TangentGeom::PlanarEllipse so GPU analytical instances and curve endpoints match true WCS positions.
- Update entities::ellipse::apply_transform to use transform_ellipse_geometry for complete scaling, rotation, mirroring, and affine transformations.
- Clean up tangent parameters in to_render for Ellipse so start_param and end_param are consistently unwrapped.
- Add comprehensive unit tests in transform.rs, block_cache.rs, and ellipse.rs verifying negative rotations, negative scales, and distant origins.
2026-09-28 16:09:41 -07:00
Hakan SevenandClaude Opus 5.5 0a3dab12e3 fix(parametric): constraint point picks snap to endpoints and midpoints again
Entity picks switch object snap off, but COINCIDENT (and the other
constraints that take a point) only recognise a point when the pick lands
exactly on it. Without snap there were no point markers and every pick
became the whole curve. Point-accepting entity picks now keep object snap
and hand the snapped point to the command.

Discussion #1526

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 23:25:13 +03:00
Hakan SevenandClaude Opus 5.5 f8db262577 fix(blocks): palette insertion starts like a typed INSERT
The palette installed the insert command directly and kept the previous
command's last point, so ORTHO locked the insertion point to an axis
through it. The command-start reset is now a shared helper that the
palette uses too.

Fixes #1525

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 23:02:39 +03:00
Karim Jerbi fdbbcc419e perf(flatten): pre-sized collect/plan and batched entity publish
flatten_plan 2,289 -> 1,098-1,144 us (-50..-52%); flatten_scene_apply 1,213 -> 789-813 us (-33..-35% vs baseline; -28.5% same-session O2-vs-O1, drift-corrected).

Pre-sizes collect/plan vectors and adds Scene::update_entities so FLATTEN issues one geometry bump per batch instead of per entity; single update_entity keeps its exact bump-per-call semantics.
2026-09-28 20:29:40 +01:00
Karim Jerbi f4dfead9c0 test(flatten): add golden, filter, invariant, and differential regression tests
11 tests in tests/flatten_regression.rs: projection goldens (line/circle/polyline3d/polyline2d/text/solid), None cases, locked-layer/selection/space collection filters, plan/apply invariants, legacy-loop differential. Adds 2 ring-depth tests in src/scene/mod.rs pinning update_entities' collapsed block-sentinel delta (legacy 2 vs batch 1, final-state equality).
2026-09-28 20:29:39 +01:00
Karim Jerbi 91900c4e73 bench(flatten): add FLATTEN metrics with extracted helpers
Moves the flatten projection fns and command helpers into modules/draw/modify/flatten.rs (behavior unchanged) and adds flatten_plan / flatten_scene_apply to the COMMANDS suite.
2026-09-28 20:29:39 +01:00
Hakan SevenandClaude Opus 5.5 51d26eb81f fix(plot): XCLIP also clips block hatches plotted through a viewport
Follow-up to 0bfd5dcc:
- A clipped block hatch kept its unclipped plane-local outline, which the
  viewport plot projection prefers, so fills bled past the XCLIP boundary
  on layouts. Rebuild it from the clipped outline.
- insert_spatial_filter / filter_handle run for every INSERT in each
  render walk; resolve the xdictionary through the entity link or the
  document index only, and leave the whole-object scan to set_insert_clip.

Fixes #1508

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 21:28:57 +03:00
Hakan SevenandClaude Opus 5.5 fdfe2429e4 docs(plugins): point to the example plugin repo and the API 4+ fingerprint
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 20:53:51 +03:00
Hakan SevenandClaude Opus 5.5 3754426361 fix(paste): pasted associative hatches follow the pasted boundary
Paste (and WBLOCK, which shares the kernel) kept the source boundary
handles, so the pasted hatch stayed tied to the original outline or to
unrelated handles in another drawing. The COPY remap now lives at the
document level and runs for both.

Refs #1370

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 20:33:54 +03:00
Hakan SevenandClaude Opus 5.5 71b300cc44 feat(plugins): drop plugin API v2
A V2 plugin passed the version gate and then failed silently while
registering its ribbon, since the ribbon wire types have moved on. The
host now loads V3 and newer, so V2 plugins are rejected up front with a
version message. The V2 compatibility fixture crate goes too.

Fixes #1085
Fixes #987

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 20:32:02 +03:00
Hakan SevenandClaude Opus 5.5 c45f22652d fix(dimension): grip menu Above Dim Line places text by the style, not a 1-unit nudge
It moved the text a fixed drawing unit off the line and then another unit
up, wrong at any real scale. It now sets DIMTAD = Above on the dimension
and lets the automatic layout place the text.

Fixes #543

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:44:09 +03:00
Hakan SevenandClaude Opus 5.5 bc13f71882 fix(linetype): DRAINAGE linetypes draw their arrows
The bundled DRAINAGE / DRAINAGE2 definitions use the RIGHT_ARROW shape
from qcadshp.shx, which had no substitute, so they drew as continuous
lines. Add it to the bundled shape set alongside BAT, ZIG and the rest.

Fixes #665

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:37:54 +03:00
Hakan SevenandClaude Opus 5.5 97a5bc1d39 fix(offset): the offset just created can be hovered and offset again
A running command only knew the entities that existed when it started;
committed results are now handed back to it, and OFFSET adds them to its
pick set.

Fixes #673

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:35:19 +03:00
Hakan SevenandClaude Opus 5.5 4c1ddec646 fix(obj): concave OBJ faces are triangulated, not fanned
A fan only covers convex faces; architectural n-gons filled well outside
their outline (the sample's faces covered 63% extra area).

Fixes #680

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:33:40 +03:00
Hakan SevenandClaude Opus 5.5 b66b5100bd fix(annotative): MOVE/ROTATE/SCALE carry every scale representation; copies get their own
Only the displayed annotation context followed a transform, so other
scales reappeared at the old place, and a copied annotative entity other
than a LEADER/MTEXT pair shared the source's context tree.

Fixes #700

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:27:31 +03:00
Hakan SevenandClaude Opus 5.5 746edaa32b feat(explode): MTEXT explodes into single-line TEXT at its laid-out runs
EXPLODE left MTEXT untouched. Each laid-out run becomes a TEXT at its own
baseline origin, height, rotation and width, keeping inline colours.

Fixes #760

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:22:41 +03:00
Hakan SevenandClaude Opus 5.5 d70cc46712 fix(web): STEP export no longer panics; STEP/STL exports download in the browser
The STEP header timestamp used SystemTime, which panics on wasm, and the
exports wrote through std::fs, which the browser does not have.

Fixes #761

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:18:53 +03:00
Hakan SevenandClaude Opus 5.5 5ccaaad48e fix(text): Middle-justified TEXT centres vertically on half its height
Middle (72 = 4) carries a Baseline vertical code, so the baseline landed on
the alignment point and the text sat half a height too high.

Fixes #767

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:16:05 +03:00
Hakan SevenandClaude Opus 5.5 d1a6187678 fix(copy): copied raster images, OLE frames and underlays draw their picture
COPY added the entity without its derived image model, so only the frame
appeared at the copy.

Fixes #829

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:13:45 +03:00
Hakan SevenandClaude Opus 5.5 e9e85010d8 fix(dimension): text colour (DIMCLRT) wins over the layer colour
The synthesised dimension text copied the dimension's ByLayer colour, and
its glyphs take their colour from that entity, so the layer colour showed.

Fixes #898

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:10:33 +03:00
Hakan SevenandClaude Opus 5.5 38fe2b0b08 fix(plot): text and leader background masks plot paper-white, not black
The mask is filled with the canvas colour; plotting carried that dark
colour (or the light-to-black rule) onto the sheet.

Fixes #1072

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 19:01:56 +03:00
Hakan SevenandClaude Opus 5.5 c8c2238d4a fix(wblock): exported drawings carry their block definitions and styles
WBLOCK copied only the entities and their layers, so INSERTs pointed at
missing blocks and the file opened almost empty or needed recovery. It
now goes through the cross-drawing paste kernels, which bring layers,
linetypes, styles, block definitions and baked dimension blocks along.

Fixes #1111

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:56:08 +03:00
Hakan SevenandClaude Opus 5.5 805979ea36 fix(dimension): custom arrow blocks keep their polyline width
The width of a wide polyline lives on the wire as a GPU band, which the
custom-arrow extraction dropped, so the arrow drew as a hairline.

Fixes #1130

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:49:26 +03:00
Hakan SevenandClaude Opus 5.5 a94d1cfd17 fix(input): AltGr and macOS Option characters type into the command line
Windows reports AltGr as Ctrl+Alt, so '@' and similar layout glyphs were
treated as shortcuts and dropped; polar input like @10<45 failed.

Fixes #1236

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:47:17 +03:00
Hakan SevenandClaude Opus 5.5 05502aac63 fix(move): dimensions with a baked block redraw where they were moved
MOVE shifted the *D block contents but left the block cache on the old
epoch, so reopened drawings showed dimensions in place until REGEN.

Fixes #1342

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:45:34 +03:00
Hakan SevenandClaude Opus 5.5 3b2dd8dcb5 fix(plot): top-level hatches plot at their draw-order depth
They went out at depth 0 while lines kept theirs, so some fills
covered lines that DRAWORDER had put on top.

Fixes #1345

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:39:20 +03:00
Hakan SevenandClaude Opus 5.5 1091168196 fix(copy): copied associative hatches follow the copied boundary
The copy kept the source boundary handles, so editing the source
regenerated the copy onto the source outline and it seemed to vanish.

Fixes #1370

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:34:52 +03:00
Hakan SevenandClaude Opus 5.5 c964e365c3 fix(snap): parallel snap keeps its reference, base and lock in f64
The reference direction, base point and locked point went through f32,
so the drawn line drifted off true parallel.

Fixes #1387

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:32:50 +03:00
Hakan SevenandClaude Opus 5.5 399b5b2c95 fix(save): a drawing saved on an SMB share no longer comes out Hidden
The dot-named temp file is stored Hidden by Samba and the attribute
followed it through the replace. Clear it unless the drawing was
already hidden.

Fixes #1414

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:30:27 +03:00
Hakan SevenandClaude Opus 5.5 ac8a9c38db fix(plot): true-color hatch fills plot in their own colour, not black
Fixes #1417

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:29:00 +03:00
Hakan SevenandClaude Opus 5.5 b365e51620 fix(image): new image definitions allocate their own handle so DWG keeps them
The definition took a peeked handle that the image then also received;
the DWG writer dropped the shared-handle definition and reopened images
lost their file.

Fixes #1421

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:24:38 +03:00
Hakan SevenandClaude Opus 5.5 1db1ea0140 fix(fillet): polyline re-fillet replaces the old arc, open ends close, arc segments are not filleted as chords
Fixes #1422

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:18:41 +03:00
Karim Jerbi 0bfd5dcc52 fix(plot): honor XCLIP boundary on block references when plotting
Resolve the SPATIAL filter through extension-dictionary fallbacks
(missing xdictionary handle, DictionaryWithDefault, case/whitespace
tolerant keys) so clipped INSERTs no longer plot unclipped. The
inverse-block matrix is used as stored; the codec decodes the on-disk
column-major layout (fixed upstream).
2026-09-28 16:16:25 +01:00
Hakan SevenandClaude Opus 5.5 a8aa402fb7 chore: bump codec cdf2277, kernel 8fe5928, graph fc936b6 (#1436 image scale)
Fixes #1436

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:16:10 +03:00
Hakan SevenandClaude Opus 5.5 f0526bbe19 chore: bump codec e03eccb, kernel 29e1bec, graph 044998b (#1438 QGIS DXF layouts)
Fixes #1438

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:13:23 +03:00
Hakan SevenandClaude Opus 5.5 e97314cdef fix(pick): overlapping entities resolve to the front-most in draw order
Fixes #1439

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:01:38 +03:00
Hakan SevenandClaude Opus 5.5 bb9e447c64 fix(grip): drop the polar/ortho tracking guide when a grip edit ends
Fixes #1456

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 17:59:07 +03:00
Hakan SevenandClaude Opus 5.5 19c434fc5d fix(snap): perpendicular onto circles/arcs/ellipses uses the exact curve, not tessellation chords
Fixes #1495

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 17:56:01 +03:00