engine: mesh.size.* commands, honoured by every mesher (#435)

mesh.size.set adds a size control on faces, bodies, a box or a sphere;
mesh.size.growth sets the growth rate; mesh.size.clear and
mesh.size.list. The tet mesher bakes the controls into its graded field,
the hex meshers, cells and the octree take the graded RegionSize, and
the block projection and mesh plans divide their edges by it.

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-16 17:08:27 -04:00
1 parent c611080182
commit b62be1ada6
20 files changed
+591 -25

No files matched your search

+4 -2
View File
@@ -1567,7 +1567,8 @@ fn corner_meshes(
c: f64,
tolerance: f64,
) -> Result<CornerCopy> {
let opts = fieldcraft_mesh::project::ProjectOptions { size: plan.size, ..Default::default() };
let field = super::sizes::sizing(s)?.local_field(plan.size)?;
let opts = fieldcraft_mesh::project::ProjectOptions { size: plan.size, field, ..Default::default() };
let whole_body = super::project::open_body(s, cell, Some(tolerance), &json!({}))?;
let merge = super::project::merge_distance(None, whole_body.diagonal())?;
// What the cell meshed whole gets (no corner may be worse), and per candidate cut the whole
@@ -1783,7 +1784,8 @@ fn apply_projection(s: &mut Session, name: &str, plan: &MeshPlan, tolerance: f64
// Cut faces another cell's mesh already covers are taken as given, so the cells meet node
// to node there.
let (fixed, fixed_faces) = cut_face_patches(s, &body, &plan.body, plan.size)?;
let opts = fieldcraft_mesh::project::ProjectOptions { size: plan.size, fixed, ..Default::default() };
let field = super::sizes::sizing(s)?.local_field(plan.size)?;
let opts = fieldcraft_mesh::project::ProjectOptions { size: plan.size, fixed, field, ..Default::default() };
let mut mesh = super::project::project_body(s, &plan.body, body, &layout.topology, &opts, merge)
.map_err(|e| EngineError::Params(format!("mesh plan `{name}`: the projected layout does not mesh: {e}")))?;
if let Some(m) = mesh.as_object_mut() {