SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Oracle seams: fmt
bherbruckbc21959777bc
diff --git a/apps/solvecraft-cli/src/oracle.rs b/apps/solvecraft-cli/src/oracle.rsindex be8391d644..b58baf0c58 100644--- a/apps/solvecraft-cli/src/oracle.rs+++ b/apps/solvecraft-cli/src/oracle.rs@@ -59,9 +59,9 @@ fn check_case(dir: &str) -> Value {let mut seam_note = None;if approx.is_none() {let exact = ["faces", "edges", "vertices"].iter().all(|k| got["total"][k].as_f64().is_some() && got["total"][k] == want["total"][k]);- let fusion_seams = want["bodies"].as_array().and_then(|bs| {- bs.iter().map(seams::normalised).try_fold((0, 0, 0), |a, n| n.map(|n| (a.0 + n.0, a.1 + n.1, a.2 + n.2)))- });+ let fusion_seams = want["bodies"]+ .as_array()+ .and_then(|bs| bs.iter().map(seams::normalised).try_fold((0, 0, 0), |a, n| n.map(|n| (a.0 + n.0, a.1 + n.1, a.2 + n.2))));match fusion_seams {// Size matches and only the topology differs: compare with Fusion's seam splits merged.Some((f, e, v)) if size_ok && !exact => {diff --git a/apps/solvecraft-cli/src/seams.rs b/apps/solvecraft-cli/src/seams.rsindex f5d6389991..b9bf022023 100644--- a/apps/solvecraft-cli/src/seams.rs+++ b/apps/solvecraft-cli/src/seams.rs@@ -62,7 +62,10 @@ impl Surf {let s = match f["type"].as_str().unwrap_or_default() {"plane" => g("centroid").zip(g("plane_normal_outward").and_then(unit)).map(|(p, n)| Surf::Plane { p, n }),"cylinder" => (|| Some(Surf::Cylinder { o: g("axis_origin")?, a: unit(g("axis")?)?, r: n("radius_mm")? }))(),- "cone" => (|| Some(Surf::Cone { o: g("axis_origin")?, a: unit(g("axis")?)?, r: n("radius_mm")?, tan: n("half_angle_deg")?.to_radians().tan() }))(),+ "cone" => {+ (|| Some(Surf::Cone { o: g("axis_origin")?, a: unit(g("axis")?)?, r: n("radius_mm")?, tan: n("half_angle_deg")?.to_radians().tan() }))(+ )+ }"sphere" => (|| Some(Surf::Sphere { c: g("center")?, r: n("radius_mm")? }))(),"torus" => (|| Some(Surf::Torus { c: g("center")?, a: unit(g("axis")?)?, big: n("major_radius_mm")?, small: n("minor_radius_mm")? }))(),_ => None,@@ -261,9 +264,7 @@ mod tests {fn split_cylinder_counts_once() {let cyl = json!({"type": "cylinder", "axis_origin": [0, 0, 0], "axis": [0, 0, 1], "radius_mm": 5.0});let plane = |z: f64, n: f64| json!({"type": "plane", "centroid": [0, 0, z], "plane_normal_outward": [0, 0, n]});- let arc = |z: f64, s: [f64; 3], t: [f64; 3]| {- json!({"type": "arc", "start": s, "end": t, "center": [0, 0, z], "radius_mm": 5.0, "axis": [0, 0, 1], "length_mm": 15.707963})- };+ let arc = |z: f64, s: [f64; 3], t: [f64; 3]| json!({"type": "arc", "start": s, "end": t, "center": [0, 0, z], "radius_mm": 5.0, "axis": [0, 0, 1], "length_mm": 15.707963});let line = |x: f64| json!({"type": "line", "start": [x, 0, 0], "end": [x, 0, 10]});let body = json!({"face_list": [cyl.clone(), cyl, plane(0.0, -1.0), plane(10.0, 1.0)],