Commit graph

1,086 commits

Author SHA1 Message Date
Hakan Seven
7e70a2a97c feat(window): surface the unsaved-changes prompt on close
A close signal can arrive while the app is backgrounded, leaving the
in-window unsaved-changes prompt unseen behind other windows. Funnel the
prompt opener through gain_focus + a Critical user-attention request so
the window raises (Windows/macOS/X11) or at least flags for attention
(Wayland via xdg_activation). Every unsaved-dialog caller shares this path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 13:40:47 +03:00
Hakan Seven
1ed3315e50 fix(ocs): use Wz in arbitrary-axis algorithm else branch
The OCS arbitrary-axis algorithm crossed the normal with Wx=(1,0,0) in the
else branch, which collapses to zero for an X-aligned normal (e.g.
N=(-1,0,0)): the OCS axes became zero and every point mapped to the
origin. The resulting coincident points fed a NaN truck arc whose
parameter_division never converged, hanging the load on "Parsing
entities". Cross with Wz=(0,0,1) per the DXF spec. (#142)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 13:28:36 +03:00
Hakan Seven
3fc51af41c fix(ribbon): anchor tooltips to the right of their button
Ribbon tooltips were centered below the button, so the cursor resting on
the button covered the tip text. Anchor them to the right instead, clear
of the cursor. (#143)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 11:59:20 +03:00
Hakan Seven
3139a73753 docs(3d): explain pierced-face outer-loop selection
ACIS stores no outer-vs-hole loop flag, so plane_face derives the outer
boundary as the largest-area loop and winds holes opposite. Document why
this is robust: try_attach_plane takes its plane normal from the first
(outer) wire, making the choice self-consistent without relying on the
analytic face normal. No behaviour change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 11:38:03 +03:00
Hakan Seven
249922e8d9 fix(3d): pick pierced face outer loop by area, not list order
A planar ACIS face lists its loops outer-first only by convention; a
pierced wall lists its window holes before the wall edge. plane_face
trusted loops[0] as the outer boundary and oriented every other loop
relative to it, so on a face with two or more holes one real hole wound
the same way as the true outer and truck's winding-number trim filled it
in. Select the outer boundary as the largest-area loop (it encloses the
rest) and wind all others opposite. (#123)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 10:44:52 +03:00
Hakan Seven
36d5891572 fix(layers): freeze toggle in ribbon dropdown + sortable manager columns
Ribbon layer dropdown rows were a single button, so a click on the
visible/freeze/lock icon fell through to the make-active handler instead
of toggling that state. Split the row: each icon is its own toggle
button, only the swatch+label selects the active layer. Toggle handlers
now resync the ribbon so the icon updates while the dropdown stays open.

Layer Manager columns are now sortable: clicking a header sorts by that
column, clicking again flips direction (SVG arrow indicator). Sort is
reapplied on every panel sync so it survives edits, preserves the
selection by name, and keeps the ribbon dropdown order in step.

Fixes #133

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 20:39:09 +03:00
Hakan Seven
caafb9b99d fix(layers): honor layer off/freeze for block sub-entities
Block-internal entities ignored their own layer state: 2D subs were
only filtered by the invisible flag in the block-defn cache, and 3D
solids render through a separate mesh path that applied no layer filter
at all. Both now skip subs on off/frozen layers, matching top-level
entities. Caches rebuild on every toggle, so visibility updates live.

Fixes #133

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 19:57:19 +03:00
Hakan Seven
0dc537b669 chore(release): bump to 0.6.2
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 19:42:27 +03:00
Hakan Seven
93e2d20412 fix(3d): render pierced solid faces with their holes
Build pierced planar faces (a wall with a window opening) as truck faces
with inner hole boundaries: collect every face loop (outer + holes), wind
each hole opposite the outer so try_attach_plane cuts it, and let truck
triangulate. Drop the back-face cull on the solid-mesh pipelines so faces
show regardless of the import's winding (the shader already lights
two-sided). Relies on the acadrust SatLoop next_loop fix that makes hole
loops reachable. (#123)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 15:21:21 +03:00
Hakan Seven
128672186e assets: refresh layer toggle SVG icons
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 14:49:08 +03:00
Hakan Seven
e7eeff5945 feat(select): orange hover / blue selection highlight for all objects
Solids (meshes) now tint on rollover and selection: hover washes orange,
selection washes blue, with selection winning when both apply. Meshes
re-upload their tint when the highlight set changes, and the rollover pick
now also hits shaded solid bodies and hatches (mirroring the click-select
order: wire → hatch → block hatch → solid).

Wires get the same scheme: the selection xray overlay recolours selected
entities blue and the hovered entity orange (previously both blue). Drops
the now-unused highlight_handles union helper and its cache.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 09:33:53 +03:00
Hakan Seven
c6b3975fd4 feat(properties): show entity handle in the General section
Adds a read-only Handle row at the top of the properties palette so an
entity can be identified by handle (e.g. when cross-referencing a file
dump or reporting a specific object).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 01:52:02 +03:00
Hakan Seven
25c347f9b0 feat(3d): instance block-definition solid meshes per INSERT
3D solid meshes inside block definitions were drawn once at block-local
coordinates without the INSERT transform, so a block authored in mm and
placed into a metre drawing at a 0.001 INSERT scale rendered ~1000x too
large. Split solid meshes into top-level (layout-owned, offset and drawn
flat) and block-definition (kept block-local) sets, and emit a transformed
instance of each block-def mesh per model-space INSERT, accumulating nested
transforms. Layout blocks are identified from the Layout objects'
block_record handles, since BlockRecord::is_layout() also flags ordinary
blocks in some files. (#123)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 01:32:17 +03:00
Hakan Seven
2be26e9e2e fix(snap): object snap takes precedence over ortho/polar
When drawing with Ortho (or Polar) on, a point that snapped to an object
(e.g. an Endpoint) was still pulled onto the ortho axis, so you couldn't
close a shape exactly on an existing vertex. Skip the ortho/polar
constraint while an object snap is locked, in both the preview and commit
paths. Grid snap is positional rather than an object snap, so it still
combines with ortho/polar. (#132)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 00:05:41 +03:00
Hakan Seven
7f2aa6178a docs: plan for migrating model tiles to iced pane_grid
Design note for a future migration: motivation, blockers (single-shader
rendering, VPORT rect vs split-tree fidelity, per-pane overlays), a phased
plan starting with a shader-per-pane spike, and the note that pane_grid
does not enable floating viewports.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 23:53:52 +03:00
Hakan Seven
74c8d74a28 feat(ui): add dividers between viewport control chip items
Thin vertical separators between every control in the top-left chip
(split / split / render-mode / grid / snap) for clearer grouping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 23:34:23 +03:00
Hakan Seven
9eb805df23 feat(ui): unified viewport control chip + per-tile grid rendering
Move grid and grid-snap toggles off the status bar (and its customization
menu) into the top-left viewport chip, now a single container holding the
horizontal/vertical split buttons, render-mode picker, and grid/snap
toggles, sized to the render-mode picker. Add grid + magnet (snap) icons.

Render the grid per model tile from each tile's own grid_on, in its own
bounds and camera, instead of a single grid in the active tile. This stops
the grid flickering on/off as the cursor crosses panes or leaves the
viewport, and lets each pane show its own grid independently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 23:29:34 +03:00
Hakan Seven
d4a665a34c feat: per-viewport grid/snap, adopted from the active viewport
Make grid-snap a per-drawing view setting like grid visibility: drop it
from the persisted OSNAP set (settings.txt) and round-trip it through each
viewport's VPort SNAPMODE instead.

Grid display and grid-snap are now stored per model tile (like render
mode), written to and read from each tile's *Active VPort entry. The live
toggles mirror the active tile, and grid/snap are adopted from the active
viewport whenever it changes — on file load, tab switch, model-tile
activation, and new drawing — so they follow the active viewport rather
than a global preference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 22:25:44 +03:00
Hakan Seven
b2feeb716b refactor: make grid visibility per-drawing, not a global setting
Grid on/off now round-trips through the drawing's *Active VPort, so it is a
per-file view setting like every other CAD app treats it. Drop show_grid
from UserSettings (and its settings.txt key) and instead adopt the opened
file's saved grid_on on load. A legacy "grid=" line in an old settings file
is harmlessly ignored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 22:11:27 +03:00
Hakan Seven
cd17096f65 feat(io): persist grid/snap display state to the active VPort
Mirror the in-app grid and grid-snap toggles (plus the adaptive grid
spacing) onto the *Active VPort entries so a saved DWG/DXF reflects what
the user actually has on, instead of always writing VPort defaults. The
flags are stamped when the toggles change and again before a save, and
carried across the camera-sync VPort rebuild so they survive an orbit/pan.

Only grid_on, snap_on and grid_spacing have an OCS counterpart; the other
VPort view fields (view twist, clip planes, lens length, etc.) have no
in-app source and stay at their faithful defaults.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 22:05:25 +03:00
Hakan Seven
aa81d7fe7e fix: bump acadrust to drop the forced VPORT grid in saved DWG/DXF
acadrust's DWG VPORT writer hardcoded grid_on=true, so every file OCS saved
showed a phantom grid in other CAD apps (BricsCAD, DWG TrueView) that was
invisible and unselectable in OCS. The writer now emits the VPort struct's
real grid_on (default false for OCS, which never forced it on), so the
stray grid no longer appears. (#121)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 21:57:50 +03:00
Hakan Seven
02b0fc4dcf chore: drop brand names and orphaned PICK_HIGHLIGHT colours
Neutralise vendor references in comments to plain behavioural descriptions
(object acquisition / object snap). Remove the PICK_HIGHLIGHT and
PICK_HIGHLIGHT_DIM wire colours: their only consumer was the stripped
storm-sewer add-on, and the retained plugin acquisition pathway draws the
ObjectPick snap glyph and per-command hover previews instead, so the
constants are dead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 21:28:07 +03:00
Hakan Seven
5a36494ed7 chore: clear compiler warnings
Remove accidental dead code (unused imports, the superseded paste tool()
helper, a never-read TORIENT handles field, a duplicate let binding, an
unneeded mut) and mark intentional-but-unwired scaffolding with
allow(dead_code): the web-only save_to_bytes, the plugin loadable() probe,
the planned PICK_HIGHLIGHT colours, the DynFieldSpec label, and the layout
ribbon helpers. Native build is now warning-clean apart from the upstream
nom/quick-xml future-incompat notices.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 21:18:09 +03:00
Hakan Seven
23844c137b fix(dim): keep dim line continuous when text sits above/below it
The dim-line break test used text_half + DIMGAP as its vertical
threshold, but DIMTAD 1/4 places the text exactly text_half + DIMGAP off
the line. The two terms cancel at the same DIMSCALE-scaled value, leaving
the comparison on the knife's edge — so a gap flickered into the line
depending on the DIMGAP/DIMSCALE combination. Drop DIMGAP from the
vertical threshold so above/below text stays strictly clear and the line
stays whole; centred text (DIMTAD 0) still breaks for the DIMTFILL
background. The horizontal half-width keeps DIMGAP so a real break clears
the text. (#94)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 21:09:56 +03:00
Hakan Seven
188d310789 feat(pline): create polyline as a live entity so it snaps while drawing
The polyline was only committed to the document on finish, so its partial
geometry produced no snap points — you could not snap to vertices already
placed. Publish it as a real LwPolyline at the second vertex and replace
its geometry in place as later vertices land, so it lives in the document
(and the snapper) throughout the draw.

New CmdResult::CommitLiveEntity / UpdateLiveEntity{finish} plus a
set_live_handle() hook let a command own an entity mid-run. The create
pushes a single undo snapshot; in-place updates push none, so the whole
object reverts as one unit. Updates preserve the entity's handle and
layer (a fresh built entity carries a NULL handle that would desync it
from the document map key and drop it from rendering). (#119)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 21:02:50 +03:00
Hakan Seven
cdd72c62ca fix(dyn): keep angle input box clear of the snap point near 0°
The DYN angle box was placed at full cursor radius along the mid-angle
direction. With a near-zero sweep that direction collapses onto the
cursor ray, planting the box on top of the cursor / snap point and
hiding it. Pull the box back along the ray and offset it to the side
opposite the distance box so the snap point stays visible. (#124)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 20:45:04 +03:00
Karim Jerbi
02f70ab0b3 fix(editor): prevent empty text commit from advancing command edit_count
- Propagates commit status out of inline editors so commands know whether a real change occurred.

- Fixes TEXTEDIT's Undo step rolling back unrelated document actions when the user presses OK on empty/cleared existing MText.
2026-06-18 17:55:30 +01:00
Karim Jerbi
8e48bf02a0 fix(annotate): correctly resolve Leader annotations in TEXTEDIT
- Custom recursive resolver ensures Leader entities trace back to their editable Text/MText annotations.

- Bypasses overly strict baseline field checks so TEXTEDIT can natively target and launch the inline editor on Leaders.
2026-06-18 17:49:29 +01:00
Karim Jerbi
9a258f29ce feat: implement TEXTEDIT command and TEXTEDITMODE system variable
- Adds TEXTEDIT command to seamlessly edit annotation objects in-place.
- Matches industry-standard CAD tools' prompt behavior and "Current settings" banner logic.
- Implements the TEXTEDITMODE system variable (0/1) for Multiple vs Single editing modes.
- Enhances command lifecycle with CmdResult::SuspendForTextEdit and post_editor_closed hooks, allowing commands to cleanly pause and resume after external UI editors close.
2026-06-18 15:56:27 +01:00
Hakan Seven
4d8ea95974 chore(release): bump to 0.6.1
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 16:37:27 +03:00
Hakan Seven
e1d128c4dc fix(snap): priority-based osnap selection + true perpendicular
Object snaps were chosen purely by nearest screen distance, so the
"continuous" snaps that sit on the geometry (Nearest, Perpendicular)
were almost always closer than a discrete Endpoint/Midpoint/Center and
silently suppressed every other enabled snap. Selection is now
priority-then-distance: a higher-priority snap inside the aperture wins,
distance only breaks ties within a priority. (#118)

The aperture gate is `!(d2 < radius2)` rather than `d2 >= radius2` so a
NaN distance from degenerate geometry is rejected instead of passing the
gate and being chosen on rank alone (which fed a NaN point to the fill
tessellator and panicked).

Perpendicular now drops its foot from the command's drawing origin
(`Snapper::from_point`, set before each snap) instead of the cursor, so
the new segment is genuinely perpendicular to the target line rather than
just the nearest point on it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 16:30:37 +03:00
Hakan Seven
47f74a9b98 feat(clipboard): paste menu with paste-to-original and paste-as-block
Turn the ribbon Clipboard "Paste" button into a dropdown:
- Paste — existing pick-a-point paste.
- Paste to Original Coordinates — drops the clipboard at its source
  coordinates with no prompt.
- Paste as Block — wraps the clipboard contents in a new block definition
  and starts an interactive insert (prompts for the drop point, with the
  geometry rubber-banding under the cursor).

Also fixes two bugs the new commands exposed:
- entities_centroid summed the NaN separator points wire models carry,
  so the paste base point came out NaN; non-finite points are now
  skipped. A NaN base previously froze block tessellation outright.
- PASTEORIG added clipboard entities with their original handles
  (duplicates on same-document paste); it now goes through
  add_entity_clone and merges referenced records like the other pastes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 16:09:47 +03:00
Hakan Seven
446430d2b3 fix: regenerate inline sub-entity handles when copying entities
`document.add_entity` only assigns the top-level handle, leaving inline
sub-entities that carry their own — INSERT attributes and 3D-polyline
vertices — with the source's handles. Copying such an entity therefore
produced duplicate handles in the document, which corrupts the saved DWG
so other CAD apps (QCAD, DWG TrueView) refuse to open it.

Add `Scene::add_entity_clone` / `reset_clone_subhandles`, which allocate
fresh handles for the entity and every inline sub-entity, and route all
duplication paths through it: COPY/ARRAY/MIRROR-copy (via copy_entities)
and clipboard paste. (#129)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 14:45:06 +03:00
Hakan Seven
70e73877b2 feat(clipboard): carry referenced records across drawings on paste
Copy/paste between drawings dropped the entities' layer (and linetype /
text + dim style): the clipboard held only the entities, which reference
those records by name, so pasting into a drawing without a matching
record left the entity dangling on a non-existent layer. (#129)

Snapshot the referenced table records from the source drawing at copy
time (ClipboardDeps::capture) and, on paste, recreate any the target
drawing lacks with a fresh handle (merge_clipboard_deps). A record that
already exists by name in the target is left untouched — the target's
own definition wins; only missing ones are imported from the source.
Same-document pastes are unaffected (every record already exists).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 14:34:32 +03:00
Hakan Seven
5ce3aaf260 fix: modal dialogs capture the keyboard
Modals blocked the mouse but not the keyboard: keystrokes from the global
key subscription leaked past an open dialog into the command line and
fired as commands once it closed. Guard `update()` so that while a modal
is open, Escape closes it and every other keystroke-derived message
(command-line input/edit, F-key toggles, edit shortcuts, undo/redo) is
swallowed. A modal's own text fields keep working — they emit their own
messages, which are not in the blocked set. (#126)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 14:00:03 +03:00
Hakan Seven
aafced76d7 fix(web): honor selected DWG/DXF version when saving
The web save path discarded the chosen format version (`let _ = version`)
and `save_to_bytes` never applied it, so every browser download was
written at the document's default version (AC1032 / DWG 2018) regardless
of the format picked in the Save dialog. (#122)

Thread `version` into `save_to_bytes` and set `doc.version` there, the
byte-buffer counterpart to `save_as_version`. Saving as DWG 2013 now
writes an AC1027 file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 13:46:55 +03:00
Hakan Seven
da7905db61 chore: ignore .claude/launch.json (local preview config)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 13:36:35 +03:00
Hakan Seven
bf30e57186 fix(web): force Advanced shaping for dynamic-input canvas text
Dynamic-input value boxes, the prompt pill and the UCS axis labels are
drawn with `frame.fill_text`, whose `canvas::Text` defaults to
`Shaping::Auto`. Auto picks Basic shaping for ASCII-only strings, which
renders on desktop but draws nothing on the web (wgpu/webgl) backend, so
the all-digit distance/coordinate boxes and X/Y/Z labels were blank
(the angle box rendered only because its `°` upgraded it to Advanced).
Typed values landed correctly but were invisible. (#117)

Set `shaping: Advanced` on every canvas fill_text in the overlay.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 13:34:03 +03:00
Hakan Seven
864dd6cef7 fix(web): render UI icons as SVG instead of font glyphs
UI chrome (dropdown carets, undo/redo, checkmarks, close/menu/osnap,
layer/file-menu icons) and ribbon tool icons were drawn as Unicode
glyphs. Desktop fills missing glyphs via system-font fallback, but the
web build bundles only Fira Sans with no fallback, so they rendered as
empty tofu boxes (issue #116).

Add a shared src/ui/icons.rs (SVG-backed, tintable) plus bundled assets,
and switch every glyph site and IconKind::Glyph tool def to SVG.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 12:29:32 +03:00
Hakan Seven
4954551808 chore(release): bump to 0.6.0
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 02:01:34 +03:00
Hakan Seven
8bae517eec feat(automation): local TCP socket transport for --serve
OpenCADStudio --serve --port <N> listens on 127.0.0.1:<N> and serves the
same line-based JSON protocol over the socket (one client at a time; the
document session persists across reconnects), as an alternative to
stdin/stdout. ocs.py grows a port= option to connect either way.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 01:54:03 +03:00
Hakan Seven
d4f5ed3135 feat(automation): richer query geometry + layers/header introspection
query now emits geometry for Ellipse/Text/MText/Polyline/Insert (on top
of Line/Circle/Arc/Point). Add layers op (name, ACI/RGB colour, on/off,
frozen, locked + current layer) and header op (units, PDMODE/PDSIZE,
LTSCALE, annotation scale, current layer/text style). ocs.py gains
layers()/header(). Lets an agent read the drawing's structure and
settings, not just entity counts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 01:50:58 +03:00
Hakan Seven
707c143212 feat(plugin): object-pick acquisition for interactive commands
Extend InteractiveCommand with needs_object_pick / on_object_pick so a
plugin tool can prompt the user to pick an existing entity (handle + point)
rather than a free point — the structure-pick path Storm Sewer's SS_PIPE
needs to connect existing structures. The host adapter delegates to the
internal entity-pick flow; over --serve the pick is fed as a hex handle.
Stays API v2 (no released plugin implements InteractiveCommand yet).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 01:43:53 +03:00
Hakan Seven
f5ac0a90cf
Merge pull request #128 from mf4633/add-storm-sewer-registry
registry: add Storm Sewer plugin
2026-06-17 22:23:41 +03:00
Hakan Seven
931eb908a9 feat(plugin): InteractiveCommand hook for click-to-place (API v2)
Plugins could dispatch commands but not register interactive (click-to-
place) tools — the gap mf4633 flagged on #100 for Storm Sewer's SS_INLET
/ SS_PIPE. Add an InteractiveCommand trait + CommandStep to ocs_plugin_api
and HostApi::start_interactive; a host adapter bridges it to the internal
CadCommand, so a plugin tool drives the host's point-collection flow.

Hybrid by construction: the same command works by clicking in the viewport
AND by feeding coordinates over --serve (run "CMD x,y x,y"). Adding a
HostApi method changes the contract vtable, so API_VERSION bumps to 2 —
v1 plugin binaries are now refused at load.

Part of the #100 extensibility epic.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:43:35 +03:00
Michael Flynn
29d2a4a16c feat(registry): list Storm Sewer plugin (mf4633/opencad-storm-sewer-plugin) 2026-06-17 14:38:20 -04:00
Hakan Seven
8d3d0c30cc feat(automation): undo/redo ops (move/copy already work via select+run)
Add undo and redo ops to the headless server (synchronous via update()).
Combined with select, the modify commands MOVE/COPY work through the
existing dispatcher — "select type=Line" then run("MOVE 0,0 10,0")
translates the selection. ocs.py gains undo()/redo().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:31:15 +03:00
Hakan Seven
c78bc62056 feat(automation): select op — target entities by handle/type/layer
Add a select op that sets the document selection (by hex handles from
query, or by type/layer, or clear). Selection drives modify commands, so
an agent can query → select → run("ERASE") to act on specific entities.
Completes the modify half of the act/observe loop. ocs.py gains select().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:27:26 +03:00
Hakan Seven
6d29b8458c feat(automation): query op — list entities with detail and filters
Add a query op to the headless server: list entities with handle, type,
layer and basic geometry (Line start/end, Circle/Arc centre+radius, Point
location), filtered by type and/or layer and capped by limit. Closes the
observe half of an agent's act/observe loop. ocs.py gains ocs.query().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:22:46 +03:00
Hakan Seven
f1a59b1094 feat(automation): drive draw commands headless with coordinate args
run now feeds coordinate tokens to interactive tools: "LINE 0,0 10,10"
starts the tool, feeds the points, and terminates as if Enter were
pressed — creating real geometry through the existing command system. The
headless session also leaves the welcome (Start) tab so drawing commands
aren'\''t blocked. Verified end-to-end: LINE/CIRCLE create entities that
save and reopen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:17:17 +03:00