From 2f2d894eee806e258a0f9eb855fbb3486a9254be Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 10 Sep 2026 17:14:44 +0300 Subject: [PATCH] fix(surface): refresh construction display --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/ocs_doc_api/Cargo.toml | 2 +- src/app/update/command.rs | 7 +++++++ src/scene/model/solid_model.rs | 17 +++++++++++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21c353fd5..9acbdfdf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -885,7 +885,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cadkernel" version = "0.1.0" -source = "git+https://github.com/ramox81/cadkernel.git?rev=d7431a6ab8600454ab3ad78ad7674576cbc2d5db#d7431a6ab8600454ab3ad78ad7674576cbc2d5db" +source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=0507b720fef47bd7da0d4f777f97f1743a4f4038#0507b720fef47bd7da0d4f777f97f1743a4f4038" dependencies = [ "acadrust", "cavalier_contours", diff --git a/Cargo.toml b/Cargo.toml index 325321206..0a526489a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ rfd = "0.17" clap = { version = "4", features = ["derive", "string"] } env_logger = "0.11" acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "f23ffc873228e5f41b876485c741e4a8ac20a67d", features = ["serde"] } -cadkernel = { git = "https://github.com/ramox81/cadkernel.git", rev = "d7431a6ab8600454ab3ad78ad7674576cbc2d5db", features = ["acis", "offset"] } +cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "0507b720fef47bd7da0d4f777f97f1743a4f4038", features = ["acis", "offset"] } dwg-thumbnailer = { path = "crates/dwg-thumbnailer" } flate2 = "1" image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp", "tiff"] } diff --git a/crates/ocs_doc_api/Cargo.toml b/crates/ocs_doc_api/Cargo.toml index 8832710ab..744d3559e 100644 --- a/crates/ocs_doc_api/Cargo.toml +++ b/crates/ocs_doc_api/Cargo.toml @@ -15,7 +15,7 @@ thiserror = "1" # Host adapters convert ObjectId to acadrust handles; kernel handles stay local. acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "f23ffc873228e5f41b876485c741e4a8ac20a67d", features = ["serde"], optional = true } -cadkernel = { git = "https://github.com/ramox81/cadkernel.git", rev = "d7431a6ab8600454ab3ad78ad7674576cbc2d5db", features = ["acis", "offset"], optional = true } +cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "0507b720fef47bd7da0d4f777f97f1743a4f4038", features = ["acis", "offset"], optional = true } ocs_plugin_api = { path = "../ocs_plugin_api", optional = true, features = ["host"] } [build-dependencies] diff --git a/src/app/update/command.rs b/src/app/update/command.rs index 5c748dbb7..a5b76642b 100644 --- a/src/app/update/command.rs +++ b/src/app/update/command.rs @@ -2043,6 +2043,9 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task { 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 { } } } + if matches!(field, "srf_u_isolines" | "srf_v_isolines") + { + self.tabs[i].scene.reseed_derived_caches(handle); + } } } } diff --git a/src/scene/model/solid_model.rs b/src/scene/model/solid_model.rs index 948f1e652..1fa867915 100644 --- a/src/scene/model/solid_model.rs +++ b/src/scene/model/solid_model.rs @@ -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