Phase 3.1 (partial — pan). The Model-tile wire cache keyed on the exact
camera hash, so every pan re-tessellated the whole tile even though pan
changes neither the curve tol nor the culled set (beyond a shift). Re-key
on (geometry_epoch, pan_invariant_hash, tessellated_region):
- pan_invariant_hash covers rotation + wpp (tol) but excludes the pan
target, so a pure pan keeps it stable;
- the wires were culled to a 1.25x-margin region, recorded with the entry;
- a hit now also requires the tile's current visible rect to still fit
inside that region, guaranteeing every on-screen wire is present.
Result: panning within the existing margin reuses the tessellation (tess
ms -> ~0 on the PERF HUD) with no missing geometry. Zoom, orbit and edits
change the signature/epoch and rebuild as before; the cull margin is
unchanged so miss cost — and zoom behaviour — is identical. GPU still
re-uploads per camera_generation (diff upload is Phase 3.2).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The purge scan tests every entity with is_entity_corrupt, whose
per-vertex finite/extent checks on large polylines dominate. Detection
is pure and read-only, so gather entity refs in one pass and test across
cores with rayon; removal stays serial (remove_entity needs &mut doc).
Cuts the "purge" span in the open-time breakdown on polyline-heavy files.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Extends Phase 2.1. compute_block_aabbs resolved each defn's union AABB
serially via defn_aabb_recursive, which only reads the finished defns map
and re-walks shared nested defns with no memoization — real cost on
block-heavy drawings. Split into a parallel read phase (per-name resolves
fan out over rayon) and a serial write-back phase. BlockCache is Sync, so
sharing &self across the read phase is sound.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Phase 5.3 (CPU tessellation slice). Add a `PERF` command that toggles an
overlay on the active viewport showing the cost of the most recent wire
re-tessellation: ms, wire count, geometry epoch. Anchored top-left via
position_canvas_overlay.
Timing is captured at the wire-cache miss paths (model_tile_wires_arc,
paper_sheet_wires_arc) and stored in Cells on Scene, read directly by the
UI view (Scene is single-threaded / Rc-based, so build_primitive and view
share a thread). Reads ~0 ms on a warm cache, so it isolates the exact
work a miss costs — the slice 2.2 / 3.1 / 3.3 each move, making them
PR-to-PR comparable.
GPU upload/draw/GPU-wait spans (need wgpu timestamp queries) remain open.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Phase 3.1 (partial). set_hover_highlight bumped the geometry epoch on
every hover-target change, forcing a full model re-tessellation. The
hover handle is folded into the tessellation highlight set as
selected ∪ {hover}, so hovering an already-selected entity contributes
nothing — the effective set and every resulting WireModel are identical.
Guard the bump on the effective highlight contribution actually changing;
hovering over or between selected entities is now free. The field is
still updated so hit-test / UI state stays current.
The full camera/selection-from-tessellation cache split (3.1 / 2.2) is
left open: highlight colour is baked into WireModel.color across several
tessellation sites, so decoupling it needs running-app verification.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Phase 2.1. build_defn stores nested INSERTs as by-name references and
never expands them at build time, so each block defn depends only on the
read-only doc — the builds are independent, not topologically ordered as
the roadmap assumed. Replace the serial loop with a rayon
par_iter().collect(). render_style_for / tessellate already run under
rayon in build_derived_caches, so thread-safety is established.
compute_block_aabbs stays serial (resolves nested refs, cheap post-pass).
Cuts first-frame block tessellation on insert-heavy drawings.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Phase 5.2. Time each open phase — parse, purge, derived-cache build on
the loader thread, plus xref resolve on the UI thread — and emit a
breakdown line on open completion:
parse 1240ms · purge 80ms · caches 340ms · xref 60ms · total 1820ms
Makes open-time regressions (and the wins from 1.1 / 2.4) visible at a
glance. Timings ride back on DerivedCaches; total is wall time from the
Open click to post-xref.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Phase 4.1. Handle / u64 keys dominate the hot maps (block_defn,
hatch / image / mesh caches, draw-depth map, viewport wire caches);
the default SipHash is wasted work on integer keys. Alias the std
types to rustc_hash::FxHashMap / FxHashSet crate-wide so every map and
set — including the cross-module draw-depth map shared between scene
and the GPU pipelines — uses the faster hasher consistently.
Mechanical: no behavioural change. Constructors moved from ::new() to
::default() (Fx variants carry no RandomState). Build + 13 tests green.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Phase 1.1: resolve_xrefs now purges corrupt entities inline as it
merges each xref and returns the dropped count, removing the second
full-document purge_corrupt_entities walk in the FileOpened handler.
Every xref-bearing open saves one O(N) entities() pass.
Phase 2.4: split compute_world_offset into offset_prep / offset_centroid
/ world_offset_from_centers; centroid accumulation now rides the existing
cache-handle walk in build_derived_caches. Two O(N) entity walks collapse
into one, with identical MSPACE-membership filtering preserved.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Row exit now clears the preview only when the highlight still points at
that row. Moving between rows can fire on_enter before the previous
row's on_exit, so the unconditional clear wiped a freshly highlighted
row (notably when returning to the first row). Guarding the clear fixes
the highlight not reappearing.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add a scene hover_highlight handle that renders an entity with the
selection colour without joining the real selection. The cycling list
box sets it on row enter / clears on exit, so hovering a row glows the
matching object in the drawing.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Replace the repeat-click cycling with a list box: when a click lands on
two or more overlapping objects (cycling on), a small list of the
candidates opens at the cursor. Picking a row adds that object to the
current selection (accumulate); clicking outside dismisses it. A single
object under the cursor falls through to the normal click.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add a click_hits_all hit-test and an SC pill that, when on, makes
repeated clicks at the same spot step through the overlapping objects
there (nearest first) instead of accumulating the selection. The whole
cycling path is gated behind the toggle, so default picking is unchanged
when it is off.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add a per-type selection filter to the scene: the FILTER pill opens a
checklist of the entity types in the layout, and unchecking a type
excludes it from interactive picking (click, box and lasso selection all
honour it). The pill lights up while any type is filtered out.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
When the QP pill is on, a compact floating panel appears at the canvas
top-left on selection, reusing the docked panel's editable section rows.
Toggleable from the status-bar customization menu.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add a transparency_enable uniform read by the wire shader: when the new
TPY pill is off, every line is forced opaque; when on, baked entity
transparency shows through. Toggling is a uniform write, no retessellate
(same mechanism as the lineweight-display toggle). Pill is toggleable
from the status-bar customization menu.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Clicking the ISO pill now opens a small menu with Isolate Objects, Hide
Objects and End Isolation instead of ending isolation directly; rows
that don't apply (no selection / nothing hidden) are dimmed. The same
actions are added to the viewport right-click menu.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add a hidden-entity set to the scene that the tessellation visibility
test skips, so hidden objects neither render nor hit-test. New commands
ISOLATEOBJECTS (show only the selection), HIDEOBJECTS (hide the
selection) and UNISOLATEOBJECTS (restore). An ISO status pill lights up
while anything is hidden and restores everything on click.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add a Units pill that shows the drawing's current INSUNITS value and
opens a picker to change it (Unitless, mm, cm, m, km, in, ft, mi, yd).
Toggleable from the status-bar customization menu like the other pills.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add a customization menu (far-right handle) that lists every status-bar
pill with a check mark; toggling a row shows or hides that pill, and the
choice persists across sessions in the config dir.
New pills:
- Coordinates: live cursor readout (re-adds the model-space world offset
so it shows true drawing coordinates), updated on every move rather
than only while a command is active.
- Clean Screen: hide the ribbon and side panels for a full canvas.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Read the model-space annotation scale from the standard CANNOSCALE /
CANNOSCALEVALUE header variables instead of a user-variable hack, and
populate both the status-bar scale picker and the viewport Scale
property purely from the drawing's ACAD_SCALELIST — no built-in
fallback set. Xref-derived scales (`_XREF` suffix, `name|` prefix)
are filtered out so only the host drawing's own scales appear.
Bumps the patched acadrust to the commit that adds CANNOSCALE/
CANNOSCALEVALUE read/write.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Three polyline issues in the FILLET/CHAMFER commands:
- The polyline preview wire ignored bulge, so a filleted corner previewed
as a straight line instead of the arc. lwpoly_pts now tessellates bulge
segments via BulgeArc (same as the entity render).
- Hovering a polyline edge didn't highlight it: the first-pick hover only
handled Line/Arc. Both commands now highlight the nearest polyline
segment on hover.
- CHAMFER didn't work on polylines at all (Line-only). Added a SecondPoly
step + chamfer_lwpoly_corner: pick two adjacent segments of one polyline
to cut the shared corner back by the two distances with a straight edge.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The truck B-rep pipeline is Z-up (solids extrude/raise along Z, profile
wires convert pass-through), but two spots still assumed a Y-up world:
- REVOLVE swapped the axis/origin to (x, z, y), so the revolve axis sat
in the XZ plane while the profile sat in XY → wrong solid. Use the
axis/origin straight through.
- OBJ import kept Y-up coordinates as-is on the (now Z-up) viewport, so
imported meshes lay on their side. Rotate +90° about X on import
(positions + normals): (x, y, z) → (x, -z, y).
EXTRUDE (sweep along +Z) and the box/cylinder primitives were already
Z-up and unchanged.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The trim/extend preview wire for an LwPolyline placed each vertex at
[x, elevation, y] (the old Y-up swap), so the highlighted boundary was
drawn in the wrong plane. Use [x, y, elevation] to match the entity
render and the rest of the now-XY commands.
(The remaining axis swaps live in the 3D revolve / truck B-rep pipeline,
which is a separate, internally-consistent Y-up subsystem.)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The drawing plane is world XY, but break, join, rectangular array, the
stretch/window move, the spline preview wire and several doc comments
still used the stale "Y-up XZ" mapping (world Z = DXF Y). That made
those commands operate against a constant-elevation axis: arc/circle/
line/spline break and join picked the wrong points, rectangular array
stepped rows along the Z (elevation) axis, window-stretch tested the
wrong window bound, and the spline wire drew in the wrong plane.
Map every drawing-plane coordinate through .y (elevation on .z),
matching the entity builders, the inquiry commands and the central
transform. Stale Y-up comments updated to avoid future confusion.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
These commands still read the cursor / entity coordinate with the old
"Y-up XZ" assumption (world Z = DXF Y), which is wrong now that the
drawing plane is world XY: ID/DIST/AREA reported swapped Y↔Z values and
zero-area, and fillet/align/lengthen picked against a constant-elevation
axis. Read the drawing-plane coordinate from .y (elevation stays on .z),
matching the central transform and the entity builders.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The pick/typed point is the world XY plane (z = elevation = 0), but
several entity builders still mapped the screen point as if the world
were Y-up (drawing in XZ), reading the constant elevation as the DXF Y.
That collapsed shapes onto a single line — e.g. a revision cloud always
came out as two horizontal lines regardless of the path drawn.
Map the drawing-plane point straight through (x→x, y→y, z→elevation) in:
revcloud, donut, mline, raster image, wipeout (polygonal + rectangular),
table, attribute definition, and tolerance. Previews already used the
correct pass-through, so they matched the cursor; only the committed
geometry was wrong.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
On some Windows hybrid-GPU laptops the AMD OpenGL driver (atio6axx.dll)
access-violates the instant wgpu enumerates its GL backend at startup,
killing the app before any window appears — even though DX12 works fine.
The crash is inside AMD's proprietary GL ICD, so it can't be fixed
app-side; instead default WGPU_BACKEND to dx12,vulkan on Windows so the
GL ICD is never touched. An explicit user-set WGPU_BACKEND still wins, so
GL remains available via override.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Tables without a baked block (e.g. created in-app) were drawn as a single
monochrome wire, ignoring cell colours/fills/border styling. Add a
coloured synthesis path that emits per-colour WireModels for:
- cell background fill (fill_color + fill_enabled),
- per-cell text in its content/text colour,
- grid borders with per-edge type/weight/colour/visibility (cell-style
override → row-style → default),
- horizontal/vertical margins and flow direction (down/up).
Imported tables keep using AutoCAD's baked block. Resolution layers the
per-cell CellStyle over the TableStyle row style over defaults.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Creating a new MLeader/Table/MLine style (and a new PlotSettings) pulled
the document's next handle without advancing the counter, so two records
created in one session collided on the same handle and the second
overwrote the first. Use allocate_handle(), which reserves and advances.
Also bumps acadrust to pick up DXF annotative-flag persistence.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Table Style editor now exposes every TableStyle / RowCellStyle field:
- General: description, flow direction (Down/Up dropdown).
- Per cell: data type, unit type, format string, plus all six borders
(left/right/top/bottom/horizontal-inside/vertical-inside) with line
type (Single/Double), line weight, color (ACI), double-line spacing
and a visibility toggle.
Border type/visibility apply immediately; the numeric border fields and
data/unit/format are written by the existing "Apply cell" button.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
MLeader Style editor now exposes every MultiLeaderStyle field: line
weight, line type / arrowhead block / text style / block-content blocks
(handle dropdowns from the document's tables), the four text attachments
+ attachment direction, the full block-content group (color, connection,
rotation, X/Y/Z scale, enable scale/rotation), leader & multileader draw
order, align space, and description.
Dimension Style editor adds the last uncovered DIMUNIT field.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The bare STYLE command (sent by the Annotate-tab text-style combo's
"Manage…" button) fell into the LIST arm and only printed the style
list instead of opening the manager. Route no-arg STYLE / TEXTSTYLE to
the dialog, matching DIMSTYLE / TABLESTYLE / MLEADERSTYLE.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The detail-panel scrollables defaulted to shrink-to-content width, so
their vertical scrollbar landed in the middle of the panel next to the
content instead of at the window edge. Make the scrollables fill width
(and drop the dimstyle panel's right padding so the bar sits flush) in
the Dimension, Table and MLeader style editors.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The enum/handle pickers in the MLeader, Table and Dimension style
editors used "Cycle" buttons, which were awkward. Replace them with
pick_list dropdowns:
- MLeader: path type, content type, text angle, text alignment.
- Table per-cell: alignment (9 anchors).
- Dimension: arrowhead blocks (DIMBLK/1/2/LDRBLK) and ext-line linetypes
(DIMLTYPE/LTEX1/LTEX2), options resolved from block_records/line_types.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The arrowhead-block (DIMBLK/DIMBLK1/DIMBLK2/DIMLDRBLK) and ext-line
linetype (DIMLTYPE/DIMLTEX1/DIMLTEX2) Handle fields are now editable in
the Dimension Style manager. Each shows the resolved block-record /
linetype name and a Cycle button that advances through the available
records (NULL = Default arrowhead / ByBlock linetype). Edits bump
geometry so dimensions re-render with the new arrowheads/linetypes.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Each row's RowCellStyle is now editable in the Table Style manager:
text style name, text height, text & fill color (ACI), background-fill
toggle, and alignment (cycle through the 9 anchor positions). Margin and
per-cell buffers load on open/select via a shared load_tablestyle_bufs;
edits write through objects.values_mut() and bump geometry so tables
using the style re-render.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
New dedicated style-manager window for MultiLeaderStyle objects (the
existing mlstyle window edits MLineStyle, not multileader). Opened via
the MLEADERSTYLE command / ribbon manager entry.
Editable across Leader Format / Structure / Content sections:
- path/content/text-angle/text-alignment enums (cycle buttons)
- line & text color (ACI), arrowhead & break-gap sizes
- landing distance/gap, max points, segment angles, scale factor
- default text, text height
- enable landing/dogleg, text frame, text-always-left, annotative
New/Delete/Set-Current style management.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The Table Style editor's General fields are now editable: H/V cell margins
(buffers + Apply) and title/header row-suppressed toggles, loaded from the
selected style on select. Per-cell (Data/Header/Title) text/fill/border
editing remains a follow-up.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Adds the remaining ~40 DIMSTYLE variables across the tabs (and a new
Alternate Units tab): dim/ext line colors+lineweights, fixed-length ext
lines, separate arrow blocks, arc symbol, jog angle, text color/justify/
vertical pos/fill/direction, fit options (DIMATFIT/DIMTIX/DIMSOXD/DIMTMOVE/
DIMUPT/DIMTOFL/DIMFIT), decimal separator, rounding, zero suppression,
fraction + angular units, alternate units, and tolerance vert-just/zero
suppression. Only the arrowhead-block / extension-line-linetype Handle
references are left (they need a block/linetype picker).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The table-style details panel gains an Annotative checkbox that flips the
new TableStyle.annotative flag, rounding out annotative across the Text,
Dimension and Table style editors.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Adds the annotative property (DsField::Annotative) to the dim-style edit
buffers, load/apply, and a checkbox on the Fit/Scale tab — consistent with
the Text Style editor's annotative toggle.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Expands the Text Style manager beyond font/width/oblique: big-font and
TrueType font fields, fixed text height, Backward / Upside-down flags, and
an Annotative toggle (applied live). Bumps acadrust for the annotative
field.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Reworks MLEADER text/leader geometry and grip editing, and aligns LEADER
to MLEADER's conventions (kept as separate entities).
Text & landing (render path):
- Text is side-anchored on the leader-facing edge and reads outward; the
side, alignment and the horizontal landing are recomputed every frame
from the text grip's position relative to the leader, so moving the
arrow or the text re-mirrors the whole layout and the landing stays
attached to the text's near edge.
- Fixes#49: text was centred on the leader endpoint regardless of side.
Grips:
- Text-location grip plus an MTEXT-style triangle wrap-width grip at the
box's far edge; dragging it sets the MText wrap width.
- Multifunction grip menu restored and made functional: leader-line
vertices offer Add Leader / Remove Leader (Add grabs the new arrow so it
follows the cursor — click places, Esc removes it); the text grip offers
Move Independent (text only) and Move with Leader (translates the whole
multileader via a move-all sentinel grip).
Arrows:
- LEADER and MLEADER arrowheads now render at the same size (text height),
matching previews.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The editor overlay's anchor was only clamped to the top/left edge, so an
MTEXT placed near the right/bottom of the viewport pushed the 640px panel
(and its toolbar buttons) off-screen where they were unclickable.
Both the MText editor and the single-line TEXT editor now receive the
viewport canvas size and clamp the anchor against the right/bottom edges
too, so the whole panel stays visible and usable wherever it is opened.
Fixes#52
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Each model-space tile now carries its own visual style instead of one
global mode shared by every pane:
- ModelTile gains a `render_mode`; the active tile renders with the live
picker mode, inactive tiles keep their stored style, so changing one
tile no longer changes the others. Split inherits the source style.
- SetRenderMode writes only the active tile; switching the active tile
mirrors its style back into the tab (picker + live render).
- Persisted through the *Active VPORT entries (acadrust now round-trips
the render mode via DXF code 281 / DWG RC 281), restored on open for
both tiled and single-tile model layouts.
- Bump acadrust to pick up the VPORT render-mode field.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Two paper-space rendering fixes:
- The full-canvas sheet instance no longer draws model-block hatches/
wipeouts/images. Those belong inside the floating content viewports;
rendering them on the sheet let them bleed past the viewport borders
when model coords overlapped the paper area. The sheet now draws only
the paper block's own fills plus the synthetic white printable area.
- Pan/zoom/orbit inside a double-clicked floating viewport (MSPACE) now
re-culls and re-uploads the viewport's wire set. The per-viewport wire
cache key now hashes the viewport's own view (pan + zoom + orbit), and
the active-viewport pan/zoom/orbit handlers bump camera_generation so
the GPU re-uploads. Previously the stale frustum-culled subset stayed
on the GPU, so newly-revealed lines were invisible (hatches, uploaded
as the full set, still showed) until MSPACE was exited.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Switching between Model and a paper layout reset the camera to the last
saved state. The current camera was only written to the document on a
periodic tick, which may not have run since the last pan/zoom — so the
camera of the layout being left was lost. Sync it explicitly before
set_current_layout so returning restores where the user left off.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The overall "sheet" viewport now IS the paper view, so its own border
rectangle must not be drawn as an entity — filter it out of
paper_sheet_wires_arc (content viewport borders are kept).
Also update the doc comments that still referenced the removed
PaperCanvas widget / paper_canvas_wires to describe the GPU sheet path.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Paper space now renders entirely through the unified GPU shader, exactly
like model space — there is no separate 2-D canvas. The full-canvas
top-locked "sheet" viewport draws the layout's entities, hatches,
wipeouts and images; the desk is the container background and the white
printable area is a synthetic solid hatch.
- The white sheet fill uses draw_depth -2.0 (entity fills/wires are in
the signed (-1, 1) range) so it is always strictly behind every object,
with a negligible z offset (BIAS 0.001) — no far-plane clipping.
- Delete src/scene/paper_canvas.rs (the PaperCanvas widget) and its dead
helpers (paper_canvas_wires / paper_sheet_wires / paper_canvas_cache).
paper_canvas_hatches / _wipeouts remain — still used by paper hit-test.
Co-Authored-By: Claude Opus 4.8 <[email protected]>