diff --git a/crates/smlib/src/core.rs b/crates/smlib/src/core.rs index c32b57e06da..842f7eea55f 100644 --- a/crates/smlib/src/core.rs +++ b/crates/smlib/src/core.rs @@ -135,7 +135,6 @@ pub(crate) fn fixes() -> UpstreamFixes { f.analytic_inversion_answers_apart = true; f.fillet_statuses_pass_on = true; f.fillet_rail_trim_at_near_knot = true; - f.offset_keep_cavity_regions = true; f.corner_patch_face_side_twist = true; f.boolean_union_refuses_solid_leak = true; f.validation_does_not_make_uv_trims = true; diff --git a/solidcore/crates/solidcore/src/kernel.rs b/solidcore/crates/solidcore/src/kernel.rs index 04c00118fe3..e2906841596 100644 --- a/solidcore/crates/solidcore/src/kernel.rs +++ b/solidcore/crates/solidcore/src/kernel.rs @@ -617,8 +617,6 @@ pub struct UpstreamFixes { pub edgeuse_convexity_propagates_step_off_failure: bool, /// `SmBrep::LocalOperation` sizes the offset executive's distance (by which it extends the neighbouring surfaces to meet the moved ones) from a box that also holds the replacement surfaces, not from the original body alone, so a face moved further than about the body's size away is still reached (WR-534; the fork's tangency-labs/smlib@a1ee273). pub local_operation_box_holds_new_surfaces: bool, - /// An inset's `do_extended_offset` makes manifold only the finite regions of the merged offset that are cavity, not every finite region (upstream's own TODO there: "we will need to select regions to keep"): a region is cavity where one of its faces has the body's face the wall's thickness behind it and none has the body's face that far ahead. Where a floor is no thicker than the wall its two faces' offsets cross and the merge closes the region between them; kept, the cavity was no manifold solid and the shell failed with `SM_ERR` (1001) (WR-667; the fork's tangency-labs/smlib@37af643). - pub offset_keep_cavity_regions: bool, /// In a local operation (`SmBrep::LocalOperation`), `SmOffsetGeometryCreation::ExtendTrimEdges` fails a tangent or lamina edge whose lift onto one face's new surface drops onto the other's farther than ten times `max(the offset edge's tolerance, the approximation tolerance)`, and `EdgeuseOffset` passes that failure on, so the operation is refused; upstream ignores it ("will be fixed later", which no later step of a local operation does) and returns a body with an edge as loose as the gap between a moved face and its unmoved tangent neighbour (WR-530, #402; the fork's tangency-labs/smlib@23c5b0a). Offsets and shells are unchanged. pub local_operation_refuses_loose_tangent_edges: bool, /// A local operation that moves one of two tangent faces along its normal builds the step: `EdgeuseOffset` finds the two faces parallel but apart across the edge (`IsStepAcrossEdge`) and builds the ruled wall between their edges (`CreateStepWall`, rails of uniform weight made non-rational), kept out of the face extensions; `CloseLoopGaps` closes the gaps the wall leaves at its ends and the edges running past its corners are split; a vertex moved past an edge's other end is `SM_ERR_OFFSET_EDGE_VANISHES` (1043) (WR-530 addendum; tangency-labs/smlib 5d428ae, 90aabff, 34318f4). diff --git a/solidcore/crates/solidcore/src/offset/offset_executive/cavity.rs b/solidcore/crates/solidcore/src/offset/offset_executive/cavity.rs index 7c2a8396183..dee2a448d09 100644 --- a/solidcore/crates/solidcore/src/offset/offset_executive/cavity.rs +++ b/solidcore/crates/solidcore/src/offset/offset_executive/cavity.rs @@ -8,9 +8,10 @@ //! |-----------------------------|-----------------------| //! | `is_cavity_region` (crate) | `sm_IsCavityRegion` | //! -//! Deviations: opt-in (`Kernel::fixes.offset_keep_cavity_regions`, read by -//! `do_extended_offset`). The body's `BrepPointSolve` runs on one point-solve cache of the -//! body made by the caller (`p1`'s original-body solve, as `RemoveExcessFaces` uses it); +//! Deviations: `do_extended_offset` asks only when the merge left two or more finite +//! regions (with one there is nothing to select). The body's `BrepPointSolve` runs on +//! one point-solve cache of the body made by the caller (`p1`'s original-body solve, as +//! `RemoveExcessFaces` uses it); //! a failed internal point, point solve or normal skips the face as the fork does, but an //! unported dependency still propagates. No recursion. diff --git a/solidcore/crates/solidcore/src/offset/offset_executive/p2.rs b/solidcore/crates/solidcore/src/offset/offset_executive/p2.rs index 8d7a3ed43ad..da4745ea227 100644 --- a/solidcore/crates/solidcore/src/offset/offset_executive/p2.rs +++ b/solidcore/crates/solidcore/src/offset/offset_executive/p2.rs @@ -1158,25 +1158,33 @@ impl OffsetExecutive { // WR-455 (#855; tangency-labs/smlib@601d804): [`stitch_merged_offset`]. let to_be_solid = self.create_offset_solid() || brep_is_manifold_solid(original)?; stitch_merged_offset(kernel, &mut result, to_be_solid)?; - // Opt-in (WR-667; tangency-labs/smlib@37af643): an inset keeps the regions - // that are cavity, not every finite region (upstream's TODO here: "we will - // need to select regions to keep"). Where the body is no thicker than the - // wall, the offsets of a floor's two faces cross and the merge closes the - // region between them, touching the cavity's pieces along edges; kept, the - // cavity was no manifold solid and the shell failed (1001). (SER.) + // WR-667 (tangency-labs/smlib@37af643): an inset keeps the regions that are + // cavity, not every finite region (upstream's TODO here: "we will need to + // select regions to keep"). Where the body is no thicker than the wall, the + // offsets of a floor's two faces cross and the merge closes the region + // between them, touching the cavity's pieces along edges; kept, the cavity + // was no manifold solid and the shell failed (1001). (SER.) + // + // Only a choice between two or more finite regions can select anything: with + // one, `make_manifold` keeps it whether it is cavity or not (a lone cavity + // region is every region; a lone other region leaves no cavity to keep), so + // the body's point solves are not run for it, nor the live classification + // whose trims, caches and tolerance growth they would leave on `result`. let mut cavities = Vec::new(); let mut select = false; - if kernel.fixes.offset_keep_cavity_regions - && self.inset() - && self.operation() == OffsetOperation::SolidOffset - { - let infinite = result.infinite_region(); - let regions = bp1::regions(&result, None)?; + let finite: Vec = + if self.inset() && self.operation() == OffsetOperation::SolidOffset { + let infinite = result.infinite_region(); + bp1::regions(&result, None)? + .into_iter() + .filter(|®ion| Some(region) != infinite) + .collect() + } else { + Vec::new() + }; + if finite.len() > 1 { let mut body_cache = None; - for region in regions { - if Some(region) == infinite { - continue; - } + for region in finite { if body_cache.is_none() { body_cache = Some(super::p1::make_original_brep_cache(kernel, original)?); } diff --git a/solidcore/crates/solidcore/tests/fork_37af643_inset_keeps_cavity_regions.rs b/solidcore/crates/solidcore/tests/fork_37af643_inset_keeps_cavity_regions.rs index b424a68e627..411a61462e8 100644 --- a/solidcore/crates/solidcore/tests/fork_37af643_inset_keeps_cavity_regions.rs +++ b/solidcore/crates/solidcore/tests/fork_37af643_inset_keeps_cavity_regions.rs @@ -1,5 +1,5 @@ -//! Fork tangency-labs/smlib@37af643 under `Kernel::fixes.offset_keep_cavity_regions` -//! (WR-667): an inset keeps the regions that are cavity, not every finite region. +//! Fork tangency-labs/smlib@37af643 (WR-667), the kernel's default: an inset keeps the +//! regions that are cavity, not every finite region. //! //! SolidCraft rig case shell/545's frame, rebuilt from the commit message: a 20 x 20 x 5 //! block with a recess from the top ((5, 5)..(15, 15), z 3..5) and a square ring cut from @@ -8,7 +8,7 @@ //! edges, merged) open at the ring cut's outer wall x = 18: the floor is no thicker than //! the wall, its two faces' offsets cross, and the merge closes the region between them. //! Upstream's `MakeManifold` keeps every finite region ("we will need to select regions -//! to keep"), so the result is no manifold solid. With the flag only the cavity is kept. +//! to keep"), so the result is no manifold solid. The kernel keeps only the cavity. //! //! Closed form (sharp offsets, the open face's neighbours' walls ending at its plane): //! the cavity is z 0.5..2.5 over the core (7.5..12.5)^2 and the outer band @@ -27,8 +27,6 @@ mod offset_fixture; use offset_fixture::{planar_faces_at, volume, Notifications}; use solidcore::boolean::api_brep::boolean_difference; -use solidcore::error::offset::{OffsetFailure, Unsoundness}; -use solidcore::error::Reason; use solidcore::kernel::UpstreamFixes; use solidcore::math::Point3; use solidcore::offset::offset_executive::p1::OffsetExecutive; @@ -36,7 +34,7 @@ use solidcore::offset::offset_executive::p2::{OffsetOptions, ShellOptions}; use solidcore::primitive::api_primitives::create_box; use solidcore::query::api_queries::brep_is_manifold_solid; use solidcore::topology::brep::validation::{check_brep, CheckLevel}; -use solidcore::{Brep, Kernel, SolidError}; +use solidcore::{Brep, Kernel}; /// The frame, the ring cut's top at `ring_top` (2.5: a 0.5 floor under the recess). fn frame(k: &mut Kernel, ring_top: f64) -> Brep { @@ -94,108 +92,28 @@ fn shell(fixes: &UpstreamFixes, ring_top: f64) -> (bool, f64) { (manifold, volume(&k, &mut wall).unwrap()) } -fn keep_cavity() -> UpstreamFixes { - let mut f = UpstreamFixes::default(); - f.offset_keep_cavity_regions = true; - f -} - -/// With cavity selection off, the sliver between the crossing offsets leaves no -/// manifold cavity. The shell refuses it with `OffsetFailure::Unsound` and retains -/// the original frame. +/// Only the cavity is made manifold; the shell is the closed form and passes `check_brep` +/// at every level. #[test] -fn flag_off_refuses_the_sliver_and_retains_the_input() { - let mut k = Kernel::default(); - let mut part = frame(&mut k, 2.5); - part.refresh_cached_topology(); - let open = planar_faces_at(&k, &part, 0, 18.0); - assert_eq!(open.len(), 1); - let mut notifications = Notifications::new(&mut part); - let key = part.key(); - let tolerance = part.tolerance(); - let ids = ( - part.face_list().to_vec(), - part.edge_list().to_vec(), - part.vertex_list().to_vec(), - ); - let points: Vec<_> = part - .vertices() - .iter() - .map(|(id, v)| (id, v.point, v.tolerance)) - .collect(); - let outcome = OffsetExecutive::shell_brep( - &mut k, - part, - shell_options(), - &open, - &mut notifications.context(), - ); - let error = outcome.result.as_ref().unwrap_err(); - let SolidError::Failed(failure) = error else { - panic!("not a refusal: {error}"); - }; - assert_eq!( - failure.reason, - Reason::Offset(OffsetFailure::Unsound { - what: Unsoundness::NotManifoldSolid - }) - ); - assert!(!outcome.input_ownership_transferred()); - let mut retained = outcome.retained_input.unwrap(); - assert_eq!(retained.key(), key); - assert_eq!(retained.tolerance(), tolerance); - assert_eq!( - ( - retained.face_list().to_vec(), - retained.edge_list().to_vec(), - retained.vertex_list().to_vec() - ), - ids - ); - assert_eq!( - retained - .vertices() - .iter() - .map(|(id, v)| (id, v.point, v.tolerance)) - .collect::>(), - points - ); - // Check the returned caches as-is, without refreshing away an inconsistency. - assert!(solidcore::topology::integrity::check(&retained).is_ok()); - assert!(brep_is_manifold_solid(&retained).unwrap()); +fn keeps_only_the_cavity() { + let (mut k, wall) = shell_result(&UpstreamFixes::default(), 2.5); + let mut wall = wall.unwrap(); for level in [CheckLevel::Level0, CheckLevel::Level1, CheckLevel::Level2] { - let checked = check_brep(&mut k, &mut retained, level).unwrap(); + let checked = check_brep(&mut k, &mut wall, level).unwrap(); assert!(checked.is_valid(), "{level:?}: {:?}", checked.lines()); } - let v = volume(&k, &mut retained).unwrap(); - // Block 2000, less the recess 200 and square ring (256 - 36) * 2.5 = 550. - assert!((v - 1250.0).abs() <= 1e-9 * 1250.0, "{v}"); -} - -/// The flag: only the cavity is made manifold; the shell is the closed form. -#[test] -fn flag_on_keeps_only_the_cavity() { - let (manifold, v) = shell(&keep_cavity(), 2.5); + let (manifold, v) = shell(&UpstreamFixes::default(), 2.5); assert!(manifold); assert!((v - 638.75).abs() <= 1e-9 * 638.75, "{v}"); } -/// The offset fixes SolidCraft ran with on this path (WR-345's crossing loops, WR-455's -/// stitch) are the default now: with the flag the shell is the same. +/// Control: a 1.0 floor (ring top at 2) has no crossing offsets and one finite region, so +/// there is nothing to select. Closed form as above: the body is 2000 - 200 - 220 x 2 = +/// 1360; the cavity is z 0.5..2.5 over the core and the band ((25 + 80.5) x 2: 211) and +/// z 2.5..4.5 over (0.5..19.5)^2 less the recess walls (240 x 2: 480), 691; a shell of 669. #[test] -fn flag_on_with_offset_fixes() { - let fixes = keep_cavity(); - let (manifold, v) = shell(&fixes, 2.5); +fn thicker_floor_is_the_closed_form() { + let (manifold, v) = shell(&UpstreamFixes::default(), 2.0); assert!(manifold); - assert!((v - 638.75).abs() <= 1e-9 * 638.75, "{v}"); -} - -/// Control: a 1.0 floor (ring top at 2) has no crossing offsets, one finite region, and -/// shells the same with the flag off and on. -#[test] -fn thicker_floor_is_unchanged() { - let off = shell(&UpstreamFixes::default(), 2.0); - let on = shell(&keep_cavity(), 2.0); - assert!(off.0 && on.0); - assert_eq!(off.1.to_bits(), on.1.to_bits()); + assert!((v - 669.0).abs() <= 1e-9 * 669.0, "{v}"); } diff --git a/solidcore/crates/solidcore/tests/issue_1476_swept_bar_shell.rs b/solidcore/crates/solidcore/tests/issue_1476_swept_bar_shell.rs index 42c064d1f5f..03a6dadfb63 100644 --- a/solidcore/crates/solidcore/tests/issue_1476_swept_bar_shell.rs +++ b/solidcore/crates/solidcore/tests/issue_1476_swept_bar_shell.rs @@ -47,6 +47,7 @@ use solidcore::offset::offset_executive::p2::{OffsetOptions, ShellOptions}; use solidcore::query::api_queries::brep_is_manifold_solid; use solidcore::topology::brep::p10::TopologyEnv; use solidcore::topology::brep::p7::read_from_file; +use solidcore::topology::brep::validation::{check_brep, CheckLevel}; use solidcore::topology::database_io::FileType; use solidcore::topology::topology::NotifyRecords; use solidcore::{Brep, Kernel}; @@ -104,10 +105,22 @@ fn shell(fixes: &UpstreamFixes) -> (Kernel, solidcore::Result) { /// Checks the shell and returns its number of line edges. fn check(fixes: &UpstreamFixes, want: Option) -> usize { - let (k, result) = shell(fixes); + check_validated(fixes, want, false) +} + +/// [`check`]; with `validate`, the shell also passes `check_brep` at every level +/// (`Level2` runs every test, SolidCraft's `CheckLevel::All`). +fn check_validated(fixes: &UpstreamFixes, want: Option, validate: bool) -> usize { + let (mut k, result) = shell(fixes); let mut b = result.unwrap(); b.refresh_cached_topology(); assert!(brep_is_manifold_solid(&b).unwrap()); + if validate { + for level in [CheckLevel::Level0, CheckLevel::Level1, CheckLevel::Level2] { + let checked = check_brep(&mut k, &mut b, level).unwrap(); + assert!(checked.is_valid(), "{level:?}: {:?}", checked.lines()); + } + } let v = volume(&k, &mut b).unwrap(); let kinds: Vec<&str> = b .edge_list() @@ -137,11 +150,24 @@ fn check(fixes: &UpstreamFixes, want: Option) -> usize { kinds.iter().filter(|&&k| k == "line").count() } +/// The default kernel, which keeps an inset's cavity regions (WR-667). The merge leaves one +/// finite region (deduced: before #17064 the one-name fixture shelled with this selection, which +/// the verdicts' point-solve cache would have refused), which `make_manifold` keeps whatever its cavity +/// verdict, so the verdict's point solves over the operand are not run (#17393). #[test] fn issue_1476_swept_bar_shells() { assert_eq!(check(&UpstreamFixes::default(), None), 16); } +/// SolidCraft's configuration (which also keeps an inset's cavity regions, now the +/// default): the shell is the closed form and passes `check_brep` at every level. Slow in +/// debug builds, as below. +#[test] +#[ignore = "slow in debug builds (two 38 000-sample curve offsets)"] +fn issue_1476_swept_bar_shells_with_solidcraft_fixes_validates() { + assert_eq!(check_validated(&solidcraft_fixes(), None, true), 16); +} + /// About 6 s at opt-level 3 but over 4 min in a debug build (the two 38 000-sample /// offsets' knot removal): run with `--ignored` (`--profile difftest`). The default /// test above keeps the extrusion fix live; `nurbs::crv_offset`'s unit tests keep the diff --git a/solidcore/crates/solidcore/tests/issue_2260_gn_pipe_refined_range_end.rs b/solidcore/crates/solidcore/tests/issue_2260_gn_pipe_refined_range_end.rs index 747cd03ff82..6c995a0c67e 100644 --- a/solidcore/crates/solidcore/tests/issue_2260_gn_pipe_refined_range_end.rs +++ b/solidcore/crates/solidcore/tests/issue_2260_gn_pipe_refined_range_end.rs @@ -94,7 +94,6 @@ const SOLIDCRAFT_C494A18: &[&str] = &[ "offset_edges_keep_source_tolerance", "offset_extension_as_itself", "offset_extension_from_base", - "offset_keep_cavity_regions", "offset_open_edge_second_trim_point", "point_class_gap_3d_propagates_no_drop_error", "point_on_start_point_squared_tolerance", diff --git a/solidcore/crates/solidcore/tests/kernel_cases/fixes.json b/solidcore/crates/solidcore/tests/kernel_cases/fixes.json index 084cfadec1a..c06eae401d7 100644 --- a/solidcore/crates/solidcore/tests/kernel_cases/fixes.json +++ b/solidcore/crates/solidcore/tests/kernel_cases/fixes.json @@ -23,7 +23,6 @@ "validation_does_not_make_uv_trims", "edgeuse_convexity_propagates_step_off_failure", "local_operation_box_holds_new_surfaces", - "offset_keep_cavity_regions", "local_operation_refuses_loose_tangent_edges", "local_operation_step_walls", "revolution_round_offset_collapses", diff --git a/solidcore/crates/solidcore/tests/wr567_revolution_round_offset_collapses.rs b/solidcore/crates/solidcore/tests/wr567_revolution_round_offset_collapses.rs index 26c583d10b1..0d678c0d472 100644 --- a/solidcore/crates/solidcore/tests/wr567_revolution_round_offset_collapses.rs +++ b/solidcore/crates/solidcore/tests/wr567_revolution_round_offset_collapses.rs @@ -4,8 +4,10 @@ //! fillet's surface of revolution of an arc; moved in past its radius it has no offset, //! as a torus's, and the floor's and side's offsets meet across it in a circle. Upstream's //! `SmSurfOfRevolution` never collapses, and its offset builds the arc turned inside out -//! (r 0.1 or 0.5 round its centre): the shell fails with 1001 open at the rounded end's -//! other side, and is 0.85% and 4.2% low open at the rounded end. +//! (r 0.1 or 0.5 round its centre): upstream's shell fails with 1001 open at the rounded +//! end's other side, and is 0.85% and 4.2% low open at the rounded end. Without the +//! collapse test the kernel's cavity selection (WR-667) still gives the closed form open +//! at the other end. //! //! Expected: the cavity is the cylinder r 15 - t, 5 - t deep; the round takes //! r^2 (1 - pi/4) from the disc's section, its centroid r (10 - 3 pi) / (3 (4 - pi)) in @@ -27,6 +29,7 @@ use solidcore::blend::fillet_executive::api::fillet_edges; use solidcore::kernel::UpstreamFixes; use solidcore::math::Point3; use solidcore::primitive::api_primitives::create_cylinder; +use solidcore::topology::brep::validation::{check_brep, CheckLevel}; use solidcore::{Brep, Kernel}; const RD: f64 = 15.0; @@ -87,11 +90,24 @@ fn shelled(k: &mut Kernel, edge_z: f64, open_z: f64, t: f64) -> bool { ) } +/// Without the revolution's collapse test the round's offset is the arc turned inside out +/// (upstream), and the shell failed with 1001 open at the other end while the inset kept +/// every finite region. Keeping only the cavity regions (WR-667) gives the closed form, a +/// shell valid at every `check_brep` level. (Deduced, not checked: with fewer than two +/// finite regions the selection is skipped, so the result would not have changed; this +/// merge leaves at least two.) #[test] -fn wr567_default_fails_open_at_the_other_end() { - // upstream: the round's offset is the arc turned inside out +fn wr567_without_collapse_open_at_the_other_end_keeps_the_cavity() { let mut k = kernel(false); - assert!(!shelled(&mut k, -H, 0.0, 1.6)); + assert!(shelled(&mut k, -H, 0.0, 1.6)); + let b = rounded_disc(&mut k, -H); + let open = planar_faces_at(&k, &b, 2, 0.0); + let mut result = shell(&mut k, b, -1.6, &open).unwrap(); + result.refresh_cached_topology(); + for level in [CheckLevel::Level0, CheckLevel::Level1, CheckLevel::Level2] { + let checked = check_brep(&mut k, &mut result, level).unwrap(); + assert!(checked.is_valid(), "{level:?}: {:?}", checked.lines()); + } } #[test] diff --git a/solidcore/docs/offset-and-shell.md b/solidcore/docs/offset-and-shell.md index 8f286d10176..be7364f5b8d 100644 --- a/solidcore/docs/offset-and-shell.md +++ b/solidcore/docs/offset-and-shell.md @@ -275,10 +275,11 @@ face's surface and intersects neighbouring offsets instead of filling convex edg curve whose trimmed midpoint is nearest the original edge's, trims it and gives it to both offset edge uses. With `offset_analytic_mate_edges` a marched piece lying on an exact line or conic of the two surfaces is replaced by that curve. -- **The merge** joins the offset faces into one body. An inset keeps every finite region unless - `offset_keep_cavity_regions` is on; then `cavity::is_cavity_region` keeps a region whose face - has the input's face one wall behind it (a point solve along the normal). This is a local test, - not S4's winding number. +- **The merge** joins the offset faces into one body. When it leaves two or more finite regions, + an inset solid offset keeps those `cavity::is_cavity_region` finds cavity: a region with a face + that has the input's face one wall behind it and none with it one wall ahead (a point solve + along the normal). If all or none are cavity, every region is kept. This is a local test, not + S4's winding number. Without `extend_convex_edges` the rounded offset closes convex edges with cylinders and vertices with spheres (`edgeuse_offset`, `vertex_offset`, `offset_geometry_creation.rs`). @@ -434,8 +435,9 @@ local operation. sharp sector angle: print `extension_reach` for the face; a meeting outside the extension, or one that only touches its side, is the cause. A local operation uses its fixed bound instead. - **Check the side and the regions.** A face use opposite its surface negates the distance - (`faceuse_offset_with_backend`). An inset that keeps a sliver region: with - `offset_keep_cavity_regions` off, every finite region of the merge is kept (§5.2). + (`faceuse_offset_with_backend`). An inset that keeps a sliver region: check + `cavity::is_cavity_region`'s verdict for each finite region of the merge (asked only with two + or more finite regions, §5.2). - **Look at the tolerances.** Edge tolerances far above the body's after an offset mean a face was built across a collapse or a fold; run `cargo run --release -p diagnostics -- FILE.smb --out DIR` and read the large-tolerance edges. diff --git a/solidcore/plan/upstream-issues/WR-667--addendum-2026-11-15-flag-retired-single-region-no-point-solves.md b/solidcore/plan/upstream-issues/WR-667--addendum-2026-11-15-flag-retired-single-region-no-point-solves.md new file mode 100644 index 00000000000..b3951acfc89 --- /dev/null +++ b/solidcore/plan/upstream-issues/WR-667--addendum-2026-11-15-flag-retired-single-region-no-point-solves.md @@ -0,0 +1,6 @@ +Updates: WR-667 + +- **Flag retired:** `Kernel::fixes.offset_keep_cavity_regions` is gone; its fixed path is the only path. For an inset solid offset, `do_extended_offset` (`crates/solidcore/src/offset/offset_executive/p2.rs`) passes `make_manifold` only the finite regions `cavity::is_cavity_region` finds cavity, as before under the flag. +- **Change to the fixed path:** the cavity verdicts are asked only when the merge leaves two or more finite regions. With one, the selection cannot change which regions `make_manifold` keeps (a lone cavity region is every region, and with none cavity nothing is selected), so the body's point-solve cache and its three point solves per face are not built. The verdicts' own side effects on the merged body (the UV trim curves, gap and trimmed surface caches and any tolerance growth the live point classification leaves on it) are then not made either; under SolidCraft's preset, which ran the verdicts, that is the only difference for a single-region inset (measured: the goldens and the app suites). Before #17064, the swept bar of `tests/issue_1476_swept_bar_shell.rs`, read with every entity under one name, failed with `Unsupported` ("point-solve geometry owners must identify one edge or face each") building that cache, although its merge has one finite region; since #17064 the reader refuses such a body and the fixture names entities apart. A body whose geometry owners are ambiguous and whose merge leaves two or more finite regions is still refused that way: the point solve cannot tell its faces apart. +- **Why:** SolidCraft ran with the flag on (its `fixes()` preset); the kernel's default did not. With the flag on, no goldens row moves. +- **Tests:** `tests/fork_37af643_inset_keeps_cavity_regions.rs` runs on the default kernel and checks the frame with `check_brep` at every level; its flag-off test of the old path is deleted, and the 1.0-floor control is checked against its closed form 669. `tests/wr567_revolution_round_offset_collapses.rs`: without the collapse test, the disc open at the other end now shells to its closed form (to 1e-6, the fixture's tolerance) and passes `check_brep` at every level, where the inset that kept every finite region failed with 1001. `tests/issue_1476_swept_bar_shell.rs` `issue_1476_swept_bar_shells` (entities named apart) shells on the default kernel to the closed form; `issue_1476_swept_bar_shells_with_solidcraft_fixes_validates` (ignored like its slow siblings) also passes `check_brep` at every level under SolidCraft's set. On the default kernel that shell has one edge 4.6e-5 off its surfaces (tolerance 1e-5), with or without this change; the cavity selection does not run for it.