fix(model): restore saved solid booleans

Reload exact B-reps from solid history or ACIS before model operations and pin the closed-cut kernel fix.
This commit is contained in:
Hakan Seven committed 2026-08-23 19:35:48 +03:00
1 parent e94cbedaa2
commit 44a40eda0b
7 files changed
+82 -85

No files matched your search

+22 -5
View File
@@ -586,11 +586,28 @@ impl Scene {
self.images.insert(handle, model);
}
self.refresh_meshes_for_handles(&[handle]);
if let Some(operation) = self.document.solid_history_operation(handle).cloned() {
if let Ok(body) = cadkernel::acis::rebuild_body(&operation) {
self.solid_models.insert(handle, body);
}
}
self.restore_solid_models(&[handle]);
}
pub fn restore_solid_models(&mut self, handles: &[Handle]) {
let bodies: Vec<(Handle, cadkernel::brep::Body)> = handles
.iter()
.filter(|handle| !self.solid_models.contains_key(handle))
.filter_map(|&handle| {
let from_history = self
.document
.solid_history_operation(handle)
.and_then(|operation| cadkernel::acis::rebuild_body(operation).ok());
let body = from_history.or_else(|| match self.document.get_entity(handle) {
Some(EntityType::Solid3D(solid)) => {
crate::scene::convert::solid3d_tess::kernel_body(solid)
}
_ => None,
})?;
Some((handle, body))
})
.collect();
self.solid_models.extend(bodies);
}
/// Re-tessellate only the named ACIS entities. The former edit path