Commit graph

1,779 commits

Author SHA1 Message Date
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 Seven
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 <noreply@anthropic.com>
2026-07-24 14:57:16 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-24 14:45:04 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-24 13:52:32 +03:00
Hakan Seven
6ba8bb15bc chore(deps): bump acadrust for R12 paper-space entity placement
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 13:11:50 +03:00
Hakan Seven
106fbbec71 chore(deps): bump acadrust for R12 block-content owner fix
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 12:54:24 +03:00
Hakan Seven
4d898aeead chore(deps): bump acadrust for pre-R2004 MTEXT bg fill recovery
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 12:41:39 +03:00
Hakan Seven
95bc47e084 chore(deps): bump acadrust for MTEXT background fill colour fix
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 11:55:36 +03:00
Hakan Seven
36bc1a911a chore(deps): bump acadrust for pre-R2004 gradient hatch recovery
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 11:45:19 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-24 11:30:03 +03:00
Sebastian
b7dc62ffa5 Add handler for document_cache for REPL 2026-07-24 00:30:22 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-23 23:59:27 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-23 23:45:30 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-23 23:22:55 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-23 23:18:48 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-23 21:24:56 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-23 17:16:57 +03:00
Hakan Seven
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 <noreply@anthropic.com>
2026-07-23 16:46:55 +03:00