Files
OneCAD-Draft/examples/xref_states.rs
T
HakanandClaude Opus 4.7 78cbb5570e perf(scene): frustum-cull wires using camera view AABB
Block defns and top-level entities now know their world-space XY
AABB, and `tessellate_entity` / `expand_insert` early-out for anything
that doesn't intersect the camera's view rect. Tested commit-only on
time_open (correct subset emitted with default camera); GUI run
pending user verification.

Cache plumbing:
  - `LocalWire` / `BlockDefn` carry `aabb_local` (post-build recursive
    union over nested defns).
  - `Scene::view_world_aabb()` derives a 25%-margined world rect from
    the active camera + last-seen render aspect.
  - `wire_cache` / `paper_sheet_cache` keys widen to
    `(geometry_epoch, camera_generation)` so pan/zoom invalidates the
    cached wire list — and pipeline `cached_epoch` widens to match
    so the GPU re-uploads on view change.
  - `XrefStatus::Unloaded` ack already shipped — orthogonal to this.

Also adds `examples/xref_states.rs` to dump per-block_record xref
metadata for diagnosing the is_loaded / unloaded distinction.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:52:04 +03:00

24 lines
785 B
Rust

// Dump every xref block_record's raw is_loaded bit before any resolve.
// cargo run --release --example xref_states -- <dwg>
use acadrust::io::dwg::DwgReader;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let path = std::env::args().nth(1).unwrap();
let doc = DwgReader::from_file(&path)?.read()?;
for br in doc.block_records.iter() {
if br.flags.is_xref || br.flags.is_xref_overlay {
println!(
"name={:<30} is_xref={} overlay={} is_loaded={:?} xref_path={:?} entity_handles={}",
br.name,
br.flags.is_xref,
br.flags.is_xref_overlay,
br.is_loaded,
br.xref_path,
br.entity_handles.len(),
);
}
}
Ok(())
}