- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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).
Brings the pre-2.0 SAT parse (single-line header, numeric edge/coedge
sense) so R14's ACIS 1.6 solids mesh into a full box, and the R13/R14
dictionary-key trim so an XCLIPped block resolves its spatial filter and
clips instead of drawing whole.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Brings two R14 (AC1014) decode fixes: down-saved gradient hatches now
recover through the case-insensitive EED / garbage-suffixed dictionary
key, and the R13/R14 DimStyle field block is finally read (DIMASZ /
DIMTAD / DIMGAP were stuck at defaults). The latter lets a leader hook
its annotation text — leader 1298's underline now spans the MTEXT
extents, matching the AC1032 render.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Solid hatches carrying GradientColor1ACI/GradientColor2ACI EED plus an
ACAD_XREC_ROUNDTRIP gradient XRecord now decode back into a real
gradient, so R2000-down-saved gradient fills render blue→yellow instead
of a flat solid. Color::rgb() already resolves the ACI stops, so the
existing gradient path picks them up with no render change.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Brings the pre-v700 (R2000) SAT edge decode fix: v400 edges omit the
start_param/end_param doubles, so reversed coedges were reading the
curve pointer as a vertex and every face with a reversed coedge loop
dropped out of the mesh. AC1015 solids/regions now tessellate to the
same triangle counts as the AC1018/AC1032 SAB decode (full box instead
of an open shell).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The horizontal attachment point was read from the entity-level field,
which only exists from R2010 on; older records (R2007 and earlier) left
it at the default and centre/right-attached leaders shifted. The
annotation context carries the same value in every version, so anchor
from there for both the render and the width-grip geometry.
acadrust bump also brings: the R2007 MULTILEADER tail gating (leaders no
longer render upside-down), the R2004-R2006 inline SAB payload read, the
v1-SAT wireframe point_present decode (3D solids/regions land in place
on R2000/R2004), and the XCLIPFRAME default of 2 so clip-frame borders
draw on files whose header omits the variable.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Document linetypes referencing ltypeshp.shx glyphs (ZIGZAG, BATTING,
TRACKS) skipped their shape elements whenever the shape file wasn't on
disk — the usual case for traded drawings. The standard ltypeshp
numbers now bridge to the bundled LFF substitute shapes (130 TRACK1,
131 ZIG, 132 BOX, 133 CIRC1, 134 BAT); a resolvable file still wins
with the real SHX glyph.
The element rotation also converted twice: DWG stores radians, the
segment field carries degrees (the .lin unit), and the walker calls
to_radians() — a 180°-flipped second copy rendered at ~3°, folding the
below-baseline half of ZIGZAG/BATTING up onto the line. Convert at the
document boundary.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The wipeout pass ran after the wire pass with no draw-order bias, so
the mask erased its own boundary frame (and everything else at its
plane regardless of draw order). The mask uniform now carries the
entity's draw-order depth (uniform grows 80 → 96 bytes) and biases its
clip-z like every other pipeline, and the frame wire rides a
+half-rank override — the later mask pass fails the depth test at the
frame's pixels, so the boundary stays visible, while entities drawn
above the wipeout are no longer erased.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SPHERICAL/HEMISPHERICAL gradients painted colour 1 at the centre;
AutoCAD's convention is colour 1 at the rim and colour 2 at the centre
(the INV variants swap them back). Both the native and the WebGL2
shader now mix the radial branch outside-in; linear/cylinder/curved
are untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Element lines were re-derived from the style's flat offsets along the
vertex miters, but the file already stores the real numbers: each
vertex's per-element parameter list starts with the offset measured
ALONG THE MITER — corner lengthening (1/cos of the half-angle),
justification and scale baked in — followed by draw/gap toggle
distances along the segment, which is how crossing multilines cut
each other. Re-deriving pinched the channel at every corner (the ends
looked flared) and drew full uncut lines through crossings, stacking
intersecting multilines on top of each other.
mline_lines now consumes the stored parameters directly (runs chain
across vertices when continuous; an odd toggle count leaves the last
run open to the segment end) and computes end caps from the actual
per-vertex offsets. Files without parameters keep the style-offset
fallback.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The SHX reader now serves all three consumers instead of just SHAPE
entities:
- Complex-linetype shape elements stopped being skipped: a document
linetype's Shape{number} resolves its style's shape file (shared path
fallbacks) and draws the real glyph; `.lin` catalog references keep
the file token and look the shape up by name. The converted-LFF
substitute set remains the fallback for anything unresolved.
- Face::Shx renders resolvable on-disk .SHX text FONTS with their real
stroke glyphs: character code → shape lookup, cap height normalised
to the 9-unit space every stroke-font consumer expects, advance from
the interpreter's final pen position, line spacing from the shape #0
above/below header, TTF fallback per missing glyph.
resolve_text_style resolves a style's .shx next to the drawing and
passes the absolute path through; unresolvable names keep their LFF
substitutes. Shapes-only files (no #0 header) are refused as fonts.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SHAPE entities only drew a diamond placeholder — .SHX files were never
parsed. A new reader (scene/text/shx.rs) decodes the classic
`AutoCAD-86 shapes 1.0/1.1` container and interprets the full shape
bytecode — pen up/down, scale divide/multiply, position push/pop,
subshapes, signed XY runs, octant/fractional/bulge arcs, the 16
direction vectors and the vertical-only skip — into unit-space
polylines, cached per file and per shape number.
The entity resolves its STYLE by handle (name fallback), the style's
shape file with the shared path fallbacks (as stored → relative to the
drawing → basename next to it; traded files carry foreign absolute
paths), then places the glyph with size × relative X scale, oblique
shear and rotation through the OCS mapping. load_file now records
doc.source_path so render-time resolution knows the drawing's folder.
A missing or unreadable shape file keeps the diamond placeholder.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Image textures were created Rgba8UnormSrgb: sampling decoded sRGB to
linear, but the surface isn't sRGB, so every raster (images, OLE, PDF
underlays) rendered visibly dark. Rgba8Unorm passes the texels through
in the same space as every other colour in the app.
The frame wire also always carried the X diagonals — that's the
broken-reference placeholder, and it scribbled over resolvable images.
The diagonals now draw only when the reference doesn't resolve.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PDF underlays only drew their clip outline / insertion cross; the page
itself never appeared. The chain now runs: the definition's file path
resolves with the raster-image fallbacks (as stored, relative to the
drawing, basename next to the drawing — attach-time relative paths go
stale), the page rasterises through the system pdftoppm (poppler) at
150 dpi — no new crate; missing tool degrades to the outline — cached
per (path, page) including negative results, and the pixels feed the
existing image pipeline as an ImageModel: 1 underlay unit = 1 PDF inch
(px/dpi × entity scale), rotated about the insertion, fade as opacity,
the clip polygon (non-inverted) as the textured region. Draw-order,
layer visibility and per-viewport freezes ride the generic image path;
in-place edits rebuild through the shared image seed.
When the page renders, the wire path draws its frame with an interior
pick surface instead of the lone cross, so selection covers the visible
page. wasm keeps the outline placeholder (no external process).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The annotation context is AutoCAD's baked display state; the renderer
now trusts it instead of re-deriving:
- text_attachment_point (L/C/R) is the stored horizontal anchor — the
leader-side guess shifted centre/right-attached texts by their width.
- ctx.text_direction/text_rotation apply as stored; forcing the
Horizontal angle type to 0 un-rotated angled leaders. The conn.y
baseline snap now applies only to unrotated text.
- The dogleg runs along the leader root's stored direction (angled
leaders drew it world-horizontal), and vertically-attached leaders
draw no dogleg at all.
- Underline attachments (BottomLine / BottomOfTopLineUnderline…) draw
the leader-coloured rule under the attached line(s), full text width.
- Vertical text flow (ctx.text_flow_direction) feeds the shared
vertical layout; frame/background boxes wrap the laid-out glyph
bounds padded by ctx.landing_gap, and run-less decoration strokes +
inline \C colours reach the output instead of being dropped.
- The wrap-width grip rides the shared flow_grip_axis() (rotation, flow
and attachment side), and its drag projects on the same axis.
acadrust bump: every MULTILEADER decodes (has_ds peek), MTEXT
top-to-bottom direction reads correctly.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Vertical (top-to-bottom) text used to reuse the horizontal line stack —
every line landed on the same baseline and overlapped. The layout now
stacks each character in its own 1.4h cell down the column, one column
per paragraph (1.2h apart), with word-boundary column wrap against the
defined width (which measures COLUMN LENGTH for vertical flow — the
horizontal pre-wrap is disabled there). Justification anchors place the
column block from wrap-accurate metrics: the pre-pass simulates the
render's word wrap exactly, so right/centre/bottom-attached blocks stay
put as columns grow. Layouts also report pre-rotation local_bounds so
frames and fills can box what was actually drawn.
Width grips route through one shared helper, flow_grip_axis(): the flow
axis (rotated baseline, or down the column) plus an attachment-side
factor — a right-attached text forms LEFT of its insertion, so its grip
sits there too; centre attachments use ±half. MTEXT's grip and drag
projection both use it, covering all 9 attachments × both flows × any
rotation from a single table.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The embedded solid display-cache wires are body-local (unplaced), and
R2013+ AcDs-backed solids used to misparse them into garbage points near
the origin — a clipped region rendered a stray fragment at (0,0,0). When
the ACIS payload parses, the mesh pipeline (fill + feature edges +
isolines, all body-placed) is the authoritative render, so the wires now
only serve as a last resort for unreadable ACIS data.
acadrust bump brings the decoded wireframe section and real reference
points: solids/regions report the file's stored bounding-box centre (or
a geometry-derived one) instead of (0,0,0), which feeds OCS grips,
Position properties and insertion snaps.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fill triangles (DIMTFILL backgrounds, MLEADER masks, hatches) carry the
entity's draw-order rank, but SDF glyph quads were pushed at neutral 0.0
— any entity in the front half of the draw order had its own background
fill painted over its text. gather_text_verts now adds the host wire's
wire_draw_depth to each glyph: a text background lands at the same
biased depth (glyphs draw after fills and win the LessEqual test), and
text respects draw order against other entities' fills too.
The #403 glyph-reuse fast path gains a rank-stability gate: adding or
removing an entity shifts every sibling's bias (the rank denominator
changes), so reuse is only safe across all-Modified edits.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Clipped INSERTs cut their content correctly but never showed the
boundary itself. When the header XCLIPFRAME is 1 or 2 (visible), a
closed ring over the world-space clip polygon now rides the insert's
resolved colour and line weight. The frame is deliberately not clipped —
it is the boundary — and carries no snap points.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A constant ATTDEF renders as block content, but with an empty default
value there is nothing to draw — the ATTDEF tessellator would fall back
to its tag-placeholder preview (meant for standalone definitions), so
blocks showed the literal tag text where AutoCAD shows nothing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DWG stores no "hookline exists" flag (only the direction bit), so every
DWG-loaded leader kept hookline_enabled=false and drew no hook. Derive
it: a text-annotated leader hooks when its final segment leaves the
horizontal by more than 15°, shared by the render and snap/grip paths.
Hook length comes from the dim style like the arrowhead (DIMASZ ×
DIMSCALE), and with DIMTAD "text above" it extends under the annotation
to the far edge of the MTEXT's laid-out extents — newly exposed by
acadrust (lock bumped); the old text-height heuristic stays as the
no-style fallback.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fit_spline_polyline bailed to a straight chord below three fit points,
ignoring the stored begin/end tangents — a short tangent-clamped spline
rendered as a line. The C² solver handles n=2 as-is (both end rows are
clamp or natural conditions), so only the guard drops to n<2; tangentless
two-point splines still solve to the straight chord.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The SAB reader tokenizes an ACIS transform record's matrix rows and
translation as Position triplets, while SAT text yields 13 individual
floats. body_transform() collected only float tokens, so every binary-SAB
solid/region (R2013+ AcDs payloads) lost its placement and rendered at
the body-local origin. Flatten Position tokens into the numeric run.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
text_font_rendering.rs still called BlockCache::build with the pre-
depth-map signature, so 'cargo test' failed to compile on main. Pass an
empty map — the test exercises glyph tessellation, not draw order.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The per-epoch Face3D/other split cloned every wire into two owned lists
even when the face3d list came out empty — for pure 2-D drawings and
mesh imports (#358) the 'other' list was a wire-for-wire copy of the
entire base set, held resident in split_cache alongside the original.
Cache None as an 'everything is other' marker and hand the render the
base set itself for that frame. The base Arc is deliberately not stored
in the cache: try_resident_patch can only apply an incremental patch
while the resident Arc is uniquely held, so pinning it there would
silently degrade every edit to a full rebuild.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The subdivision MESH converter emitted one snap candidate and one key
vertex per mesh vertex — ~56 B/vertex retained in every copy of the
wire set. On NWD-scale imports (#358: tens of millions of vertices)
that is GBs spent on snap targets far too dense to distinguish on
screen. PolyfaceMesh and PolygonMesh already ship empty tables at any
size.
Above 50,000 vertices, ship none. Smaller meshes (including the #358
repro sample at 34.6k vertices per mesh) keep vertex snap unchanged.
Measured (mem_probe_meshent, 1M-triangle MESH): 646 -> 589 B/face
resident; wire content 210 -> 183 MB per 1M triangles.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
entity_wires() cloned the entire wire set — every point, fill, and snap
buffer of every entity — on each call, although the set is already
memoized behind an Arc and none of the 18 call sites mutates it. On
large mesh imports (#358: 42M faces, ~210 MB of wire content per 1M
triangles) that is a multi-GB allocation + memcpy on every pick, snap,
selection, or plot pass.
Return the Arc instead. Call sites iterate as before; the two
window-plot paths that build a culled owned subset now clone only the
wires inside the plot window, and the print pipeline moves the Arc into
its async task.
Measured (tests/mem_probe_meshent.rs, 1M-triangle MESH, release):
resident after entity_wires() drops 758 -> 547 MB (866 -> 646 B/face).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Hatch/wipeout boundary sub-loops were separated by NaN vertices that the
fill shaders detected with `p.x == p.x`. Intel Mesa folds that NaN
self-compare to `true` under fast math, so separators read as real
vertices, the ray-cast crossing count broke, and fills bled outside
their boundary — only on Intel iGPUs. GPU uploads now rewrite the
separators to a finite 1e30 sentinel (GPU_BOUNDARY_SEP) and the shaders
test `abs(x) < 1e29`, which every driver evaluates identically. The
CPU-side NaN representation is unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PICKADD 0 = click/box/lasso replaces the selection (Shift toggles),
empty click clears; PICKADD 1 (default) keeps today's accumulate.
PICKDRAG 1 = press-drag spans a rectangle marquee through the box
machinery; PICKDRAG 0 (default) keeps the freeform lasso. Both persist
in settings.json. Also re-points the start-page gate test at the
start_allowed fn it moved into (#388/389 refactor left it broken).
Closes#226
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MATCHPROP copied only the general properties (and text style/height),
so matching dimension-to-dimension or hatch-to-hatch looked like it did
nothing — the visible differences live in type-specific style fields.
General set gains transparency. match_special_props transfers every
STYLE-affecting field the destination supports — never content or
placement:
- Text: style, height, width factor, oblique (style+height cross
TEXT <-> MTEXT); MText adds line spacing, drawing direction and the
background fill block.
- Dimension / Leader / Tolerance: the dim style name crosses all
three, and the ACAD_DSTYLE override record is replicated through
set_entity_xdata (cleared on the destination when the source carries
none, so the match is exact). Restyled dimensions drop their baked
*D block and repaint immediately.
- Hatch: pattern definition, type, angle, scale, solid flag and
gradient — the boundary stays.
- LwPolyline: constant width (vertex widths included) and linetype
generation.
- MultiLeader: style plus all style overrides (path type, line
color/type/weight, landing/dogleg, arrowhead, text style/color/
frame/height, overall scale, override flags); leader geometry, text
and block content stay.
Closes#281
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PEDIT reworked around a mode machine:
- Picking a line/arc asks "Object is not a polyline. Turn it into one?
[Yes/No] <Y>" — Yes converts in place (arc keeps its bulge) and
editing continues on the result. Pickfirst: an already-selected
polyline skips the select step, a selected line/arc goes straight to
the convert prompt.
- Join gathers with the normal selection system (single picks AND
window/crossing boxes) and merges through the JOIN machinery.
- Fit replaces every segment with a classic equal-parameter BIARC: two
arcs per segment meeting tangentially at an inserted knee, both
segments at a vertex sharing that vertex's tangent — the whole run is
tangent-continuous (verified: zero tangent jump on L/closed/zigzag/S
shapes). Spline resamples the vertex frame as a uniform cubic
B-spline (8 samples per span); Decurve straightens every bulge.
- Earlier hardening kept: undo snapshot before the mutation, immediate
repaint, polyline-only pick validation.
- Vertex editing lives on grips, so no Edit-vertex submode; instead the
vertex grip hover menu gains Break — a closed polyline opens at the
vertex, an open one splits into two (interior vertices only),
handled driver-side as an entity replacement.
JOIN itself: segs_of now emits one segment per span of an OPEN
polyline (bulges kept), so polylines merge with their neighbours —
PEDIT Join's set always contains the target polyline and used to abort
every time; plain JOIN had the same gap. JOIN also honours pickfirst:
launched with two or more objects selected it joins them immediately.
Closes#263
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PLAN acted like a ViewCube TOP click the moment it ran — already on Top
meant an immediate flip to Bottom, and the options never appeared. It
now prompts "[Current ucs / Ucs / World] <Current>:" right on
activation and only changes the view once an option runs: Current =
plan of the active UCS, World = world XY, Ucs = prompts for a named UCS
(case-insensitive lookup). The new plan_snap goes straight to the plan
view with no flip-to-opposite cube behaviour.
KeywordCommand gains with_default(): a bare Enter at the verb step
dispatches the default verb (PLAN's <Current>) instead of cancelling.
Closes#326
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every angle row went through the linear formatter, so switching LUNITS
to Architectural showed a block's Rotation as feet-and-inches — and the
string wouldn't parse back, wedging the field until it was cleared and
retyped. Only the decimal/fractional LUNITS survived by accident.
New edit_angle row helper formats angles with format_angle
(AUNITS/AUPREC: decimal degrees, DMS, grads or radians), applied to all
17 angle rows (rotations, obliquing, arc start/end, hatch pattern
angle, multileader text rotation). parse_angle_deg converts every
AUNITS display form back to degrees ("30°"/"30d", DMS 30°15'20",
33.33g, 0.52r) and parse_f64 falls back to it, so the displayed value
round-trips through an edit.
Closes#297
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Holding Shift while a command asks for a point captures the nearest
polar increment (or ortho axis, UCS-aware) from the rubber-band base
toward the cursor and pins the pick to that ray. Every candidate —
osnap hits included — projects onto the locked direction, so a snap far
off-axis contributes only its along-axis component; the click commits
exactly what the preview shows. The direction stays fixed while Shift
is held and drops the moment it releases. Grip drags get the same lock
from the grip origin.
Guards: engages only when the active command wants a point — never
during entity picks (Shift there is the TRIM/EXTEND swap), tangent
picks, selection gathering or window-corner picks.
Closes#312
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The playlist page lists oldest-first; reverse before persisting so the
cached listing and offline launches share the order.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump acadrust to a87435f: DXF encodes an off layer as a negative
code-62 colour index; the reader took 70 bit 2 ("frozen by default in
new viewports") as off instead. The AEC sample's GRIDLINES layer —
carrying that bit while fully visible in the DWG — imported hidden, so
every building axis line on it disappeared; genuinely off layers
imported visible. Second and final cause of #314, after the LTYPE
74/75 swap.
Closes#314
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump acadrust to 6455610: the DXF LTYPE reader treated element code 74
as the shape number instead of the element-type flags and materialized
complex data on every plain dash — dashed linetypes like the AEC
sample's GRIDLINE turned "complex" with a null Shape{0} on each
element and rendered nothing. The DXF writer's swapped 74/75 emission
is fixed with it.
Closes#314
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The TTT solver's circle-pair difference equation loses its cx/cy terms
when the two circles are CONCENTRIC (a ring + a line through it, the
issue's drawing): lx = ly = 0, the equation only pins r, and the 2x2
center solve hit a zero determinant and returned no candidates.
The degenerate branch now recovers the solution directly: r comes from
the pinning equation (for a ring exactly (R_outer - R_inner) / 2), and
the centers from intersecting the remaining equation — a line in cx/cy
once r is known — with the first circle's distance constraint
|C - P| = |r + eps*cr|. Concentric pairs inside three-circle picks ride
the same branch. Candidate selection is unchanged, so the circle
nearest the three pick points wins.
Closes#318
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Grip drags mutated the document without ever pushing history — dragging
a polyline vertex (or any grip) could not be undone. The release-commit
now swaps the pre-drag backup in, snapshots that PRE state as a "GRIP"
entry, swaps the dragged result back and clears the redo stack; the
Esc-cancel path is unchanged and a no-move engaging click records
nothing.
Ctrl+Z during a drawing command steps the command instead of the
document undo swallowing the in-progress object (which also killed the
active command): new CadCommand::on_undo_step hook, consulted before
undo_active_tab. PLINE pops its last vertex (shared with the U option),
LINE reverts the last committed segment and keeps drawing from the
previous point (rides its existing U/UndoDocument path), and ARC
Continue reverts the last arc and resumes from the prior anchor with
the correct tangent via a new anchor history. With nothing placed yet
each falls through to the document undo.
Also drops the two warnings the #336 work left behind (unused Entity
import, dead Snapper::override_active).
Closes#332
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both commands gain a shared option mode machine:
- Cutting/Boundary edges (T/B): pick which objects act as the boundary
(picked edges highlight yellow, the hovered candidate half-strength);
Enter rebuilds the boundary set, empty = everything (quick mode).
- Fence (F): draw a dashed fence; every object crossing it is trimmed /
extended at each crossing, re-applied to the surviving pieces so a
fence across both overhanging ends clears both. Live red/cyan result
preview while placing points.
- Crossing (C): crossing-selection semantics — the dashed green window
picks objects crossing its edges AND wholly inside; runs through the
fence machinery with a synthesized inside click.
- Edge (E): boundaries extrapolate (lines run past their ends, arcs
close to full circles). Cuts that land on an implied extension draw a
dashed yellow guide from the boundary's drawn end to the cut point,
so the user sees which edge causes the cut. Extend previews also show
the added tail as a bright dashed slice of the true curve.
- Erase (R, TRIM): picks delete without needing an intersection, with a
red hover preview.
- Shift+click swaps trim<->extend per pick (new set_shift plumbing into
the entity-pick and hover paths); the hover preview follows the held
state. Project is out of scope for the 2D pipeline.
The per-type pick bodies moved to shared free fns (pick_trim_at /
pick_extend_at) used by direct picks, hover previews and the fence
pass; EXTEND's snapshot bookkeeping unified with TRIM's placeholder
flow. Option keywords now take precedence over the hex-handle reading
in feed_active_cmd ("F"/"C"/"E" are valid hex), and fence geos carry
sentinel handles — probing with NULL against NULL-handle geos excluded
the whole fence. Regression test: fence_trims_x_arm.
Closes#336
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
iced's clipboard rides window_clipboard, which has no wasm backend — a
focused text_input captured Ctrl+C/V on the web and did nothing.
Ctrl+V (captured, wasm only): read the async browser clipboard (the
keypress is a user gesture, so it's permitted) and replay the text as
synthetic KeyboardEvents on the winit canvas — the only route into a
focused text_input, since iced exposes no insert-text operation.
Control characters are dropped and the length is capped. The MText and
inline-TEXT editors keep their dedicated paste paths (no double feed),
and an unfocused Ctrl+V still runs PASTECLIP.
Ctrl+C (captured, wasm only): a widget operation pairs each text_input
with its focus state (iced fires both callbacks back-to-back on the
same widget) to collect the focused field's visible text, then writes
it with navigator.clipboard.writeText. Whole-field text, not the
selection — iced doesn't expose the selected range.
Native behaviour is unchanged.
Closes#346
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Shift+right-click in the viewport opens a cursor-anchored grid of snap
icons (names as hover tooltips). Picking one engages a one-shot
override: only that snap applies — even with running osnap off — until
the next point pick commits, which restores the saved configuration.
Esc drops an unconsumed override; an outside click closes the menu.
The status-bar snap toggles are untouched — this is a separate,
temporary mechanism.
Covers items 1 and 2 of #337 (mid-between-two-points still pending).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three fixes to the polyline arc-segment grip:
- bulge_from_midpoint keyed the sign off which chord side the midpoint
lies on — the opposite convention of BulgeArc::from_bulge, so every
grip-drag frame flipped the arc to the other side and the radius
jumped wildly ("snaps to a restricted range of radii"). It now
derives sign and sweep from the p0 -> mid -> p1 traversal
orientation, verified as the exact inverse of BulgeArc's midpoint.
- The arc segment's mid grip dragged in Translate mode, feeding
per-frame deltas through the recomputed arc midpoint — the drag
deadlocked the moment the cursor crossed the chord. Arc grips now
drag in Absolute mode: the arc re-fits through the cursor itself.
Straight-segment grips keep the Translate stretch.
- Picking Convert to Arc in the grip menu now engages that segment
grip (the Add Leader placement mechanic), so the new arc follows the
mouse immediately and the next click seats it.
Closes#339
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Boundary: a picked polyline explodes into per-segment Line geos, and
extend_line_geos then blew every one of them up to +-TRIM_EXTENT — a
closed rectangle boundary became a grid of infinite lines and the
parity side-test broke. Only an actual LINE entity boundary is treated
as infinite now.
Targets: the sampled trim path sampled polylines at their vertices
only, so a straight segment crossing the boundary was cut at the wrong
place — or not at all when both endpoints were on the kept side.
insert_boundary_crossings splices the exact line_seg_ts intersections
into the sample list and extrim_sampled classifies per segment
midpoint (a vertex exactly on the boundary can't flip the parity
test). Ellipse and spline targets gain the exact cut points too. The
removal preview subdivides straight polyline segments so the red/blue
split follows the boundary instead of jumping at vertices.
Closes#340
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dropping a supported file (dwg / dxf / bak / sv$, case-insensitive)
opens it through the existing open flow: an already-open drawing
switches to its tab, a load in progress queues the drop behind it
(multi-file drops arrive one event each), anything unsupported reports
on the command line instead of failing silently in the parser.
Platform support follows winit 0.30: Windows, macOS and Linux/X11
(incl. XWayland) deliver FileDropped; the Wayland backend does not
implement file drag & drop yet, so drops are inert there until winit
gains it.
Closes#344
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump acadrust to c5a579f: the DXF MULTILEADER reader now parses the
nested CONTEXT_DATA / LEADER / LEADER_LINE sections (leader lines and
text content used to come back empty, so DXF multileaders never
rendered), and the entity-level code map matches AutoCAD's real output
on both read and write (170 path type vs 172 content type).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump acadrust to 1e79519: the DXF reader now skips the R2018+
"101 / Embedded Object" section of MTEXT (and multiline ATTRIB/ATTDEF)
instead of letting its group codes overwrite the entity's already-parsed
insertion point, rotation, attachment and line spacing.
Closes#345
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>