From 44c94d1da19193b9c06c8e4fd8ce4dd946484337 Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:39:23 +0300 Subject: [PATCH] Avoid surface meshes in live sweep previews --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/modules/insert/solid3d_cmds.rs | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 671ff7c53..30020efbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -878,7 +878,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cadkernel" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=5fc881c0f6fbc7fb96d483cd3a4efe145ba6133f#5fc881c0f6fbc7fb96d483cd3a4efe145ba6133f" +source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=1a1505c7bb8e26770f14b49859587660c7519a25#1a1505c7bb8e26770f14b49859587660c7519a25" dependencies = [ "acadrust", "cavalier_contours", diff --git a/Cargo.toml b/Cargo.toml index 1e2ce7451..5fc7e2fa3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ rfd = "0.17" clap = { version = "4", features = ["derive"] } env_logger = "0.11" acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "393d6c0857447f9ca678bed97a612707f0a842c6", features = ["serde"] } -cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "5fc881c0f6fbc7fb96d483cd3a4efe145ba6133f", features = ["acis", "offset"] } +cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "1a1505c7bb8e26770f14b49859587660c7519a25", 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/src/modules/insert/solid3d_cmds.rs b/src/modules/insert/solid3d_cmds.rs index 21b8c8fdf..4a1ddb76f 100644 --- a/src/modules/insert/solid3d_cmds.rs +++ b/src/modules/insert/solid3d_cmds.rs @@ -168,7 +168,9 @@ fn preview_body_wires( color: [f32; 4], isolines: usize, ) -> Vec { - let mesh = cadkernel::brep::mesh::tessellate( + // This overlay only consumes curves. Do not triangulate the body's faces + // on every cursor event just to discard the resulting surface mesh. + let wireframe = cadkernel::brep::mesh::tessellate_wireframe( body, cadkernel::brep::mesh::TessellationTolerance::new( cadkernel::tessellation::DEFAULT_ANGLE, @@ -176,7 +178,7 @@ fn preview_body_wires( ) .with_isolines(isolines), ); - let mut wires = mesh + let mut wires = wireframe .edges .into_iter() .filter(|edge| edge.positions.len() >= 2) @@ -190,7 +192,7 @@ fn preview_body_wires( }) .collect::>(); wires.extend( - mesh.isolines + wireframe.isolines .into_iter() .filter(|line| line.positions.len() >= 2) .map(|line| {