PDF follow-ups: import layers, arcs and joins, names, background, page placement, snaps

- Unlayered raster images go with the PDF layer drawn last before them.
- Circular Bezier arcs import as arcs: bulged polyline segments with Join,
  ARC entities without it; straight chains still join.
- Imported PNGs go to "PDF Images" next to the PDF; import blocks are
  numbered imp31, imp32, ...
- Background darkness is its HSL lightness below one half.
- All chosen pages attach at the same insertion point.
- PDF geometry snaps as separate pieces: centre from the rim, intersections
  and perpendiculars.
- Automation: snap query with an optional base point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-09-25 10:33:48 +03:00
1 parent 857f2f2e58
commit edbbc9d135
10 files changed
+347 -63

No files matched your search

+17 -5
View File
@@ -1286,16 +1286,28 @@ fn tessellate_entity_inner(
b.set_fixed_screen_width(2.0);
}
}
// PDF underlay geometry: a hidden, unplotted wire that object snaps
// (nearest, intersection, perpendicular) find, beside the page frame.
// PDF underlay geometry: hidden, unplotted wires that object snaps
// (nearest, intersection, perpendicular, centre) find, beside the page
// frame — one per segment or circle, so they intersect each other.
if let EntityType::Underlay(underlay) = e {
let geometry = crate::scene::model::pdf_vector::underlay_snap_geometry(underlay, document);
if !geometry.is_empty() {
let (points, points_low) = convert::tessellate::points_to_ds(geometry);
for piece in crate::scene::model::pdf_vector::underlay_snap_geometry(underlay, document) {
let (points, points_low) = convert::tessellate::points_to_ds(piece.points);
let mut wire = WireModel::solid(h.value().to_string(), points, entity_color, sel);
wire.points_low = points_low;
wire.display_visible = false;
wire.plot_visible = false;
if let Some((center, radius)) = piece.circle {
wire.tangent_geoms = vec![crate::scene::model::wire_model::TangentGeom::PlanarCircle {
center,
axis_x: [1.0, 0.0, 0.0],
axis_y: [0.0, 1.0, 0.0],
radius,
}];
wire.snap_pts = vec![(
glam::DVec3::from(center),
crate::scene::model::wire_model::SnapHint::Center,
)];
}
set_wire_aabb(&mut wire, aabb);
bases.push(wire);
}