Commit Graph
4630 Commits
Author SHA1 Message Date
Afonsop 6cb8c00fa0 web: enable STL/STEP export and OBJ import, drag-and-drop open
STLOUT/STEPOUT wrote via std::fs and IMPORTOBJ read via std::fs, all
of which fail on wasm32. The export pickers now mirror the PDF path
(pick_*_owned returns a name-only PathBuf; the browser download names
the file) and the write tail swaps fs::write for sys::download_bytes.
OBJ import reads the picked file's bytes directly, like the web open
picker.

Opening by drag-and-drop was dead on the web build: winit never emits
FileDropped there. A wasm-gated io::web_drop module installs DOM
dragover/drop listeners, filters .dwg/.dxf, reads the File bytes
async, and queues them; the existing 50 ms PollWebControl tick drains
the queue into the same open path the picker uses (progress overlay,
recovery, OPFS recent cache).

Also floors the model-space plot sheet: extents smaller than 10 mm
(or the 0x0 paper a fresh unsaved drawing carries) now fall back to
the standard sheet instead of producing a ~3 pt page.

(cherry picked from commit ad60be11ed)
2026-10-12 12:02:04 +03:00
Afonsop 112060e370 web: harden plot preview after adversarial review
Three reviewers (security, correctness, performance) converged on:

- Download PDF died on the second click: Closure::once_into_js throws
  when invoked twice. The handler is now a plain FnMut kept for the
  overlay's lifetime.
- Rasterisation was bounded by page count, not pixels: 12 A0 sheets at
  150 DPI peaked near 1.8 GB of RGBA plus ~1.7 GB of decoded images,
  and a drawing declaring absurd paper sizes made the rasteriser
  saturate its u16 dimensions into a ~17 GB allocation that aborts the
  tab. Preview now computes a uniform DPI under a 64-Mpx total budget
  (floor 24 DPI) from the page tree before allocating, with a per-page
  4096-px edge clamp.
- Overlays stacked when previewing twice and their blob URLs were only
  revoked via Close. The overlay is now single-instance (id-tagged);
  a replacement or Close revokes every URL through a shared registry.
- emit_image resampled before probing the XObject cache, so a title
  block placed on 12 layouts ran 12 Lanczos passes to embed once.
  The cache is now probed with the target dimensions first.
- Preview downloads are named {stem}_preview.pdf instead of a constant
  plot_preview.pdf, and the page label says 'first N of M' when the
  preview is capped while the PDF keeps every page.

(cherry picked from commit 2a05479d69)
2026-10-12 12:02:04 +03:00
Afonsop 8cce362009 web: warn when an opened drawing's name collides with an open tab
Web builds identify drawings by bare file name (the browser picker
exposes no real path), so two tabs with the same name also share the
single browser-stored copy: the last save silently replaces the other
tab's. Warn on open instead of letting that surface later.

(cherry picked from commit 6306359390)
2026-10-12 12:02:04 +03:00
Afonsop 4d1f9d5960 web: render plot preview in-page instead of a new tab
A plot preview should show the plotted result on screen instead of
producing a file. The web build now does: the plotted PDF bytes
are rasterised with the hayro pipeline already used for PDF underlays
(150 DPI, first 12 pages) and shown in an in-page overlay with
Download-PDF and Close actions.

The previous strategy opened a new tab via window.open from the async
plot task; browsers withhold popups without a live user gesture, and
embedded hosts ship no PDF viewer plugin at all — so the fallback
download fired and preview behaved like an export. Plain PNG <img>
elements need neither permission.

(cherry picked from commit 8722d84910)
2026-10-12 12:02:04 +03:00
Afonsop c8386c6d3a build: make the Trunk web-worker hook work on Windows
Trunk passes TRUNK_STAGING_DIR as an extended-length path (\?\C:\...)
on Windows, which MSYS sh tools cannot stat, so post_build failed and
the whole web build aborted. Strip the prefix with sed before use;
Linux CI paths are unaffected.

(cherry picked from commit e3c86eca29)
2026-10-12 12:02:04 +03:00
Afonsop 38f0e2b25f app: wire web export, preview, and print flows through the plot UI
- plot dialog: the web build defaults to 'Save to PDF file...' (its only
  output choice); native dropdowns and defaults are untouched.
- on_plot_dlg_commit forces to_file on wasm so a stale page setup can no
  longer route the web build into the (unreachable) printer path; both
  preview branches now go through preview_page_pdf, which is identical to
  the old inline temp-PDF + OS-viewer flow on desktop.
- Print ribbon / PRINTALL on wasm render the PDF and open it in a tab
  instead of erroring; PrintAllPdf picks a virtual path and downloads.
- pdf_plot_options maps the dialog's Quality dropdown into PdfPlotOptions.

(cherry picked from commit 892d693d2d)
2026-10-12 12:02:04 +03:00
Afonsop 978000d37c io: enable the PDF pipeline on wasm32 and add plot quality presets
- pdf_export: drop the stale wasm32 gates (printpdf 0.9.1 compiles for
  wasm; the memchr/lopdf incompatibility is gone with memchr 2.8.3).
  Rendering is portable via render_pdf_bytes; only persistence differs:
  atomic temp-file write on desktop, browser download on the web.
  pick_pdf_path_owned on wasm returns a virtual path so the existing
  message flow works unchanged.
- printpdf moves from the native-only dependency table to the shared one.
- print_to_printer: preview_page_pdf / preview_pages_pdf render the same
  bytes and open them in a browser tab on the web (the browser's print
  dialog takes over); desktop keeps the temp-PDF + OS-viewer flow.
- sys: open_bytes_in_new_tab (blob URL, popup-blocked falls back to a
  download).
- New PlotQuality preset caps embedded raster resolution (High = native,
  Normal = 300 DPI, Low = 150 DPI effective); vector output is untouched.
  The image resource cache keys on the post-resample dims so one pixels
  Arc placed at different effective DPIs embeds per-placement XObjects.

(cherry picked from commit 4812bc775d)

Ported onto main (#1717 review): the plot model lives in io::plot; Normal
keeps native pixels like High (only Low caps images at 150 DPI, so desktop
output is unchanged); the searchable TrueType text layer and its allsorts
subsetting now build on the web too; the plot stamp reads the time through
js_sys on wasm.
2026-10-12 12:02:04 +03:00
Karim Jerbi 7b68d274ad feat(mcp): add batch summaries with read-only detail retrieval
Add opt-in response_detail=summary with step and change counts, compact state, warnings, and actionable errors or prompts. Return an ocs_read batch_result request for full cached details without resuming mutations.

Keep compact/full behavior and idempotent batch retries intact. Preserve active-step context and report unavailable cached results explicitly. Document cache scope and retention; update schemas and digest.

Validation: 47 MCP unit tests, live stdio smoke test, rustfmt, and diff checks passed.
2026-10-12 09:39:54 +01:00
Karim Jerbi f4b33d5cde perf(mcp): deduplicate operation schemas with shared definitions
Share operation definitions between individual requests and batch steps, reducing the execute request schema by 39%. Place definitions at the tool input schema root so local references resolve correctly.

Update the schema digest and smoke assertions. Verified with 45 MCP tests, the live stdio smoke test, and 228 schema validation comparisons.
2026-10-12 09:05:38 +01:00
Karim Jerbi 2b50b6c858 fix(blocks): one block definition service for delete, rename and purge on every path
new src/scene/block_service.rs (references, delete, rename, purge candidates, name validation, one error type and message). The command-line RENAME, palette Remove, plugin API, control/MCP block_delete and PURGE all use it. Layout, xref, dynamic-block, anonymous and open-in-editor records are protected; PURGE removes an anonymous block only when nothing references it. PROTOCOL CHANGE: control/MCP block_delete refuses a referenced block unless force=true (erases referencing INSERTs in one undo step). New REST route DELETE /api/v1/blocks/{name}?force=true. MCP tool digest re-pinned. Undo labels are Delete block X, Rename block X to Y and Purge.
2026-10-12 07:25:11 +01:00
Karim Jerbi 5dfa41c032 fix(blocks): one base point convention for creation, redefine, insert, explode, XCLIP and REFEDIT
world = insert_point + Rot * Scale * (P - base_point). Attribute placement, EXPLODE, XCLIP storage, REFEDIT's working copy, the UCS reframe of attributes and the dynamic-block visibility grip ignored the base point and were offset by Rot*Scale*base. They now share insert_transform_with_base. Creation stores a ZERO base and redefine resets it; a no-op redefine moves nothing; the Block Definition dialog prefills the base from the definition. XCLIP filters stored by older builds keep their old displacement.
2026-10-12 04:35:19 +01:00
Karim Jerbi a456367b26 fix(save): baked dimension blocks and block clones must not share extension dictionaries
bake_dimension_blocks copied the dimension's whole EntityCommon, including its extension dictionary handle, into every baked child, so many entities claimed one dictionary and file validation reported an error per entity. Baked children now get no extension dictionary. The same defect is fixed in define_transformed_block and the cross-document paste clone. Each has a test.
2026-10-12 04:35:19 +01:00
Hakan SevenandClaude Opus 5.5 cd07141cde fix(fonts): keep missing font names clear of the list's scrollbar
The missing-fonts list is as wide as its longest name, so its scrollbar
was drawn over the end of every name ("ROMANT.sh").

Fixes #1715

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 01:17:20 +03:00
Hakan SevenandClaude Opus 5.5 551d4c1c60 fix(grips): arcs, circles and solids with a flipped normal show grips in place
Their grip code already works in world space, and the dispatch layer
converted the grips through the OCS a second time, so for a normal of
(0,0,-1) the grips (and grip edits) were mirrored across the Y axis.

Fixes #1683

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 01:13:12 +03:00
Hakan SevenandClaude Opus 5.5 15c566c286 fix(render): thickened polylines without width keep their colour
A polyline with a thickness but no width is drawn as its extrusion edges
alone, and those edges were forced black (the outline colour meant for the
filled tube of a wide polyline). On a dark background the polyline looked
black and changing its colour did nothing. Only a wide polyline's tube
edges are black now.

Fixes #1682

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 01:13:12 +03:00
Hakan SevenandClaude Opus 5.5 1973605cb0 test(dock): drive the real view on a large stack, one at a time
The two dock tests that build and drive the real view overflowed a
default test thread's stack, and made in parallel their headless
renderers crashed the test process about one run in three.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 00:49:27 +03:00
Hakan Seven 1333efcad2 Merge pull request #1549 from MarcelP102/codex/graphic-attributes-cleanup
[UX] Introducing graphic attributes panel

# Conflicts:
#	locales/ar-SA/opencadstudio.ftl
#	locales/bg-BG/opencadstudio.ftl
#	locales/cs-CZ/opencadstudio.ftl
#	locales/de-DE/opencadstudio.ftl
#	locales/el-GR/opencadstudio.ftl
#	locales/en-US/opencadstudio.ftl
#	locales/es-ES/opencadstudio.ftl
#	locales/fi-FI/opencadstudio.ftl
#	locales/fr-FR/opencadstudio.ftl
#	locales/hi-IN/opencadstudio.ftl
#	locales/hu-HU/opencadstudio.ftl
#	locales/it-IT/opencadstudio.ftl
#	locales/ja-JP/opencadstudio.ftl
#	locales/ko-KR/opencadstudio.ftl
#	locales/lo-LA/opencadstudio.ftl
#	locales/nl-NL/opencadstudio.ftl
#	locales/pl-PL/opencadstudio.ftl
#	locales/pt-BR/opencadstudio.ftl
#	locales/ru-RU/opencadstudio.ftl
#	locales/tr-TR/opencadstudio.ftl
#	locales/zh-CN/opencadstudio.ftl
#	locales/zh-TW/opencadstudio.ftl
#	src/app/mod.rs
#	src/app/update/dialog.rs
#	src/app/view/mod.rs
#	src/locale_catalog.rs
#	src/ui/dock.rs
2026-10-12 00:49:27 +03:00
Hakan Seven 7ca457a6cc Merge pull request #1702 from MarcelP102/Pallet-placement
[UX] Pallets you can dock, group and float (including LAYERS panel)
2026-10-12 00:27:53 +03:00
Hakan SevenandClaude Opus 5.5 7a942222c9 docs(plugin): describe XRecord storage without a vendor name
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 00:23:46 +03:00
Hakan Seven e917c23b46 Merge pull request #1716 from schoeller/xrecord_crud
Xrecord crud
2026-10-12 00:21:14 +03:00
Hakan Seven f618d695e2 Merge pull request #1684 from turbuczn/hungarian-translation-only
Improve existing Hungarian CAD translations

# Conflicts:
#	locales/hu-HU/opencadstudio.ftl
2026-10-12 00:21:07 +03:00
Hakan SevenandClaude Opus 5.5 64e9b612cb fix(plot): EXPORTPDF proposes PDF after EXPORTSVG; SVG strings in every locale
EXPORTSVG left the plot dialog's SVG device on, so a later EXPORTPDF still
offered a .svg file. The SVG save dialog and plot button texts had no
catalog entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 00:20:20 +03:00
Hakan Seven fb474eb77c Merge pull request #1701 from hvfrancesco/main
added SVG export feature

# Conflicts:
#	src/io/mod.rs
#	src/io/pdf_export.rs
2026-10-12 00:17:35 +03:00
Hakan Seven 5bb0efd93e Merge pull request #1679 from ramox81/codex/surface-associativity-sources
Associative extruded, revolved and lofted surfaces; spline and ellipse sources

# Conflicts:
#	src/app/command_driver/solid3d.rs
#	src/scene/dwg_native_constraints.rs
#	src/scene/model/mod.rs
#	src/scene/model/sweep_command_model.rs
#	src/scene/model/sweep_model.rs
#	src/scene/modify.rs
2026-10-12 00:14:34 +03:00
Hakan SevenandClaude Opus 5.5 a542a401d9 fix(view): -VIEW settings open no undo step for a view that is gone
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 00:12:51 +03:00
Hakan Seven e5df2fd113 Merge pull request #1667 from ramox81/codex/view-presets
-VIEW command-line form: presets with orthographic UCS, sEttings and Window

# Conflicts:
#	src/app/commands/mod.rs
#	src/io/mod.rs
2026-10-12 00:10:22 +03:00
Hakan Seven df1f9bd0e7 Merge pull request #1680 from ramox81/codex/block-wire-buffer-packing
Block wires: pack definitions into shared buffers

# Conflicts:
#	src/scene/pipeline/mod.rs
#	src/scene/pipeline/wire_gpu.rs
2026-10-11 23:50:38 +03:00
Hakan SevenandClaude Opus 5.5 f4001b88e2 fix(automation): selection events are native-only like their caller
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 23:48:40 +03:00
Hakan Seven 3cc3ead3a6 Merge pull request #1714 from yztink/fix/arc-tangent-line
fix(draw): support line tangency in arc construction and resolve trim contact precision
2026-10-11 23:42:48 +03:00
Hakan SevenandClaude Opus 5.5 23b21b5d77 fix(snap): typed overrides yield to the prompt's options; one point-step gate
#1707 took any snap name typed at a point prompt as an override, so a
prompt offering Center, Tangent, Parallel or None (ARC, ELLIPSE, CIRCLE
TTR, ...) could no longer be answered with that option's name. An option
the prompt offers now wins. The point-step test it copied from MTP is one
helper shared by MTP and the override on both input paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 23:41:55 +03:00
Hakan Seven 45bc31f730 Merge pull request #1707 from yztink/feat/snap-overrides
feat(snap): add transparent object snap overrides in active commands typed on command-line

# Conflicts:
#	src/app/update/command.rs
2026-10-11 23:39:07 +03:00
Hakan SevenandClaude Opus 5.5 7e0866e647 fix(input): fire a rebound SPACE only from the command line
#1713 dispatched a captured SPACE as a shortcut whenever it was rebound,
so with SPACE on FINALIZE a space typed into any other text field (layer
names, Properties, find) also ran FINALIZE, and the space it typed stayed
in the command line. Ask whether the command input has focus before
running the binding, and drop the space the field already inserted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 23:38:06 +03:00
Hakan Seven c56cdd6a26 Merge pull request #1713 from theluckystrike/fix/1710-space-finalize-focus
fix(input): let a rebound SPACE fire while the command line has focus
2026-10-11 23:35:37 +03:00
Hakan SevenandClaude Opus 5.5 b9ef8c50ed fix(fillet): keep no-trim for every pair and the Trim prompt; share TRIMMODE with CHAMFER
#1692 limited no-trim FILLET to two lines and refused arcs and polyline
segments, which #1558 already filleted without trimming (only the arc is
added). It also turned T/N at the object prompts into silent toggles, so
the Trim option no longer reached its Trim/No trim prompt and the choice
was not saved. Keep the arc bookkeeping it added (the new arc can be
picked next, and stays on the picked layer), restore every pair and the
Trim prompt.

CHAMFER's new no-trim mode starts from and saves the same TRIMMODE value
as FILLET instead of always starting trimmed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 23:34:09 +03:00
Hakan Seven 6f2d43820f Merge pull request #1693 from YsDirector/pr/chamfer-no-trim
Add no-trim CHAMFER mode

# Conflicts:
#	src/modules/draw/modify/fillet.rs
2026-10-11 23:31:34 +03:00
Hakan Seven 3f871361f3 Merge pull request #1692 from YsDirector/pr/d7-fillet
Add no-trim FILLET mode

# Conflicts:
#	src/modules/draw/modify/fillet.rs
2026-10-11 23:31:23 +03:00
Hakan Seven 7b8397fe6b Merge pull request #1696 from YsDirector/pr/c11-next-frame
Capture after the next rendered frame

# Conflicts:
#	src/app/control/mod.rs
2026-10-11 23:30:20 +03:00
Hakan Seven 2e79430930 Merge pull request #1691 from YsDirector/pr/d6-save-verified-fingerprint
Refresh fingerprints after verified saves

# Conflicts:
#	src/app/automation.rs
2026-10-11 23:29:27 +03:00
Hakan SevenandClaude Opus 5.5 9039dadfd9 docs(automation): Spline and MText style in entities_create; drop stale comment
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 23:28:39 +03:00
Hakan Seven 207684efb0 Merge pull request #1694 from YsDirector/pr/d8-entities-validation
Validate entities_create fields and geometry strictly

# Conflicts:
#	src/app/control/entities.rs
2026-10-11 23:28:35 +03:00
Hakan SevenandClaude Opus 5.5 731286c8cc fix(automation): validate spline degree, knots and weights on entities_create
#1688 accepted any degree (falling back to 3 on a malformed value) and
overwrote the degree the codec had clamped to the control-point count, so
a two-point default spline stored degree 3 against a degree-1 knot vector.
Reject a non-integer or out-of-range degree, too few control points for
the degree, a knot vector that is not control_points + degree + 1
non-decreasing values, and weights that are not one positive value per
control point.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 23:27:35 +03:00
Hakan Seven cdf8e60fbf Merge pull request #1688 from YsDirector/pr/d3-spline-api
Create and serialize splines through automation

# Conflicts:
#	src/app/control/entities.rs
2026-10-11 23:26:06 +03:00
Hakan Seven b71d8fa5f5 Merge pull request #1686 from YsDirector/pr/d1-sysvar
Apply sysvar batches atomically

# Conflicts:
#	src/app/control/sheets.rs
2026-10-11 23:25:39 +03:00
Hakan Seven 4a47777571 Merge pull request #1687 from YsDirector/pr/d2-selection-events
Publish selection changes to automation clients
2026-10-11 23:25:24 +03:00
Hakan Seven 70418796ac Merge pull request #1689 from YsDirector/pr/d5-request-id
Reject changed payloads for reused request IDs

# Conflicts:
#	src/app/control/mod.rs
2026-10-11 23:25:23 +03:00
Hakan Seven 8d98608d1a Merge pull request #1690 from YsDirector/pr/d6-external-change-actions
Expose external-change modal actions to automation
2026-10-11 23:24:50 +03:00
Hakan Seven cd494de5fb Merge pull request #1695 from YsDirector/pr/d9-task-completion
Track zero-unit task completion
2026-10-11 23:24:49 +03:00
Hakan Seven 60f511ba10 Merge pull request #1685 from YsDirector/pr/p6-dimtmove
Respect DIMTMOVE=2 for linear dimension text

# Conflicts:
#	src/entities/dimension.rs
2026-10-11 23:23:26 +03:00
Hakan Seven 9fe290e875 Merge pull request #1672 from MarcelP102/fixes-for-right-click-menu
[UX] Context menu: trailing check mark, faded icons on disabled rows
2026-10-11 23:23:11 +03:00
Hakan SevenandClaude Opus 5.5 656f0cead6 fix(extrude): store the fallback profile in place under group 295; kernel f051138, graph fbee68b
#1666 sets group 295 on extrusion history records, which makes the kernel
read the embedded profile and path where they stand and ignore the
matrices. The planar fallback profile (a region-derived LWPOLYLINE) was
stored in its plane's local frame with the frame as matrix, so with the
flag it rebuilt at the origin. Re-express it in its own OCS (normal and
elevation) when the record is built.

Pins the kernel and graph at upstream (opencadkernel#84 merged as f051138)
instead of the ramox81/cadkernel [patch].

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 23:22:55 +03:00