diff --git a/apps/solvecraft-cli/src/oracle.rs b/apps/solvecraft-cli/src/oracle.rs index 9052410e..7ebf37d9 100644 --- a/apps/solvecraft-cli/src/oracle.rs +++ b/apps/solvecraft-cli/src/oracle.rs @@ -65,6 +65,19 @@ fn check_case(dir: &str) -> Value { if let Some((_, _, why)) = approx { out["note"] = json!(why); } + let effective: Vec = recipe["features"] + .as_array() + .into_iter() + .flatten() + .filter(|f| f.get("fusion_effective_extent").is_some()) + .map(|f| f["name"].as_str().unwrap_or("?").to_string()) + .collect(); + if !effective.is_empty() { + out["note"] = json!(format!( + "known Fusion difference: {} replayed with the extent Fusion actually used (its through-all is sized as 1.1 × the farthest vertex, so curved tops stop it short; SolveCraft's through-all goes truly through)", + effective.join(", ") + )); + } out } diff --git a/apps/solvecraft-cli/src/recipe.rs b/apps/solvecraft-cli/src/recipe.rs index 727660b8..706bc8e0 100644 --- a/apps/solvecraft-cli/src/recipe.rs +++ b/apps/solvecraft-cli/src/recipe.rs @@ -85,6 +85,14 @@ fn sketch_cmds(f: &Value, out: &mut Vec) -> Result<(), String> { /// Extent parameters for the Extrude command. fn extent(f: &Value, p: &mut Value) { + // Where Fusion's own result differs from the geometric meaning (its through-all is sized + // from vertices), the recipe records the extent Fusion actually used: replay that. + if let Some(fx) = f.get("fusion_effective_extent").filter(|x| x.get("type").and_then(Value::as_str) == Some("distance")) { + let dir = fx.get("direction").and_then(Value::as_str).unwrap_or("positive"); + p["distance"] = fx.get("distance").cloned().unwrap_or(Value::Null); + p["direction"] = json!(if dir.starts_with("negative") { "negative" } else { "positive" }); + return; + } let e = f.get("extent").cloned().unwrap_or(Value::Null); let ty = e.get("type").and_then(Value::as_str).unwrap_or("distance"); let dist = e.get("distance").cloned().or_else(|| f.get("distance").cloned()).unwrap_or(Value::Null); diff --git a/xtask/src/main.rs b/xtask/src/main.rs index d1b190e8..7b33570c 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -160,6 +160,9 @@ fn cmd_oracle() -> Result<(), String> { if let Some(e) = r["error"].as_str() { notes.push(e.replace('|', "/")); } + if let Some(n) = r["note"].as_str() { + notes.push(n.replace('|', "/")); + } md += &format!("| {} | {status} | {} |\n", r["case"].as_str().unwrap_or(""), notes.join("; ")); } std::fs::write(root().join("docs/oracle.md"), md).map_err(|e| format!("docs/oracle.md: {e}"))?;