forked from 1b-agent/opencadstudio-upstream
fix(xref): blocks respect their internal draw order
Xref merge now inserts entities in the source block's chain order and carries SortEntitiesTable objects across (remapped to merged handles). draw_depth_map values become [depth, half] so exploded block/xref fills and wide-polyline band wires both compose child depth as insert_depth + in-block rank x half, recursing into nested inserts with the same divisor - bands and fills from one block interleave by the block's internal order instead of stacking at the insert's single depth. Band batches split per rank via WireModel.depth_override; thin wires stay merged. The wire arena falls back to a full rebuild when a slab carries mixed depths so refreshes don't flatten band overrides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1546c1dc30
commit
e177f92ff5
48 files changed
+337
-50
No files matched your search
@@ -130,6 +130,14 @@ pub struct WireModel {
|
||||
/// exactly like `points` — no separate collector pass. The renderer
|
||||
/// gathers these across all wires into the text vertex buffer.
|
||||
pub text_verts: Vec<crate::scene::pipeline::text_gpu::TextVertex>,
|
||||
/// Block-local composed draw-order offset in (-1, 1) for a wire that must
|
||||
/// order against its *siblings inside the block* — currently wide-polyline
|
||||
/// bands, whose solid area would otherwise cover later-drawn siblings.
|
||||
/// `None` (all other wires) = the whole-insert depth resolved from `name`.
|
||||
/// `Some(local)` composes at draw time: `insert_depth + local * insert_half`,
|
||||
/// mirroring how exploded block fills seed their depth, so bands and fills
|
||||
/// from the same block interleave by the block's internal draw order.
|
||||
pub depth_override: Option<f32>,
|
||||
/// `true` when [`fill_tris`] is a real 3-D surface (PolyfaceMesh /
|
||||
/// PolygonMesh face) that must render with hidden-surface depth and only in
|
||||
/// shaded modes. `false` for a flat 2-D overlay fill (SOLID arrowhead,
|
||||
@@ -186,6 +194,7 @@ impl WireModel {
|
||||
Self {
|
||||
taper_widths: Vec::new(),
|
||||
world_width: 0.0,
|
||||
depth_override: None,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
@@ -419,6 +428,7 @@ impl Default for WireModel {
|
||||
dash_align_end: None,
|
||||
fill_tris: Vec::new(),
|
||||
fill_tris_low: Vec::new(),
|
||||
depth_override: None,
|
||||
fill_is_3d: false,
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
|
||||
Reference in new issue
Block a user