forked from 1b-agent/opencadstudio-upstream
fix(surface): refresh construction display
This commit is contained in:
1 parent
4201b0a031
commit
2f2d894eee
5 files changed
+27
-3
No files matched your search
@@ -2043,6 +2043,9 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
crate::entities::solid3d::SURFACE_PROPERTIES_APP,
|
||||
Some(crate::entities::solid3d::surface_property_xdata_values(state)),
|
||||
);
|
||||
if field == PROP_SURFACE_WIREFRAME_TYPE {
|
||||
self.tabs[i].scene.reseed_derived_caches(handle);
|
||||
}
|
||||
}
|
||||
} else if crate::scene::model::solid_history::is_loft_geometry_choice(field) {
|
||||
// These choices change the generated body, not just history
|
||||
@@ -3022,6 +3025,10 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
}
|
||||
}
|
||||
}
|
||||
if matches!(field, "srf_u_isolines" | "srf_v_isolines")
|
||||
{
|
||||
self.tabs[i].scene.reseed_derived_caches(handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,6 +584,23 @@ mod tests {
|
||||
assert!(tri_count(&pyramid_solid(c, 5.0, 9.0, 6).unwrap()) >= 8, "pyramid");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn planar_display_uses_independent_isoline_counts() {
|
||||
let body = box_solid([0.0; 3], 10.0, 10.0, 10.0).unwrap();
|
||||
let display = |counts, planar| {
|
||||
display_from_solid(&body, [0.7, 0.7, 0.7, 1.0], 1.0, None, counts, planar)
|
||||
.unwrap()
|
||||
.0
|
||||
.edge_verts
|
||||
.len()
|
||||
};
|
||||
let boundaries = display([0, 0], false);
|
||||
|
||||
assert_eq!(display([1, 0], true) - boundaries, 12);
|
||||
assert_eq!(display([0, 2], true) - boundaries, 24);
|
||||
assert_eq!(display([2, 2], false), boundaries);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_primitive_is_the_size_it_was_asked_for() {
|
||||
// Triangle counts say a mesh exists; the volume says it is the right
|
||||
|
||||
Reference in new issue
Block a user