From 6aced3ac7e241e706b1a5ebbbaed05431832de3e Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Thu, 8 Oct 2026 12:17:00 +0300 Subject: [PATCH] SWEEP: base point from the path; kernel sweep validity and placement fixes A single profile's base point comes from the path it is swept along: a path leaving the profile's plane from inside the profile sweeps it where it stands. Kernel 30b3810: pcurves in the edge's parameterisation (valid spline-faced sweeps), corner crossings fitted to the modeller's resolution, run faces through stations evenly spaced along the run. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++++ src/scene/model/sweep_command_model.rs | 10 +++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78908a489..0328c339d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4237,7 +4237,7 @@ dependencies = [ [[package]] name = "opencadkernel" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/opencadkernel.git?rev=86497ae#86497ae923b7d9297707aaedb712a8678815a238" +source = "git+https://github.com/ramox81/cadkernel.git?rev=30b3810#30b38101831c454421438acffaa648a53c9d8a2e" dependencies = [ "cavalier_contours", "opencadcodec", @@ -4248,7 +4248,7 @@ dependencies = [ [[package]] name = "opencadkernel-constraints" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/opencadkernel.git?rev=86497ae#86497ae923b7d9297707aaedb712a8678815a238" +source = "git+https://github.com/ramox81/cadkernel.git?rev=30b3810#30b38101831c454421438acffaa648a53c9d8a2e" dependencies = [ "nalgebra", ] diff --git a/Cargo.toml b/Cargo.toml index 0d21f6f45..c4124e354 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -181,3 +181,7 @@ harness = false [[test]] name = "integration" path = "tests/integration.rs" + +[patch."https://github.com/HakanSeven12/opencadkernel.git"] +opencadkernel = { git = "https://github.com/ramox81/cadkernel.git", rev = "30b3810" } +opencadkernel-constraints = { git = "https://github.com/ramox81/cadkernel.git", rev = "30b3810" } diff --git a/src/scene/model/sweep_command_model.rs b/src/scene/model/sweep_command_model.rs index 7913e22a6..486156ec3 100644 --- a/src/scene/model/sweep_command_model.rs +++ b/src/scene/model/sweep_command_model.rs @@ -167,7 +167,11 @@ pub fn sweep_selection_options(profiles: &[EntityType], mut options: SweepOption } // Spatial profiles keep their own anchor. let profiles = profiles.iter().filter(|profile| spatial_profile(profile).is_none()).collect::>(); - if profiles.is_empty() { + // A single profile takes its base from the path it is swept along + // (`sweep_record`). + // ponytail: several profiles share the group anchor even when the path + // starts inside one of them; the reference rule for that case is unmeasured. + if profiles.len() < 2 { return Some(options); } let geometry = profiles.iter().map(|profile| { @@ -229,10 +233,10 @@ pub fn sweep_record(profile: &EntityType, path: &EntityType, options: SweepOptio return Some(record); } let (sweep_entity, sweep_entity_transform) = embedded_sweep_profile(profile)?; - let (plane, wires, _) = kernel::acis::sweep_profile_geometry(&sweep_entity, sweep_entity_transform).ok()?; + kernel::acis::sweep_profile_geometry(&sweep_entity, sweep_entity_transform).ok()?; let base_point = match options.base_point { Some(point) => point.to_array(), - None => kernel::brep::sweep_profile_base(plane, &wires)?, + None => kernel::acis::sweep_default_base(&sweep_entity, sweep_entity_transform, &embedded_sweep_path(path)?).ok()?, }; let mut base = SolidHistoryNodeBase::new(1); base.transform = glam::DMat4::IDENTITY.to_cols_array();