forked from 1b-agent/fieldcraft-upstream
geometry: meshes go with the bodies a partition change removes (#385)
Deleting, suppressing or editing a partition (or its datum), or cutting a meshed body, removes the meshes of the bodies that are gone, reported as replaced, in the same undo step. model.check lists meshes of partition cells the open design no longer has (a model saved before the cut changed), and mesh.clear removes them, or the meshes of named bodies. 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
c6eeac35c1
commit
09323ddb45
7 files changed
+153
-30
No files matched your search
@@ -56,6 +56,17 @@ fn units(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
|
||||
fn check(s: &mut Session, _: &Value) -> Result<Value> {
|
||||
let mut diagnostics = s.model.check();
|
||||
if let Some(design) = s.design.as_deref() {
|
||||
for (body, n) in super::replace::stale(&s.model, design) {
|
||||
diagnostics.push(fieldcraft_model::Diagnostic {
|
||||
severity: Severity::Warning,
|
||||
subject: format!("body `{body}`"),
|
||||
message: format!(
|
||||
"{n} elements mesh a body the open design no longer has (its partitions changed since it was meshed); mesh.clear removes them"
|
||||
),
|
||||
});
|
||||
}
|
||||
}
|
||||
if let Some(why) = s.mesh_outdated() {
|
||||
diagnostics.push(fieldcraft_model::Diagnostic { severity: Severity::Warning, subject: "mesh".into(), message: why });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user