DWF/DGN underlays: clipping, layers, text, 3D DGN, colours and zoom extents

- PDFOSNAP, DWFOSNAP and DGNOSNAP are separate; UOSNAP sets them all and
  reads 2 while they differ. Enable Snap switches the selected kind's.
- DWFCLIP / DGNCLIP clip their own kind with the kind's prompts and message;
  CLIP routes DWF and DGN underlays there; Enter at a corner asks again.
- The right-edge underlay tools show for DWF and DGN too (import is PDF
  only).
- Underlay layers: DGN levels (V8 level table, "Default" listed as "0"; V7
  used levels named from the level name table), hidden through the layer
  override data with the DGN placeholder string first; a plotted DWF has
  none.
- V8 colour read from its colour word (by level, index, or a true colour
  drawn as its nearest index); 3D V8 elements drawn in plan (lines, line
  strings, ellipses and arcs by their orientation, text); a model's extent
  includes its text.
- DWF 6 TrueType text (font, height, rotation from the font opcode) and DWFx
  glyph runs are drawn; the default W2D colour map is the measured one.
- Contrast pulls lightness towards a per-kind pivot as measured (PDF 0.5,
  DWF 0.243, DGN 0.65).
- Zoom extents includes raster images and underlays whose frames are hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-09-28 16:10:01 +03:00
1 parent 1cbe89ef62
commit 56ecf786f1
41 files changed
+593 -147

No files matched your search

+25 -2
View File
@@ -1405,7 +1405,26 @@ impl Scene {
&& z[1].is_finite()
})
.collect();
if wires.is_empty() && mesh_aabbs.is_empty() && infinite_base_pts.is_empty() {
// Raster images and underlays draw as GPU quads; with their frames
// hidden they carry no wire outline, so fold their corners in too.
let image_corners: Vec<glam::Vec3> = self
.images
.iter()
.filter(|(h, _)| {
let handle = **h;
self.mesh_entity_visible(handle)
&& self.document.get_entity(handle).is_some_and(|entity| {
self.belongs_to_visible_block(handle, entity.common().owner_handle, layout_block)
})
})
.flat_map(|(_, image)| {
image.corners.iter().zip(image.corners_low.iter()).map(|(c, low)| {
glam::Vec3::new(c[0] + low[0], c[1] + low[1], c[2] + low[2])
})
})
.filter(|p| p.is_finite())
.collect();
if wires.is_empty() && mesh_aabbs.is_empty() && infinite_base_pts.is_empty() && image_corners.is_empty() {
return;
}
@@ -1449,7 +1468,7 @@ impl Scene {
});
}
}
if cents.is_empty() && mesh_aabbs.is_empty() && infinite_base_pts.is_empty() {
if cents.is_empty() && mesh_aabbs.is_empty() && infinite_base_pts.is_empty() && image_corners.is_empty() {
return;
}
@@ -1516,6 +1535,10 @@ impl Scene {
min = min.min(glam::Vec3::new(*ax, *ay, *az));
max = max.max(glam::Vec3::new(*bx, *by, *bz));
}
for p in &image_corners {
min = min.min(*p);
max = max.max(*p);
}
// Drawing holds only infinite construction geometry: fit the view to
// its base points rather than leaving the camera unchanged.
if min.x > max.x {