Geometry: persistent edge names, after the faces each edge separates

A design edge is named by its faces' persistent names, sorted and joined by
`|`, numbered `~k` by position when several separate the same faces. The
names follow the faces through a design edit and a partition replay.

Part of #230.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-14 20:46:05 -04:00
1 parent 6bfa0b410a
commit a11b971dae
4 files changed
+227 -8

No files matched your search

+8
View File
@@ -18,12 +18,14 @@
#![forbid(unsafe_code)]
mod design;
mod edges;
pub mod partition;
pub mod sample;
#[cfg(feature = "scripts")]
mod script;
pub use design::{Design, FeatureError, MAX_DESIGN_BYTES, open_design};
pub use edges::Edge;
pub use partition::{Cut, CutReport};
pub mod tagged_mesh;
#[cfg(feature = "scripts")]
@@ -129,6 +131,10 @@ pub struct SurfaceMesh {
/// the boundary points they share, accurate to the kernel's linear tolerance, so two copies
/// can differ by up to twice it; boundary surface preparation welds at this distance.
pub weld_distance: f64,
/// The B-rep edges as polylines, by edge index (empty for a surface without B-rep edges).
pub edges: Vec<Vec<[f64; 3]>>,
/// Per edge: the B-rep faces it bounds (one or two), by face index.
pub edge_faces: Vec<Vec<u32>>,
}
fn xyz(v: solidcraft_geom::Vec3) -> [f64; 3] {
@@ -208,6 +214,8 @@ impl Shape {
triangles: m.triangles,
tri_face: m.tri_face,
weld_distance: 2.0 * LINEAR_TOLERANCE,
edges: m.edges.into_iter().map(|e| e.into_iter().map(xyz).collect()).collect(),
edge_faces: m.edge_faces,
})
}
}