Display tessellation plans (1/4): planner with shared edge nodes (#802)

Adds TessPlan and the kernel planner (shared edge nodes, structured and Coons grids, constrained Delaunay for trimmed faces) behind Body::display_plan. Nothing drawn changes yet.

Refs #303

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Irakli KourtisandClaude Opus 5.5 authored and GitHub committed 2026-10-13 14:27:44 -04:00
1 parent facff1050e
commit bfbf5f9432
16 files changed
+2471

No files matched your search

+12
View File
@@ -1047,6 +1047,18 @@ impl Body {
})
}
/// The display tessellation as a plan for the CPU or GPU evaluator: every face's
/// triangulation in its own parameters, with each edge sampled once (chord tolerance
/// `tol`, mm) so faces meet exactly.
pub fn display_plan(&self, tol: f64) -> Result<solidcraft_geom::tess::TessPlan> {
if self.is_mesh() {
return Err(KernelError::Invalid("a mesh body has no surfaces to tessellate".into()));
}
let tol = if tol.is_finite() && tol > 0.0 { tol } else { 0.05 };
let tol = tol.max(self.size() * 1e-6);
guard("tessellate", || crate::tess::plan(&self.solid, tol).map(|(plan, _)| plan))
}
/// Faces with no triangles in a coarse tessellation (the mesher failed or gave up).
pub fn unmeshed_faces(&self) -> usize {
if self.is_mesh() {