Commit Graph
100 Commits
Author SHA1 Message Date
Hakan Seven 93b9a840ff refactor(renderer): select paths by GPU limits
Keep storage fast paths on capable adapters and use packed or texture fallbacks only when device limits require them.\n\nCompact mesh-edge varyings to avoid WebGL shader rejection.
2026-07-29 12:49:41 +03:00
Hakan Seven b9799e4421 Update GitHub Sponsors username in FUNDING.yml 2026-07-29 10:56:22 +03:00
Hakan Seven fc97104c81 refactor(web): drop legacy thumb migration
Keep thumbnail storage forward-only. Old recent entries gain previews when their drawings are reopened.
2026-07-29 01:11:17 +03:00
Hakan Seven 969a7605b7 feat(web): show recent thumbnails
Cache previews in OPFS and migrate existing recent entries by reading only their embedded DWG preview data.
2026-07-29 01:09:13 +03:00
Hakan Seven d4e792b2bc feat(web): persist browser state
Keep settings, aliases, and recent drawings across browser sessions.

Load Start-page videos from a Pages-generated snapshot.
2026-07-29 00:44:00 +03:00
Hakan Seven 25166b9508 fix(hatch): preview pattern grip drag 2026-07-28 20:07:10 +03:00
Hakan Seven a36e0d7fdc fix(matchprop): complete property matching 2026-07-28 19:53:39 +03:00
Hakan Seven 99dbc8254d fix(plot): parent PDF save dialog
Remove the temporary EXPORTPDF <path> fallback now that native save requests are tied to the main window.\n\nCloses #537
2026-07-28 19:23:29 +03:00
Hakan Seven d77eb8f419 fix(block): open nested editor tabs
Closes #538
2026-07-28 19:13:27 +03:00
Hakan Seven 00cc17ea55 fix(scene): isolate drawing-space state
Cancel stale interaction state across space changes and keep live previews and zoom extents in their active paper/model context.\n\nRefs #539\nRefs #540\nRefs #541
2026-07-28 18:51:20 +03:00
Hakan Seven 8050fc79fd fix(scene): clear selection after erase 2026-07-28 17:35:21 +03:00
Hakan Seven 05b044f367 perf(scene): make geometry edits incremental
Avoid full document, cache, and GPU rebuilds for entity deltas so add, delete, history, selection, and live polyline edits stay responsive on large drawings.
2026-07-28 17:16:27 +03:00
Hakan Seven 73b8dbe9d4 fix(render): prevent live polyline flicker
Reject segment-count-changing arena patches before mutating GPU buffers so repeated live updates rebuild from a consistent state.
2026-07-28 15:22:57 +03:00
Hakan Seven 8a5bca8aa0 chore(release): v0.8.9 2026-07-28 12:51:38 +03:00
Hakan Seven a30f72f627 fix(start): refine responsive page layout 2026-07-28 12:48:39 +03:00
Hakan Seven 13123d5b34 docs: remove extra root markdown files 2026-07-28 12:31:49 +03:00
Hakan Seven 2ac61bf99a fix(ui): theme remaining interface text 2026-07-28 12:29:31 +03:00
Hakan Seven 28d8246c68 feat(ui): add discussions and semantic theming
Generate web discussion snapshots in CI; native builds use the public
feed and an offline cache.
2026-07-28 11:49:45 +03:00
Hakan Seven 4bf14baea4 feat(ui): add configurable Iced themes 2026-07-28 09:33:12 +03:00
Hakan Seven 73545520c8 refactor(tabs): use context menu widget 2026-07-28 01:34:45 +03:00
Hakan Seven ce1091cea5 refactor(ui): use pin for anchored overlays 2026-07-28 01:25:39 +03:00
Hakan Seven b9de8940bc refactor(statusbar): unify popup menus 2026-07-28 01:02:00 +03:00
Hakan Seven d5be78a187 fix(selection): separate transient visibility
Keep object isolation out of persisted entity visibility and clear stale grips across block-editor transitions.

Refs #512

Refs #517
2026-07-27 23:36:02 +03:00
Hakan Seven 7f41e1666f feat(options): set default save format
Avoid false data-loss warnings when preserving the source format.\n\nCloses #529
2026-07-27 22:37:47 +03:00
Hakan Seven c21f3e1a19 feat(tabs): add drag-and-drop reordering
Closes #526
2026-07-27 22:14:58 +03:00
Hakan Seven b629dc32de feat(wipeout): add polygon creation modes
Closes #528
2026-07-27 21:50:50 +03:00
Hakan Seven ebed0e6e62 fix(statusbar): keep pills right-aligned
Reuse free space on the final wrapped layout-tab row before adding another status-bar row.

Closes #527
2026-07-27 21:33:25 +03:00
Hakan Seven b8889ccd20 feat(mview): add viewport creation options
Support polygonal and object viewports through native clip-boundary handles, including clipped rendering and selection.

Closes #525
2026-07-27 19:28:51 +03:00
Hakan Seven 3d90450b3f build(deps): update AcadIfc revision
Pull the default multileader and table style initialization from AcadIfc.

Refs #523
2026-07-27 18:19:56 +03:00
Hakan Seven a3538ddc45 fix(mleader): use lineweight choices
Replace the raw sentinel input with typed CAD lineweight options so special
values display correctly and unsupported values cannot be entered.

Refs #522
2026-07-27 18:09:28 +03:00
Hakan Seven dce2533767 fix(start): collapse panels by available space
Collapse Tutorials, Supporters, then Recent Documents as the panels stop
fitting.

Refs #519
2026-07-27 17:57:46 +03:00
Hakan Seven 4a30928f5a fix(ui): refine empty drawing state
Show drawing defaults when nothing is selected and disable layout controls on Start.

Refs #514
Refs #515
2026-07-27 17:37:17 +03:00
Hakan Seven 759f2316aa fix(hatch): apply pattern property edits
Closes #476
2026-07-27 16:44:31 +03:00
Hakan Seven ecb29767d4 feat(offset): add multiple mode
Closes #477
2026-07-27 16:21:31 +03:00
Hakan Seven 8018ab1523 feat(view): implement LIMITS command
Closes #478
2026-07-27 16:15:28 +03:00
Hakan Seven a4235a1243 fix(text): show selection highlight
Render tinted SDF glyphs in the final xray pass so base text and wipeouts cannot occlude them.\n\nRefs #479
2026-07-27 14:13:35 +03:00
Hakan Seven cff4903c1e fix(pick): select block-nested MTEXT 2026-07-27 14:05:48 +03:00
Hakan Seven f07118848f fix(io): preserve DXF layout rotation 2026-07-27 13:44:31 +03:00
Hakan Seven 2acc4f7978 fix(io): guard concurrent drawing saves
Hold edit leases and compare disk fingerprints before replacement so another editor cannot be silently overwritten.

Offer retry, reload, Save As, or explicit overwrite recovery.

Closes #498
2026-07-27 13:18:31 +03:00
Hakan Seven 9d973a0fd6 feat(ui): add drawing tab context menu
Refs #493
2026-07-27 13:18:31 +03:00
Hakan Seven 7f1a1ff57b fix(viewport): stabilize grid and grip clipping
Keep the grid on UCS XY, derive spacing from zoom, and clip perspective lines by screen density without dropping the near side.
2026-07-27 11:36:07 +03:00
Hakan Seven e0a2e1ffd3 fix(ci): install web worker bindgen CLI 2026-07-27 01:36:12 +03:00
Hakan Seven b1a52d9229 chore(release): v0.8.8 2026-07-27 01:20:56 +03:00
Hakan Seven 4887a53d66 perf(render): batch and cull mesh instances
Share repeated block geometry across GPU instances.\n\nPatch changed mesh chunks and cull large batches with indirect draws.
2026-07-27 01:11:21 +03:00
Hakan Seven b5f9a06e78 fix(render): split oversized edge buffers 2026-07-26 23:38:42 +03:00
Hakan Seven 6fb68d1c7c feat(scene): integrate DWG object data 2026-07-26 23:38:38 +03:00
Hakan Seven eb23715605 feat(scene): integrate standard DWG data 2026-07-26 22:30:14 +03:00
Hakan Seven 731df4a725 feat(cad): integrate standard codec coverage
Render, edit, query, select, and explode newly decoded standard entity variants. Pin acadifc de8d6b5 and preserve None color semantics.
2026-07-26 19:30:43 +03:00
Hakan Seven 34d0c377e2 fix(3d): complete ACIS solid rendering
- track per-face coverage and retain safe display fallbacks
- tessellate shared NURBS, pcurve trims and periodic surfaces
- pin the matching acadifc decoder revision
2026-07-26 01:35:16 +03:00
Hakan Seven a16914a22a build: pin CAD round-trip fixes 2026-07-25 23:54:02 +03:00
Hakan Seven a22681e751 fix(io): prevent lossy Save As
Use the verified acadifc round-trip fixes and warn for every unsupported object or entity the selected format would drop.
2026-07-25 23:02:05 +03:00
Hakan Seven bca65600cd fix: stabilize web loading and paper rendering 2026-07-25 21:34:29 +03:00
Hakan Seven fe49cc8eb5 revert(web): drop vendored iced renderer
Keep iced_wgpu external and leave the WebGPU storage-buffer optimization out of scope.
2026-07-25 19:24:32 +03:00
Hakan Seven deec48ad99 perf: keep heavy work off UI thread 2026-07-25 18:49:18 +03:00
Hakan Seven 12bf126646 perf: remove large drawing stalls
Keep resident geometry and GPU resources stable across edits, MSPACE zoom, and Model/Paper switches. Add unified PERF output for tracing remaining costs.
2026-07-25 13:34:48 +03:00
Hakan Seven 2bc4c1c8f3 perf: eliminate initial hover freeze 2026-07-25 10:09:23 +03:00
Hakan Seven 47423eae18 build: pin DBCOLOR round-trip fix 2026-07-25 09:22:35 +03:00
Hakan Seven 39449ec684 perf: speed large drawing workflows 2026-07-25 09:05:52 +03:00
Hakan Seven 97be4fefaa build: update acadrust DWG pipeline 2026-07-25 03:32:31 +03:00
Hakan Seven 71e0b88839 perf: optimize large drawing workflows 2026-07-25 02:58:46 +03:00
Hakan Seven 1c7e4bb850 perf: reuse interaction index after edits
Remap immutable base candidates and cache only changed-wire indexes so block-heavy drawings avoid rebuilding millions of primitives on pointer movement. Build 3D BVHs lazily for plan views.
2026-07-25 01:34:49 +03:00
Hakan Seven da34c6817a perf: eliminate dense edit stalls
Keep resident wires, draw depths, GPU slabs, and edit history incremental across entity changes. Defer rollover work to avoid cursor jumps on dense drawings.
2026-07-25 01:06:00 +03:00
Hakan Seven ea93e169ea perf: make edit history incremental
Replace full-document snapshots with Arc first-touch deltas and batch cache invalidation. Reuse interaction and GPU category caches across unrelated edits.
2026-07-24 23:25:33 +03:00
Hakan Seven 90714d34b2 perf: expand spatial interaction indexing
Share subprimitive broad-phase queries across snap, hover, selection, hatch, and mesh paths while preserving exact hit tests.\n\nRefs #433
2026-07-24 22:00:40 +03:00
Hakan Seven 4db763ef27 perf: unify spatial interaction queries
Dense drawings previously rescanned full geometry for snapping, tracking, and selection.\n\nRefs #433
2026-07-24 20:49:05 +03:00
Hakan Seven ece5598372 fix: correct viewport stretch and SHX plots
Anchor the opposite viewport corner during grip and STRETCH resizing.
Match plotted stroke-font pen widths to the SDF atlas unless CTB overrides.

Closes #435
2026-07-24 19:26:10 +03:00
Hakan Seven ceddb287f5 fix(renderer): match leader and dash styles
Read canonical ACAD/DSTYLE overrides for leader color and arrow size. Scale block-local linetype patterns through INSERT transforms.

Closes #436
2026-07-24 19:04:57 +03:00
Hakan Seven 7a1c0ead0d fix(xref): preserve layer-zero colors
Treat namespaced XREF layer |0 as layer zero during block inheritance so ByLayer geometry keeps its source color.\n\nCloses #437
2026-07-24 18:43:04 +03:00
Hakan Seven a0558e187c fix(pick): tighten XREF text hit test
Test SDF glyph quads instead of a style-batch union AABB so empty gaps inside XREF content do not preselect the insert.\n\nCloses #438
2026-07-24 18:35:39 +03:00
Hakan Seven a413f75548 fix(snap): preserve OTRACK precision
Keep tracking geometry in f64 until screen projection so typed and dynamic distances no longer expose f32 drift.\n\nCloses #439
2026-07-24 17:56:06 +03:00
Hakan Seven 658aa4a4a5 fix(start): complete Start page workflow
Track Save As paths, persist the selected section, and size tabbed
panels from their actual available width.

Refs #443
2026-07-24 17:44:07 +03:00
Hakan Seven 77ea43fb96 fix(dwg): pull AC15 locator fix 2026-07-24 17:44:02 +03:00
Hakan Seven 91326e9a0c fix(renderer): add automatic compat fallback
Use packed wire and texture-backed hatches on low-limit adapters.

Refs #475
2026-07-24 17:05:54 +03:00
Hakan SevenandClaude Opus 4.8 2ff37b088b fix(camera): re-derive ortho near/far per frame so orbit never clips
The orthographic depth half-range was frozen at fit time and measured along
the fit-time eye direction. A 3-D drawing fitted straight-down (top view) got
a shallow depth span; orbiting only rotated the camera, never resized the
span, so the drawing's width loaded onto the eye axis and overran near/far —
clipping the model the moment it was tilted off top (#473).

Cache the model AABB on the camera and recompute the near/far depth from it
for the live eye direction every frame. This tracks orbit, viewcube snaps,
roll and restored views uniformly, and keeps the same tight, zoom-independent
depth precision (coincident solids / meshes / wires keep their draw order).
Falls back to the scalar half-range / distance-scaled span when no AABB is set.

Closes #473

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 14:57:16 +03:00
Hakan SevenandClaude Opus 4.8 8c36d3aca8 chore(deps): bump acadrust for down-saved gradient false-positive fix
Solid hatches carrying stale GradientColor1/2ACI EED (no ACAD_XREC_ROUNDTRIP
XRecord) no longer resurrect as a two-colour gradient — red / ACI-253 solids
now render solid instead of blue→yellow.

Closes #471

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 14:45:04 +03:00
Hakan SevenandClaude Opus 4.8 d59f90992c fix(dxf): tapered R12 polyline widths via acadrust c209306
Heavy 2D POLYLINE vertices with absent width codes now inherit the
polyline default while explicit-zero segments stay zero, so tapered
polylines (e.g. sample_AC1009 handle 0x35B) render variable-width
instead of constant — matching the DWG/LWPOLYLINE form.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 13:52:32 +03:00
Hakan SevenandClaude Opus 4.8 6ba8bb15bc chore(deps): bump acadrust for R12 paper-space entity placement
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 13:11:50 +03:00
Hakan SevenandClaude Opus 4.8 106fbbec71 chore(deps): bump acadrust for R12 block-content owner fix
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 12:54:24 +03:00
Hakan SevenandClaude Opus 4.8 4d898aeead chore(deps): bump acadrust for pre-R2004 MTEXT bg fill recovery
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 12:41:39 +03:00
Hakan SevenandClaude Opus 4.8 95bc47e084 chore(deps): bump acadrust for MTEXT background fill colour fix
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 11:55:36 +03:00
Hakan SevenandClaude Opus 4.8 36bc1a911a chore(deps): bump acadrust for pre-R2004 gradient hatch recovery
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 11:45:19 +03:00
Hakan SevenandClaude Opus 4.8 ce49f4da0a fix(render): DXF leader hookline width + SHAPE name fallback; bump acadrust
Companion to the acadrust DXF-fidelity sweep (bump to 379ce12):
- Legacy LEADER hookline: underline the annotation using the leader's own
  stored text width (DXF code 41) when the MTEXT has no computed extents,
  so the landing spans the text instead of a short stub.
- SHAPE: resolve the glyph by name when the shape number is 0 (DXF SHAPE
  carries only the name), and search shape-file text styles when the entity
  has no direct style reference.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-24 11:30:03 +03:00
Hakan SevenandClaude Opus 4.8 0e61836e91 fix(properties): name AEC / proxy objects instead of "Unknown"
Selecting a proxy object we render from its cached graphics (an AEC
Wall/Door/Window and the like) showed "Unknown" as its type. The entity
now carries its real DXF class name from the CLASSES section (acadrust
bump), so surface it: ui_name_or_class title-cases the class ("AEC_WALL"
→ "Aec Wall") for the properties Type row and the status-bar label, and
still says "Unknown" only when the class truly can't be named.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 23:59:27 +03:00
Hakan SevenandClaude Opus 4.8 8fd03e56ff chore: bump acadrust — resolve pre-R2018 MLINESTYLE element linetypes
Multilines read from an R13–R2017 DWG (e.g. an AutoCAD 2013 save) lost
their per-element linetypes and drew every element solid instead of
dashed / with embedded text; R2018 saves were fine. The crate now decodes
the pre-R2018 bit_short linetype index.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 23:45:30 +03:00
Hakan SevenandClaude Opus 4.8 346f4ce27d fix(wipeout): bias the mask toward the camera so it wins coincident depth
Even collected at the right place, a block-internal wipeout still let
geometry show through: the wipeout pipeline's depth bias was positive,
pushing the mask behind geometry at the same depth (a block's wipeout and
its shapes are coincident at Z=0), so LessEqual rejected it. Bias toward
the camera (constant -8, slope -1) so the mask wins against coincident
2-D geometry, small enough that genuinely nearer geometry still occludes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 23:22:55 +03:00
Hakan SevenandClaude Opus 4.8 de5c35d44a fix(wipeout): mask block-internal wipeouts once inserted
A wipeout defined inside a block never masked the geometry once the block
was inserted — wipeout_models only scanned top-level entities, so the
wipeout was invisible unless you entered block-edit (where it is
top-level). It also drew a stray mask at its raw block-local coordinates
because the top-level scan lacked the block-defn reject the hatch path
uses.

Descend visible inserts and place each block-internal wipeout in world
space, applying the accumulated insert transform via apply /
apply_rotation. Add the belongs_to_visible_block filter so block-defn
wipeouts only appear through the descent, in world space.

Bumps acadrust for the matching transform_wipeout fix: its u/v basis was
double-scaled (apply_rotation then another scale-factor multiply), so a
scaled insert grew the mask; the descent sidesteps that path but the
explode/copy commands need the crate fix.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 23:18:48 +03:00
Hakan SevenandClaude Opus 4.8 d54fb9e2aa fix(render): annotative scale representations + model-space linetype scale
Two rendering defects surfaced on the budweiser benchmark drawings, both
tied to a drawing's annotation scale.

Annotative scale representations. A drawing may materialise each annotation
scale as its own object (here a block insert per scale, on a "0 @ <scale>"
layer, each carrying a per-object AcDbContextData bound to one scale).
Nothing filtered them, so every scale drew at once — a 1× copy stacked
under a 10× one. Add annotative::annotative_offscale and apply it in the
three paths that expand block content: the wire block-defn cache, the
resident/top-level visibility gate (model space only — paper viewports use
their per-viewport frozen scale layers), and the exploded-insert hatch/fill
walk (filtered before normalize strips the handle). An object is shown when
a representation matches the current scale; the off-scale ones are hidden.
When the current scale is unsupported by any representation, fall back to
the base "1:1" copy instead of hiding everything (the object must not
vanish) or showing everything (the copies must not stack).

Model-space linetype scale. PSLTSCALE (a paper-space flag) was applied to
model-space linetypes via the annotation scale, so a drawing saved at e.g.
CANNOSCALE 10:1 drew its linetypes 10× off. Thread a `paper_space` flag
through tessellate_entity and gate the PSLTSCALE factor on it, so it only
scales linetypes for content shown inside a paper-space viewport; model
space keeps LTSCALE × CELTSCALE.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 21:24:56 +03:00
Hakan SevenandClaude Opus 4.8 5e2b67c642 fix(linetype): keep complex linetypes precise at large coordinates
A circle with a complex linetype (embedded shapes/text, e.g. IZOLACE) drew
its dashes and symbols scattered far off the entity at UTM-scale
coordinates. Two defects compounded, both catastrophic-cancellation at a
~1.2M-unit origin:

- The single-entity complex-linetype path fed apply_along the wire's HIGH
  double-single half only (`base.points`), an absolute f32 quantised to
  ~0.1 at 1.2M. Walking the pattern along those points blew the shape /
  dash positions up to ~1e308. Reconstruct the absolute f64 path from
  high+low, re-origin it at the first vertex, walk apply_along in that
  local frame, then lift each result wire back to world with
  shift_wire_to_world (now pub(crate)) — the same local-frame trick the
  MLINE complex-linetype path already uses. Fixes every entity, not just
  circles.

- The circle was tessellated with truck's circle_arc (arc-through-three-
  points), whose fit cancels catastrophically at 1.2M and returned a ~3%
  radius wobble with uneven segments. Tessellate directly as a cos/sin
  polyline (adaptive segment count from the curve tolerance); adding a
  small ±r term to the centre stays precise, and the Lines path RTE-splits
  it. Arc and polyline bulges share the circle_arc root and remain to fix.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 17:16:57 +03:00
Hakan SevenandClaude Opus 4.8 2d3f33de10 fix(leader): suppress oversized arrowheads, keep them precise at UTM
Three defects made a leader's arrowhead render as one stray line far
longer than the leader itself, at UTM coordinates:

- The arrowhead was drawn even when it is larger than the first leader
  segment it sits on. A DIMASZ sized for a bigger plot (here 6 units on a
  ~1-4 unit pointer) painted a stroke longer than the whole leader.
  AutoCAD omits the arrowhead when it does not fit the first segment, so
  gate the arrow on `arrow_size <= first_segment_len`.

- Leader geometry was built as absolute f32. At UTM coordinates (Y ~ 4.5M,
  f32 ulp ~ 0.5) the oblique arrow tick's small cross-slope quantised
  away, collapsing the 45-degree tick into a flat horizontal line. Build
  the path and arrow in absolute f64 — the arrow around a local origin so
  append_arrow's f32 math stays precise — then RTE-split into the double
  single (points_low / fill_tris_low) at the end.

- The `_Oblique` / `_Archtick` arrowhead block mapped to ArrowKind::Tick
  with the full DIMASZ, but the tick emitter draws `size` to either side
  (half-length semantics, matching DIMTSZ). Pass half so an oblique
  arrowhead sizes to DIMASZ like every other arrowhead, not double.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 16:46:55 +03:00
Hakan SevenandClaude Opus 4.8 ec92a0cdc6 chore(release): v0.8.7
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 15:22:42 +03:00
Hakan SevenandClaude Opus 4.8 f1a348260f fix(group): preserve groups when pasting, cross-drawing too
PR #446 kept a fully-copied group grouped for the in-drawing COPY/ARRAY
path, but clipboard paste (Ctrl+C / Ctrl+V, PASTECLIP) runs through
finalize_paste, a separate route that never touched groups — so pasted
copies came out ungrouped, and a cross-drawing paste had no group data at
all.

Unify all copy routes on one shared Scene::recreate_groups(sources,
handle_map): copy_complete_groups now gathers the live source groups and
delegates to it, while paste snapshots the complete groups into the
clipboard at copy time (ClipboardDeps.groups) and recreates them over the
pasted handles. A group whose whole membership is copied now stays grouped
whether the copy lands in the same drawing, via the clipboard, or in a
different file; partially-selected groups still stay ungrouped.

Closes #440

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 15:09:06 +03:00
Hakan SevenandClaude Opus 4.8 6d22671383 Merge PR #446: fix group copies and arc hover-picking
Two fixes from @UserDevtec (Jonathan):
- Copying a complete group now recreates the Group object and dictionary
  entry for the copies (unique NAME_COPYn), so the copy is treated as a
  group too; partial copies stay ungrouped. Undo recording is poisoned
  when groups are copied, since Group objects are non-entity state a
  pure-entity delta cannot restore.
- set_wire_aabb now widens the cull box over the wire's tessellated
  points, not just pick_tris, so bulge arcs that bow outside the stored
  vertex box are no longer rejected before segment hit-testing — arcs
  are hoverable/pickable again.

Builds clean; the AABB change is strictly box-growing so it can only
fix under-sized boxes.

Closes #446

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-23 14:50:29 +03:00
Hakan SevenandClaude Fable 5 e4b1f17522 test(font): cover the Shx face variant in resolution test
`case_insensitive_ttf_resolution` matched `Face::resolve` against Ttf and
Lff only; the SHX shape-font variant added later left the match
non-exhaustive, which failed the whole lib-test build. Add the arm.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 14:09:38 +03:00
Hakan SevenandClaude Fable 5 f2ad1cc0c8 feat(thumbnail): on-screen framing + PNG/RLE8 preview, far smaller files
The embedded DWG preview was the whole drawing fit to a canvas, encoded
as a 24-bit uncompressed DIB (~180 KB at 256²) — the bulk of the gap
between an OCS-saved file and AutoCAD's. Three changes:

- Frame it like the screen. `from_scene` now projects every wire vertex
  through the live camera into a viewport-aspect canvas, so the thumbnail
  is the current pan / zoom / rotation and only the visible region, not
  the full extent. Off-screen / clipped segments don't draw (a `None`
  projection or NaN separator breaks the polyline run). Works for any
  view. `stamp_thumbnail` passes the model pane's pixel size and the
  target version.

- PNG for R2013+ (AC1027+). A line drawing on a flat background is almost
  one colour, so PNG collapses to a few KB. PNG previews are only valid
  from R2013, so older targets keep a BMP.

- BMP is now 8-bit palettised, BI_RLE8-compressed (was 24-bit raw). The
  long single-colour runs of a preview compress to a handful of KB; a
  view with >256 colours (rare) falls back to the 24-bit DIB. A full
  256-entry palette is written so the reader's `(1<<bpp)*4` pixel-data
  offset lands correctly.

Net: the preview drops from ~120 KB to ~2-5 KB on every version.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 14:09:38 +03:00
Hakan SevenandClaude Fable 5 3326c5f0c8 fix(purge): drop orphaned blocks, anonymous blocks, and stale draw-order
PURGE left behind three classes of dead data that AutoCAD removes,
so an OCS-purged drawing stayed far larger than AutoCAD's (a 23 MB test
file purged to 3.5 MB in OCS vs 0.58 MB in AutoCAD):

- Anonymous blocks (`*U`/`*D`/`*T`/dynamic-block variants) were skipped
  wholesale. Leftover unreferenced ones now purge like AutoCAD's, held
  live only when actually referenced.

- Block liveness now comes from REACHABILITY: a block is kept only if it
  is reached from a real layout container by following block references
  (INSERT names, dimension *D, table *T / cell blocks, MultiLeader
  content). The old flat "named by some INSERT" scan could not free a
  mutually-referencing dead subgraph — e.g. the dependent blocks a
  detached xref leaves behind, whose head carried a DANGLING layout
  handle that `is_layout()` mistook for a real layout and shielded. That
  subgraph (here 467k lines) is now purged; live xrefs, reached from the
  layout that inserts them, stay. The used-set also gains the by-handle
  block references (table/MultiLeader/dimstyle-arrow) so purging
  anonymous blocks can't delete an in-use block no INSERT names.

- SortEntitiesTable objects (per-block draw order) were never removed, so
  each purged block's table lingered still listing the handle of every
  deleted entity — 341k stale handles / ~2.7 MB of dead weight the save
  re-emitted. Drop every table whose owning block is gone.

Net on the test file: 3.5 MB -> 0.81 MB (AutoCAD 0.58 MB).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 13:32:26 +03:00
Hakan SevenandClaude Fable 5 1f4bdfa741 fix(save): default Save-As format to the drawing's own version
The Save-As dialog hard-coded the format dropdown to the latest
(DWG/DXF 2018) regardless of what was opened, so a round-trip silently
re-targeted the version. Default it to the loaded document's own version
and DWG-vs-DXF kind instead (from `document.version` + the file
extension), which always matches one of the dropdown options. A new,
unsaved drawing keeps its document default. QSAVE on an existing file
already preserved the version; only Save-As was wrong.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 13:32:26 +03:00
Hakan SevenandClaude Fable 5 0d4bd274b4 style: clear two build warnings
- image_model.rs: drop unnecessary parentheses around a map's array
  literal return.
- text_support.rs: remove dead row_in_column / col_rows computation and
  its unused `li` binding (the only consumer).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 11:39:23 +03:00
Hakan SevenandClaude Fable 5 fc72827428 deps: bump acadrust — don't resurrect disabled gradients on R2004+
Pulls acadrust 022290a: recover_roundtrip_gradients is now gated to
pre-R2004. A native R2018 file whose hatch has its gradient turned off
(is_gradient=0, solid fill) but still carries stale GradientColor1/2ACI
round-trip EED no longer gets a spurious two-colour gradient painted over
it — the arrowhead / "Aluminium shading" hatches render solid as ODA and
libredwg decode them.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 11:39:23 +03:00
Hakan SevenandClaude Fable 5 3689f0e504 fix(dimension): render baked *D fills inside block dimensions
A dimension bakes its geometry into a per-instance *D block, offset into
the owning block by the dimension insertion_point. When that dimension
sits inside a block (INSERT → block → Dimension → *D), only its top-level
form drew; nested it rendered nothing, and once the lines/text/arrow
outlines were routed through the block cache the arrowhead FILLS were
still missing:

- 2D SOLID arrowheads: block_cache's Dimension arm now expands the *D
  block, translating each sub by insertion_point (WCS → block-local) and
  routing Insert subs through build_nested_ref, others through
  tessellate_sub_local (which emits the solid fill_tris).
- Insert(hatch) arrowheads (custom arrow blocks = LwPolyline + Hatch):
  the hatch renders via the separate GPU explosion path, which only
  descends INSERT→INSERT→Hatch trees and so never reached a hatch behind
  a Dimension. block_has_hatch now recurses through a Dimension into its
  *D block, and the fill explosion's new explode_including_dims lifts
  each dimension child's *D content into the owning block's frame
  (translate insertion_point, then apply the insert transform) so its
  arrow inserts / hatches ride the normal walk.

Table *T baked blocks get the mirror treatment in block_cache.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 11:39:14 +03:00
Hakan Seven 1803f10264 Merge PR #442: cut mesh-import wire-set memory ~35% (#358)
entity_wires() returns the memoized Arc instead of a per-call deep copy;
MESH entities over 50k vertices ship no per-vertex snap/key tables
(matching PolyfaceMesh/PolygonMesh); the Face3D/other render split
caches a None marker and uses the base set directly when there is no
Face3D wire; test fix for the depth-map BlockCache::build signature.

Reviewed: correctness sound — wire AABB comes from entity_aabb (not
key_vertices) so large meshes stay selectable; snap consumers are
empty-guarded; the Arc/strong_count reasoning for try_resident_patch
holds. One consistent pre-existing quirk noted (auto_fit_viewport
centroid excludes tableless meshes, as Poly*Mesh already do).
2026-07-23 10:25:27 +03:00