feat(render): draw DGN line-style symbols on linetypes

Linetypes converted from MicroStation DGN keep their pattern in DGN line-style
objects (empty standard LTYPE), so entities using them drew as a plain line and
lost the symbols (e.g. a pipe's end circles). Walk the line-style tree
(resolved by name to its LSDefinition), collect the symbol components' anonymous
blocks, and draw each at the host polyline's endpoints, scaled by the symbol's
decoded scale (geometry / scale) so it matches the drawing (verified: a 0.75
ellipse renders at the file's intended 0.375 radius).

Bumps acadrust to 8e18c6b (DGN line-style symbol-scale decode). First pass: the
stroke dash pattern and exact per-vertex placement need more of the line-style
leaf decoded; the base line still draws solid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-16 21:48:06 +03:00
commit 1d6a04183e
4 changed files with 485 additions and 287 deletions

View file

@ -702,6 +702,36 @@ pub(crate) fn tessellate_entity(
}
}
// DGN line-style: the linetype's real pattern lives in DGN line-style objects
// (empty standard LTYPE), so `resolve_complex_lt` sees nothing. Render its
// symbol blocks (e.g. a pipe's end circles) at the polyline endpoints. First
// pass — exact dash pattern / placement need the undecoded leaf data.
let dgn_syms = convert::dgn_linestyle::symbol_blocks(document, lt_name);
if !dgn_syms.is_empty() {
let verts = convert::dgn_linestyle::polyline_points(e);
if verts.len() >= 2 {
let last = *verts.last().unwrap();
for (i, sym) in dgn_syms.iter().enumerate() {
let at = if i == 0 { verts[0] } else { last };
let mut wires = convert::dgn_linestyle::place_block_wires(
document,
sym.block,
sym.scale,
at,
entity_color,
line_weight_px,
anno_scale,
world_per_pixel,
bg_color,
);
for w in &mut wires {
w.aabb = aabb;
}
bases.extend(wires);
}
}
}
bases
}