forked from 1b-agent/fieldcraft-upstream
Engine: mesh.seed.edge, mesh.seed.clear and mesh.seed.list
Seed design edges by their persistent names with a count or a size, a bias and a constraint; one undo step each, saved with the model. Seeds on edges a reopened design lacks are reported as stale. 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:
1 parent
f8e0be970e
commit
e8cada94d0
12 files changed
+295
-11
No files matched your search
@@ -696,7 +696,7 @@ mod tests {
|
||||
let before = s.model.clone();
|
||||
let r = s.execute("geometry.open", &json!({"path": path})).unwrap();
|
||||
assert_eq!((r["model"].as_str(), r["related"].as_bool()), (Some("kept"), Some(true)), "{r}");
|
||||
assert_eq!(r["stale"], json!({"mesh_bodies": [], "sets": []}));
|
||||
assert_eq!(r["stale"], json!({"mesh_bodies": [], "sets": [], "seeds": []}));
|
||||
assert_eq!(s.model, before);
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ mod tests {
|
||||
let mut kept = defined.clone();
|
||||
let r = kept.execute("geometry.open", &json!({"path": path})).unwrap();
|
||||
assert_eq!((r["model"].as_str(), r["related"].as_bool()), (Some("kept"), Some(false)), "{r}");
|
||||
assert_eq!(r["stale"], json!({"mesh_bodies": ["Seal"], "sets": ["all", "hole"]}));
|
||||
assert_eq!(r["stale"], json!({"mesh_bodies": ["Seal"], "sets": ["all", "hole"], "seeds": []}));
|
||||
assert_eq!(kept.model, before);
|
||||
|
||||
// New: the mesh and every definition go, the units stay; one undo brings them back.
|
||||
@@ -721,7 +721,7 @@ mod tests {
|
||||
let before = fresh.model.clone();
|
||||
let r = fresh.execute("geometry.open", &json!({"path": path, "model": "new"})).unwrap();
|
||||
assert_eq!((r["model"].as_str(), r["related"].as_bool()), (Some("new"), Some(false)), "{r}");
|
||||
assert_eq!(r["stale"], json!({"mesh_bodies": [], "sets": []}));
|
||||
assert_eq!(r["stale"], json!({"mesh_bodies": [], "sets": [], "seeds": []}));
|
||||
assert!(fresh.model.elements().is_empty() && fresh.model.nodes().is_empty());
|
||||
assert!(fresh.model.definition_counts().iter().all(|(_, n)| *n == 0));
|
||||
assert_eq!(fresh.model.units(), units);
|
||||
|
||||
Reference in new issue
Block a user