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
Generated
+1
-1
@@ -885,7 +885,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "cadkernel"
|
name = "cadkernel"
|
||||||
version = "0.1.0"
|
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 = [
|
dependencies = [
|
||||||
"acadrust",
|
"acadrust",
|
||||||
"cavalier_contours",
|
"cavalier_contours",
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ rfd = "0.17"
|
|||||||
clap = { version = "4", features = ["derive", "string"] }
|
clap = { version = "4", features = ["derive", "string"] }
|
||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "f23ffc873228e5f41b876485c741e4a8ac20a67d", features = ["serde"] }
|
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" }
|
dwg-thumbnailer = { path = "crates/dwg-thumbnailer" }
|
||||||
flate2 = "1"
|
flate2 = "1"
|
||||||
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp", "tiff"] }
|
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp", "tiff"] }
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ thiserror = "1"
|
|||||||
|
|
||||||
# Host adapters convert ObjectId to acadrust handles; kernel handles stay local.
|
# 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 }
|
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"] }
|
ocs_plugin_api = { path = "../ocs_plugin_api", optional = true, features = ["host"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|||||||
@@ -2043,6 +2043,9 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
|||||||
crate::entities::solid3d::SURFACE_PROPERTIES_APP,
|
crate::entities::solid3d::SURFACE_PROPERTIES_APP,
|
||||||
Some(crate::entities::solid3d::surface_property_xdata_values(state)),
|
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) {
|
} else if crate::scene::model::solid_history::is_loft_geometry_choice(field) {
|
||||||
// These choices change the generated body, not just history
|
// 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");
|
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]
|
#[test]
|
||||||
fn every_primitive_is_the_size_it_was_asked_for() {
|
fn every_primitive_is_the_size_it_was_asked_for() {
|
||||||
// Triangle counts say a mesh exists; the volume says it is the right
|
// Triangle counts say a mesh exists; the volume says it is the right
|
||||||
|
|||||||
Reference in new issue
Block a user