Commit Graph
299 Commits
Author SHA1 Message Date
Hakan Seven 711799371a Merge pull request #1627 from ramox81/codex/plotdate-refresh
Fields: evaluation events, UPDATEFIELD, FIELDEVAL, per-field shading and PlotDate redraw.

# Conflicts:
#	Cargo.lock
#	src/entities/field.rs
2026-10-06 20:42:01 +03:00
Hakan SevenandClaude Opus 5.5 4f0040b542 Cargo: kernel e13f37f, graph f8bbf40; hole/boss edge blends, local fillets, sphere-cylinder booleans; DWT in web open dialog
- Fillet/chamfer hole and boss rims, edges of non-convex bodies, and a
  chamfer next to a fillet (and the reverse).
- Fillet after an extruded PRESSPULL: booleans now join coplanar faces.
- Union/subtract/intersect of a sphere with an off-axis cylinder.
- Web open dialog lists drawing templates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 20:08:42 +03:00
Hakan SevenandClaude Opus 5.5 1eae36e726 Cargo: codec 76d2a1c, kernel e652b4d, graph 0545fa9; text styles, templates, solid edges
- Text styles keep their TrueType typeface through save and reopen (codec
  reads and writes the STYLE record's ACAD extended data) (#1633)
- Unnamed shape-file entries no longer show in text style lists (#1634)
- Save As offers DWT 2018; NEW asks for the template to start from, while
  Ctrl+N and the quick-access New run QNEW with the default template (#1635)
- An edge next to an earlier fillet of the same radius rounds together with
  it (kernel); the solid stays drawn and pickable while edges are chosen
  (#1625, #1107)
- A full cache rebuild drops the B-rep cache too, so an undone fillet does
  not come back with the next edge operation (#1107)
- Selected solids in shaded styles highlight only their visible edges (#1031)
- VIEW ISO / SWISO / SEISO / NEISO / NWISO snap to the isometric corners

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 18:32:43 +03:00
Hakan SevenandClaude Opus 5.5 178c7dff41 fix: open-issue sweep — drawing, plot, snap, layout and UI fixes
Fixes:
- Font prompt no longer lists bundled ltypeshp/qcadshp shape files (#1626)
- Wide polylines step at a discontinuous segment width; PEDIT marks the
  current vertex; keyword steps refresh the command preview (#1628)
- Radius-0 fillet drops the zero-length segment it left, so the corner
  fillets again (#1422)
- FILLET Trim / No trim option (#1558)
- True-colour wires plot in their own colour; colour picker stores the
  value it shows (#1621)
- Model tab keeps its page setup; "Save changes to layout" in Model (#1620)
- QNEW default template in Options > Files; .dwt in the open dialog
  (#1134, #1113)
- GRIDUNIT / GRIDMODE / PERSPECTIVE variables (#1618, #1524)
- PTYPE (#1433)
- ZOOM nX / nXP (#1465)
- CHSPACE between model and paper space through a viewport (#1428)
- Moving a dimension keeps its automatic text placement
- Shell icon; "&&" button labels (#1554)
- LINETYPE Load from a .lin file (#1588)
- XLINE / RAY hide the crosshair arms (#1437)
- Dynamic-input boxes keep clear of the crosshair and each other (#1546)
- Snap marker colour setting, dark default on light canvases
  (#1497, #1229, #1128)
- Dimension style precision as a 0.00 pattern dropdown (#1426)
- Node graph nodes left of the origin no longer clip away (#1592)
- Collapse button in the command history header (#1094)
- Freeze-in-current-viewport toggle in the ribbon layer list (#1466)
- Geometric Center object snap for closed polylines (#1369)

New strings translated in all 21 locales.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 15:59:30 +03:00
ramox81andClaude Opus 5.5 1c242eb489 Fields: stored values on redraw, evaluation events, per-field shading
MTEXT draws its stored text instead of re-evaluating fields on every
redraw. Fields update on their evaluation events as the reference does:
open (1), save (2, not autosave), plot (4) and REGEN/REGENALL (16), each
masked with the drawing's FIELDEVAL (variable dictionary, 0-31, with the
reference's prompt and message), and the new UPDATEFIELD command
(selection, attributes of selected block references, "N field(s)
found." / "N field(s) updated."). A Date field (on demand only) keeps
its value until UPDATEFIELD. The FIELDDISPLAY gray box now covers each
field's own glyphs, one box per line it spans, instead of the whole
text. Codec moved to the update_fields / field_spans revision.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 11:38:01 +03:00
Hakan SevenandClaude Opus 5.5 fafb1758c1 fix: settle the Count and Sheet Set merge
- Both PRs registered "Requires an integer between {min} and {max}." under
  their own key; keep the sheet set one, which every locale translates.
- Pin the MCP tool schema digest with the sheet set actions added.
- searchable_layer_coexists_with_outlines read glyph outlines from the
  shared atlas while other tests could re-bake it, and failed now and
  then; lay out and export under one atlas generation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 09:49:38 +03:00
Hakan Seven 078306d8fc Merge pull request #1613 from ramox81/codex/sheet-set-manager
Sheet Set Manager, NEWSHEETSET / OPENSHEETSET and sheet set fields
2026-10-06 09:17:20 +03:00
Hakan SevenandClaude Opus 5.5 a3bcded498 fix(release): support fix releases on top of a weekly one
`v2026.40.1` matched neither the weekly pattern nor plain semver (2026 is
past the MSI major limit), so a fix release could not be built. Weekly
tags now take an optional patch: Cargo 2026.40.1, MSI 26.40.1, display
2026.40.1 (week zero-padded, as build.rs and the update check expect).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 15:58:53 +03:00
ramox81andClaude Opus 5.5 0a45e59c2f Sheet sets: approved dialogs, sheet status, view categories, model views, navigation fields
Remove Sheets confirmation, Open in drawing editor, Select Layout as Sheet
Template for subsets that prompt, Import Layouts as Sheets with status and
prefix, Rename & Renumber options with Previous/Next and real layout/file
renames, New Subset folder hierarchy and publish setting, subset properties
rows as the reference shows them, sheet status badges (SSMSHEETSTATUS /
SSMPOLLTIME), Sheet Views by category with the View Category dialog, Model
Views locations, Field dialog SheetSet/SheetView navigation, and .dwt/.dws
read as DWG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 12:08:29 +03:00
Karim Jerbi 7d1fca000b fix(io): materialize missing BLOCK/ENDBLK sentinels on load
The DXF reader keeps marker identities on the block record but never materializes the entities, so block_entity_handle/block_end_handle dangle after every DXF load (reopened baked *D dimension blocks hit this every time). Re-create missing sentinels at load finalize, reusing the file handle when free and minting otherwise. Idempotent and DWG-safe: loads whose markers already resolve are untouched. Pinned by dimlinear_survives_save_reload_with_baked_geometry.
2026-10-05 00:07:21 +01:00
Hakan SevenandClaude Opus 5.5 f14b675ff7 fix(web): gate native-only code out of the wasm build
The wasm check broke on the MCP `tools` op, the block library's folder
picker and DWG thumbnails, and the PDF export-window culling helpers.
Gate each one like the code around it; `read_handle` needs no gate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 20:53:11 +03:00
Hakan SevenandClaude Opus 5.5 440adec834 fix(pdf): leave out what the export window clips away
Everything was written and only clipped at view time, so a window over a
corner of a large drawing produced a near-empty page of several MB.
Wires and hatches whose sheet bounds miss the window are now skipped.

Fixes #1568

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 20:44:08 +03:00
Hakan SevenandClaude Opus 5.5 31341e8ea2 fix(xref): bring the anonymous blocks dimensions draw from
A dimension draws from its *D block by name, but loading an xref skipped
anonymous blocks and kept the name verbatim, so its dimensions fell back
to a regeneration (giant text at the origin) or a host block of the same
name. The load path now imports them prefixed like other blocks and
renames the dimension's block; BIND is unchanged.

Fixes #1578

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 20:44:08 +03:00
Hakan SevenandClaude Opus 5.5 a21aef2a11 fix(field): bound the Field dialog's automation indices; ASCII browse button
#1585's field_dialog action stored any index it was given, and the dialog
indexes its category, case, size, named-type, formula, precision and plot
scale lists with them, so an out-of-range value panicked while drawing.
They are checked against the list lengths now. The hyperlink browse
button drew a glyph (…) that is tofu without the font, and two of the
new local_header_dates calls were mis-indented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 14:17:48 +03:00
Hakan Seven 0de1e91f99 Merge PR #1585 from ramox81/codex/field-command: FIELD command and Field dialog; attribute definition field buttons
The PR pinned the codec to its fork through [patch]; codec #75 is merged
upstream and main already points at it, so the patch section is dropped.
The two windows-sys features it adds (Globalization, Identity) stay.
2026-10-02 14:14:15 +03:00
ramox81andClaude Opus 5.5 a735b10b34 feat(field): Formula, Hyperlink and plot fields; local-time field dates, file times and display name; header dates on save
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 12:38:49 +03:00
Hakan Seven c492539fde Merge PR #1580 from Chrisyeh1983/fix/pdf-embed-truetype-text: export TrueType text as embedded subset fonts
Conflicts with 02c470aa (invisible searchable text layer): main already
depends on allsorts 0.16 with the same features, so its line stays. Both
layers would put the text into the PDF twice, so a run drawn wholly in
faces the PDF can embed now goes out as embedded-font text and skips the
invisible layer; any other run (stroke fonts, mixed scripts) keeps its
outlines and the invisible layer. Faces only probed for such a run are
not installed. The PR's test follows layout_glyph_quads' new tuple.
2026-10-02 12:16:38 +03:00
Karim Jerbi 02c470aac7 feat(pdf): searchable text layer with per-style subset font embedding
Real BT/Tj text objects ride alongside the vector outlines (Tr 3,
zero visual change): runs preserved at layout time, TTF styles embedded
as allsorts subsets with ToUnicode, width-matched Tm, clip-culled.
WireModel literals moved to ..Default::default() tails.
2026-10-01 23:30:35 +01:00
Chris YehandClaude Opus 5.5 a8dc6534f9 fix(pdf): export TrueType text as embedded subset fonts, not triangles
PDF export filled every TrueType glyph's tessellated outline, one triangle
per triple. A stroke-heavy CJK face such as DFKai-SB tessellates into
hundreds of triangles per character, so a 28-layout schematic set
exported at 320.9 MB and viewers crawled through it. The atlas export
table was also rebuilt for every text wire, which made the same export
take 566 s.

- ttf_glyph: GlyphSource records the face, glyph id and font-unit scale a
  filled outline came from; glyph_source / fallback_source resolve the
  same face as glyph / fallback_glyph (fallback picks both in one search).
- Face::glyph_source mirrors Face::glyph; stroke glyphs (LFF, SHX, big
  font) return None and keep their polyline export.
- GlyphExport carries the char and the source (filled glyphs only, so
  TEXTFILL 0 still exports hollow outlines).
- pdf_export draws a sourced glyph as text (Tf 1 + a Tm that maps its em
  onto the SDF quad), subsets each face with allsorts after all pages
  (keeping cvt/fpgm/prep for tricky fonts), renumbers glyph ids, and
  snapshots the glyph table once per export.

Same set: 566 s / 320.9 MB -> 27 s / 1.42 MB; text is searchable and
lands on the same pixels as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-01 23:07:15 +08:00
Hakan SevenandClaude Opus 5.5 3dcebf0dc6 Merge pull request #1553 from ramox81/codex/pointcloud-attach
Point clouds: drawn from their scans, attached, cropped and stylized.

The fork's codec patch is resolved to the upstream pins: the point cloud
records landed in opencadcodec 5ef9376, carried through opencadkernel
68eeda1 and opencadgraph e204966.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-01 01:49:25 +03:00
Karim Jerbi ad5f46309b fix(plot-style): parse legacy color1 hex by boundary-safe slices
Bug:
Legacy CTB files carry color1 = #xx... colour values parsed with
fixed-offset byte slices (&value[2..4], ...) guarded only by a length
check. Multi-byte UTF-8 in the value (a value with a non-ASCII character
inside the hex section) passes the byte-length check but slices
mid-character, panicking while the style loads.

Reproduce:
1. Craft a legacy CTB whose color1 value passes the length check but
   contains a multi-byte character.
2. Open the Plot Style panel or plot with that style.
3. Before: panic at the char-boundary slice.
4. After: invalid pairs parse as 0 (black) and the style loads.

Fix:
Fixed-offset byte slices are replaced with str::get over the same
offsets - None (a non-boundary or short position) keeps the existing
unwrap_or(0) semantics, so every previously valid value parses
identically and previously panicking values now default to zero. Tests:
the crafted multi-byte value loads as black, valid values unchanged.
2026-09-30 19:15:49 +01:00
Karim Jerbi 790da218b5 fix(plot-style): bound custom lineweight table keys to u8 range
Bug:
Custom lineweight table entries in a CTB are keyed by a number parsed
from the file and stored without an upper bound, but the only reader
(resolve_lineweight) indexes through entry.lineweight: u8. A key beyond
u8::MAX (e.g. 18446744073709551615 in a crafted file) caused an
out-of-bounds-style failure or a multi-GB table allocation when the
style was applied.

Reproduce:
1. Craft a CTB whose custom lineweight table uses a huge key
   (usize::MAX).
2. Apply the style or open plot settings.
3. Before: overflow panic (or a giant allocation).
4. After: the key is out of range, the line is ignored like any other
   malformed CTB line, and the style loads.

Fix:
Keys are bounded to u8::MAX when parsed - exactly the range the
u8-typed reader can ever use. In-range keys behave as before; keys 256
and above are dropped. Tests: a usize::MAX key does not overflow, an
in-range key is kept and applied, 256 is ignored.
2026-09-30 19:15:49 +01:00
Karim Jerbi ac6aa750f6 fix(plot-style): cap CTB inflate output at 64 MiB
Bug:
CTB plot-style tables are zlib-deflated, and decompress_ctb inflated
them with a bare read_to_end - no output budget. A few hundred KB of
crafted deflate input expands to gigabytes (A/space runs compress about
1000:1), and the Vec grows until the allocator aborts; an abort is not a
catchable panic. Both the zlib path and the legacy raw-deflate fallback
were unbounded.

Reproduce:
1. Craft a CTB whose payload deflates from 128 MiB of spaces (tiny on
   disk), with a valid PIAFILEVERSION header or as legacy raw deflate.
2. Select it as the plot style (open/plot).
3. Before: RSS climbs past the limit, then "memory allocation failed".
4. After: the read stops at the 64 MiB limit and the load fails with
   "... inflated data exceeds the 67108864-byte limit".
5. Boundary: a payload inflating to exactly 64 MiB loads (the limit
   means "exceeds"); one byte more is refused.

Fix:
inflate_capped reads through take(MAX_INFLATED_BYTES + 1) and refuses
when the count is greater than 64 MiB. The extra byte is what makes
"exactly at the limit" distinguishable from "at least the limit": a bare
take(cap) stops at the cap, so read == cap is ambiguous, and a >= cap
comparison would wrongly refuse a legitimate boundary payload. All three
inflation sites (zlib, raw-deflate fallback, legacy decoder) route
through the helper; error strings are preserved. 64 MiB is far above any
real plot-style table. Four tests: zlib bomb refused, legacy bomb
refused, exactly-at-cap accepted, cap-plus-one refused.
2026-09-30 19:15:49 +01:00
Karim Jerbi be8a7b95c4 fix(io): cap line reads on the serve and MCP transports
Bug:
The --serve automation loop (stdin/socket) and the MCP stdio loop read
input with unbounded read_line/lines. A single line over 64 MiB - a
huge paste or a hostile client - grows the buffer until the allocator
aborts, the same class of failure as the HTTP path, on the non-HTTP
transports.

Reproduce:
1. Start --serve on a socket (or the MCP server on stdio).
2. Send one 65 MiB line with no terminating newline anywhere in it.
3. Before: RSS grows to the full line, then "memory allocation failed"
   (or a multi-second stall while the line is copied).
4. After: the read fails at the cap and the existing EOF arm closes the
   connection/stdio promptly.

Fix:
New shared src/io/line_read.rs module: lines_capped(reader, 64 MiB)
yields Err for an over-cap line, which the serve and MCP loops already
treat as EOF/close. rest.rs was refactored onto the same helpers so the
cap logic lives in one place. A regression test streams a 65 MiB line
at the serve socket and asserts the connection ends without a response.
2026-09-30 19:15:49 +01:00
Hakan SevenandClaude Opus 5.5 593f7ca3e9 fix(linetype): catalog complex linetypes keep their shapes and text
The loader added every catalog linetype to the drawing with its [shape]
and ["text"] elements stripped, and the renderer reads the drawing's
own definition first — so BATTING, ZIGZAG, PLANT, POINT1/2, DRAINAGE,
FENCELINE, TRACKS, GAS_LINE, HOT_WATER_SUPPLY drew as plain dashes (a
near-solid line), and a saved file carried no shapes either.

- populate_document_from_source now stores each shape / text on the
  element it follows, with a shape-file STYLE (empty name, one per file)
  and the named text style; values keep their written decimals.
- One table maps shape names to numbers per shape file: the standard
  ltypeshp 130–134, the bundled catalog's own beyond them. The renderer
  resolves stored numbers through it instead of a hard-coded list that
  ignored which file a number belonged to.
- A drawing's copy stripped to exactly the catalog's dashes (as this
  loader saved them) gets its shapes and text back on open.
- Opening completes the linetypes before the geometry is prepared, so
  the first view already draws them.

Fixes #665

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-30 14:38:53 +03:00
ramox81andClaude Opus 5.5 c2d9ac5ae2 Point clouds: attach dialog, crop toolbar, stylize, palette rows
POINTCLOUDATTACH opens the Attach Point Cloud dialog after the file is
chosen; its Attach button lives in the Attach Underlay list instead of a
separate Insert panel. A selected cloud brings the crop tools to the
right-edge toolbar. POINTCLOUDSTYLIZE sets the stylization with the
reference's prompts, the External References palette lists point clouds
(unload, reload, detach, path), and definitions keep the header extents.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-30 10:14:44 +03:00
ramox81andClaude Opus 5.5 e9c4e501db Point clouds: drawn from their scans, placed, cropped and attached as the reference does
Scans (.rcs) and projects (.rcp) are read and their points drawn as
screen-sized dots, coloured by the cloud's stylization. The cloud's
placement carries its scale and rotation; its extents and crops stay in
the scan's coordinates. A missing scan shows the extents with the saved
path. -POINTCLOUDATTACH / POINTCLOUDATTACH, POINTCLOUDCROP and the
POINTCLOUD* settings follow the reference's prompts and messages, the
Properties list is the reference's, and a locked cloud is left alone by
edits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 17:08:46 +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
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 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 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 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 Seven 1a7e372f24 Merge pull request #1517 from mechpanos/fix/windows-printer-properties-freeze
fix(print): open the driver's printing preferences without blocking the event loop
2026-09-28 17:27:32 +03:00
Hakan Seven 89b0f58fe1 Merge pull request #1518 from mechpanos/fix/windows-devmode-size-query
fix(print): ask the driver for the DEVMODE size with no mode flags
2026-09-28 17:26:11 +03:00
mechpanosandClaude Opus 5 c73ee2c5aa fix(print): ask the driver for the DEVMODE size with no mode flags
`with_printer_devmode` sized the driver's DEVMODE with a
`DocumentPropertiesW` call that passed `DM_OUT_BUFFER` and no output
buffer to write into. That combination is not a size query: drivers
answer it with -1, the `needed <= 0` guard returned early, and the
function handed back `None` for every printer on every machine.

Measured here on Windows 11 x86-64, both an installed virtual printer
and a physical one:

  fMode = 0                        -> 5428 / 2684 bytes (the real size)
  fMode = DM_OUT_BUFFER, NULL out  -> -1

Two things were broken by it, both silently:

  - `oriented_printer_devmode` builds the DEVMODE a print job is spooled
    with. Getting `None` back, the direct GDI path fell through to
    "CreateDC then falls back to the driver default", so the plot's
    orientation and sheet never reached the job. A landscape plot came
    out however the driver happened to be set. This is the route users
    without a PDF application take.
  - `PRINTERS <name>` could never name the driver's default sheet,
    because the id it matches on comes from that same DEVMODE.

With the size query asking for a size, both work: the report now says
"Default sheet: ISO A4 (210 x 297 mm)" for both printers here, and a
landscape plot leaves `dmOrientation = DMORIENT_LANDSCAPE` set in the
job's DEVMODE.

The two new tests both fail with the old flag and pass with it removed.
The existing GDI ink tests do not catch this: they accept the raster
rotation fallback as an equally good outcome, so the page looked right
while the DEVMODE was empty.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-28 16:22:05 +03:00
ramox81 fecbcd8138 Merge remote-tracking branch 'origin/main' into codex/dwf-dgn-underlays
# Conflicts:
#	Cargo.lock
2026-09-28 16:13:14 +03:00
mechpanosandClaude Opus 5 9ba2493027 fix(print): open the driver's printing preferences without blocking the event loop
Properties… in the Plot dialog froze the application on Windows.

`on_printer_properties` called `DocumentPropertiesW` with `DM_IN_PROMPT`
from inside the closure handed to `iced::window::run`, and iced runs that
closure synchronously on the winit event-loop thread. The driver's
property sheet wants to run its own modal message loop on that same
thread, so the two loops collide: the sheet is never created at all, the
window stops painting, and the thread spins at 100% of one core with no
way back.

Measured on Windows 11 x86-64: the pinned thread is the window's own UI
thread, and compstui.dll plus the driver's PrintConfig.dll are loaded
into the process, so execution does reach the driver's property-sheet
code and never leaves it. It reproduces with a physical printer as
readily as with Microsoft Print to PDF, so the mechanism was broken for
every printer, not only the virtual one named in the report.

The system's own printing-preferences UI is now started as a separate
process, which pumps its own messages and leaves ours free, so the
freeze is impossible by construction rather than merely unlikely. The
command that does it already existed for the case where no printer is
selected; it now serves a named printer too, and the in-process modal
path is gone. Preferences still reach the job: the sheet writes the
per-user DEVMODE that the plot path reads back through
`DocumentPropertiesW`, which was confirmed by changing the orientation
in the sheet and watching the value the plot path reads change with it.

The new test pins down that the printer name must reach `printui` as a
single argument: split across several it matches nothing and the process
exits 0 without drawing anything, which would be a failure with nothing
to show the user.

Fixes #1474

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-28 15:40:39 +03:00
Hakan Seven 6c481c92fe Merge pull request #1513 from ramox81/codex/image-transparency
Raster images: draw opaque when transparency is off; TRANSPARENCY command
2026-09-28 13:48:51 +03:00
ramox81andClaude Opus 5.5 cb7860e50e DWF and DGN underlays: attach, display, snaps, frames and references
DWFATTACH / -DWFATTACH and DGNATTACH / -DGNATTACH attach a DWF / DWFx sheet
or a DGN (V7 or V8) model with the reference's prompts; ATTACH routes the
file types to them. The sheet or model is read into vector paths, drawn as a
transparent underlay raster (contrast, fade, monochrome and background
adjustment apply) and offers its geometry to object snaps. Definitions are
kept in ACAD_DWFDEFINITIONS / ACAD_DGNDEFINITIONS, the External References
palette lists and reloads them, and image textures get line-keeping mip
levels so thin underlay lines stay visible when zoomed out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 12:53:25 +03:00
ramox81andClaude Opus 5.5 5ca7becd97 Raster images: transparency off draws pixels opaque; TRANSPARENCY command
An image's transparency flag decides whether transparent pixels show what
is behind the image or draw in their stored colour: the image pass and PDF
plots now follow it (it was ignored, so every PNG alpha showed through).
TRANSPARENCY selects images and asks for the mode, defaulting to the first
image's current one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 11:23:19 +03:00
Hakan SevenandClaude Opus 5.5 8c9b485b6c refactor(io): R13/R14 plot flags come from the codec now
opencadcodec a35f43e reads R13/R14 LAYER records as plottable, the root
cause #1507 worked around on load; drop the host-side correction. Its
tests stay and now cover the codec fix end to end. They wrote one temp
file per version and ran in parallel, so each test now gets its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 10:16:19 +03:00
ysdirector 29a252de81 fix(io): R13/R14 layers come back plottable so plots are not blank
The LAYER record only grew a plot flag in R2000: R13/R14 carry frozen,
off, frozen-in-new-viewport and locked as four separate bits and nothing
else, so the reader has no bit to read and leaves `is_plottable` at the
`false` it starts from. Every layer of such a drawing then read as "don't
plot", the plot pass dropped every wire, and PLOT, the preview and
QUICKPRINT all rendered a blank sheet while the drawing still looked right
on screen — display and plot visibility are separate flags, so nothing
about the drawing itself looked wrong.

Restore what the format means by default — a layer plots unless a file
says otherwise — for the two versions that carry the four-bit record, on
both load entry points (bytes and path). R2000 and later keep the flag the
file stores, so a genuinely unplottable layer (DEFPOINTS) stays unplottable.

Tests: an R14 DWG written and read back keeps every layer plottable, the
path-based entry point does the same for R13, a modern file keeps the flag
it stored, and an R14 drawing tessellating to wires that are all
plot_visible locks the whole chain that used to blank the page.
2026-09-28 00:36:24 +08:00
thaile-gt a5468bb8f7 fix(io): normalize missing dimension arrow block references on save 2026-09-27 11:14:36 +07:00
Hakan SevenandClaude Opus 5.5 f537aff75c feat: node graph overlay; move to opencadcodec/opencadkernel/opencadgraph
The codec and kernel repositories and crates are renamed opencadcodec and
opencadkernel. Inside OCS they are depended on under short keys, so code
reads `codec::`, `kernel::` and the new `graph::` (opencadgraph, the node
graph engine). File-format and protocol spellings stay as they were: the
ACIS product id `acadrust`, the ACADRUST_* switches and the plugin
version keys `acadrust_version` / `acadrust_source`.

A button left of MCP on the command line opens a translucent node graph
over the viewport, with a palette of object, input, math, logic, list,
text and geometry nodes added by click or drag. An object node owns
drawing entities and its rows are the Properties panel's own rows for
them: the single-object page is extracted from refresh_properties as
entity_property_sections, values use the control protocol's
property_json, and writes go through set_property_value with a property
target override, so the panel, MCP and the graph share one read/write
path. A list reaching an object row makes one entity per element. Each
graph action is one undo step; the canvas pans and zooms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 07:34:23 +03:00
ramox81 c1ecb0edaf Merge remote-tracking branch 'origin/main' into codex/pdf-attach-parity
# 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/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/control/actions.rs
#	src/app/mod.rs
#	src/app/update/mod.rs
#	src/app/view/modal.rs
#	src/io/xref.rs
#	src/ui/window/mod.rs
2026-09-24 19:38:48 +03:00
ramox81andClaude Opus 5.5 3f6bdf8c59 PDF underlays: attach dialog with pages, underlay tab, layers, import settings and file import, unload on the definition
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-24 18:31:40 +03:00
Luis MartinezandClaude Opus 5.5 dddf60d79e Add audited, versioned MCP save workflow (#1452)
- `--export ... --target-version`, and explicit target_format /
  target_version on automation and protocol saves; a conversion that
  would drop unsupported records is refused unless allow_lossy is set.
- `audit` read op: dangling layers/blocks, duplicate handles, non-finite
  bounds, serialization, lossy records and the source DXF handle graph.
- `save_verified`: writes the requested version from the same snapshot a
  normal save writes, reopens it, checks the version and the entity
  manifest, audits the ASCII DXF handle graph and returns a SHA-256.
- ZOOM EXTENTS includes SDF text glyphs.
- Live MCP acceptance script and an optional reference-console audit
  runner under docs/automation.

Squashed from the PR with review fixes: merged with the DWT save path,
the save snapshot, the tool lists added since, and vendor-neutral
harness names; the dated verification record is left out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-24 16:49:11 +03:00
Hakan SevenandClaude Opus 5.5 163763c42a fix(xref): follow-ups to the xref attach parity merge
- `XREF <args>` runs whole: probing the bare verb first now opens the
  External References palette, which refreshed every entry and toggled
  the palette before `XREF Reload A` / `XREF ?` ran.
- Update the two tests that encoded the old behaviour: `-XREF ?` prints
  the reference table, and attaching a missing file is rejected.
- Drop the duplicate "Specify On-screen" catalog entry that shadowed the
  translated common key, with its unused ftl keys.
- Move `remove_pipe_symbols`' doc comment back above its function.
- Note in `document_for_save` that resolved xref content stays out.
- Gate the desktop-only preview cap and tab index for wasm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-24 15:37:00 +03:00