SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Wave 321/509: Kernel rig: patched holes graded by their continuity, at clashing corners and in one sheet (and 3 more)
jyviko6fc8706eea20
diff --git a/assets/locales/pending/patch-continuity-corners.json b/assets/locales/pending/patch-continuity-corners.jsonnew file mode 100644index 0000000000..5ffe39d633--- /dev/null+++ b/assets/locales/pending/patch-continuity-corners.json@@ -0,0 +1,23 @@+{+ "en": {+ "ui.patch_continuity_corner_tip": "The patch meets the faces round it at the chosen continuity along each side. At a corner where those faces meet each other with different curvatures, it stays tangent (G1) there."+ },+ "ar": {+ "ui.patch_continuity_corner_tip": "تلتقي الرقعة بالأوجه المحيطة بها بالاستمرارية المختارة على طول كل جانب. وعند زاوية تلتقي فيها تلك الأوجه بعضها ببعض بانحناءات مختلفة، تبقى مماسّة (G1) هناك."+ },+ "de": {+ "ui.patch_continuity_corner_tip": "Der Patch schließt entlang jeder Seite mit der gewählten Stetigkeit an die umgebenden Flächen an. An einer Ecke, an der diese Flächen mit unterschiedlicher Krümmung aufeinandertreffen, bleibt er dort tangential (G1)."+ },+ "he": {+ "ui.patch_continuity_corner_tip": "הטלאי פוגש את הפאות שסביבו ברציפות שנבחרה לאורך כל צלע. בפינה שבה הפאות האלה נפגשות זו עם זו בעקמומיות שונה, הוא נשאר משיק (G1) שם."+ },+ "ja": {+ "ui.patch_continuity_corner_tip": "パッチは各辺に沿って、周囲の面と選んだ連続性でつながります。周囲の面どうしが異なる曲率で接するコーナーでは、そこで接線 (G1) にとどまります。"+ },+ "ko": {+ "ui.patch_continuity_corner_tip": "패치는 각 변을 따라 주변 면과 선택한 연속성으로 이어집니다. 주변 면끼리 서로 다른 곡률로 만나는 모서리에서는 그곳에서 접선(G1)으로 유지됩니다."+ },+ "zh": {+ "ui.patch_continuity_corner_tip": "补面沿每条边以所选的连续性与周围的面相接。在周围的面彼此以不同曲率相接的角上,补面在该处保持相切 (G1)。"+ }+}diff --git a/crates/engine/src/cmd/surface.rs b/crates/engine/src/cmd/surface.rsindex 0383998f5c..dc1d320e05 100644--- a/crates/engine/src/cmd/surface.rs+++ b/crates/engine/src/cmd/surface.rs@@ -19,7 +19,7 @@ pub static COMMANDS: &[CommandSpec] = &[CommandSpec::new("surface.patch", "Patch", patch).at("SURFACE", "CREATE").icon("surface_patch")- .params("sketch?: id|name and profiles? (planar patches of sketch regions) | edges: [[x,y,z]] (points on a closed loop of a body's edges: one face on them, planar when the loop is, else a smooth B-spline surface) and body?; continuity?: g0|g1|g2 (edges only, default g0: how the patch meets the faces beside the loop — g1 their tangent planes, g2 also their curvature across the edges) or [{edge: [x,y,z], g: g0|g1|g2}] (those edges so, the rest g0) or {all, edges}; points?: [[x,y,z]] (edges only, up to 64: points the patch passes through); crown?: number −0.9…3 (default 0: only a fitted patch, whose middle becomes fuller by this many times the loop's size — the bump vanishes on the loop, so the face still meets the picked edges and the continuity across them; a loop that is planar and g0 is the exact plane whatever the crown; with points, crown needs a g1 or g2 edge); name?, body_name?"),+ .params("sketch?: id|name and profiles? (planar patches of sketch regions) | edges: [[x,y,z]] (points on a closed loop of a body's edges: one face on them, planar when the loop is, else a smooth B-spline surface) and body?; continuity?: g0|g1|g2|g3|g4 (edges only, default g0: how the patch meets the faces beside the loop — g1 their tangent planes, g2 also their curvature across the edges, g3 also its rate of change, g4 the change of that rate) or [{edge: [x,y,z], g: g0|g1|g2|g3|g4}] (those edges so, the rest g0) or {all, edges}; points?: [[x,y,z]] (edges only, up to 64: points the patch passes through); crown?: number −0.9…3 (default 0: only a fitted patch, whose middle becomes fuller by this many times the loop's size — the bump vanishes on the loop, so the face still meets the picked edges and the continuity across them; a loop that is planar and g0 is the exact plane whatever the crown; with points, crown needs a g1 or higher edge); name?, body_name?"),CommandSpec::new("surface.stitch", "Stitch", stitch).at("SURFACE", "MODIFY").icon("surface_stitch")diff --git a/crates/geom/src/fill_general.rs b/crates/geom/src/fill_general.rsindex dd842d1ee8..a6ccab9766 100644--- a/crates/geom/src/fill_general.rs+++ b/crates/geom/src/fill_general.rs@@ -1091,7 +1091,7 @@ fn crown(surface: NurbsSurface, net: &Net, st: &[Station], dev: &Developed, crowif crown == 0.0 {return Ok(surface);}- // The side the neighbours' normals face, by the patch's normals at the G1/G2 stations.+ // The side the neighbours' normals face, by the patch's normals at the stations of G1 and up.let mut side = 0.0;for (s, q) in st.iter().zip(&dev.d) {if let (Some(a), Some((n, _, _))) = (s.across, net.frame(*q)) {@@ -1099,7 +1099,7 @@ fn crown(surface: NurbsSurface, net: &Net, st: &[Station], dev: &Developed, crow}}if side == 0.0 {- return Err(SplineError::Unsupported("crowning a patch with no g1 or g2 edge to say which side is out".into()));+ return Err(SplineError::Unsupported("crowning a patch with no g1 or higher edge to say which side is out".into()));}let sign = side.signum();let along = |g: [f64; 2]| net.frame(g).map(|(n, _, _)| n * sign);diff --git a/crates/kernel/src/continuity_order.rs b/crates/kernel/src/continuity_order.rsindex 2e93d27ea1..98318cdee9 100644--- a/crates/kernel/src/continuity_order.rs+++ b/crates/kernel/src/continuity_order.rs@@ -132,9 +132,8 @@ impl Continuity {/// What builds geometry to a continuity order, and the orders each one builds today.////// HAND-OFF POINT: this table is the only place that says how far a construction goes. When a-/// construction learns a higher order, raise its `highest` in [`Construction::orders`] (for the-/// patch, from the fill's own `supported_orders` once it has one); every command, dialog and-/// kernel entry point reads it from here, so nothing else changes.+/// construction learns a higher order, raise its `highest` in [`Construction::orders`]; every+/// command, dialog and kernel entry point reads it from here, so nothing else changes.#[derive(Clone, Copy, PartialEq, Eq, Debug)]pub enum Construction {/// A patch filling a loop of edges (`surface.patch`).@@ -154,7 +153,7 @@ impl Construction {/// The lowest and the highest order this construction builds.pub fn orders(self) -> (Continuity, Continuity) {match self {- Construction::Patch => (Continuity::G0, Continuity::G2),+ Construction::Patch => (Continuity::G0, Continuity::G4),Construction::Bridge => (Continuity::G0, Continuity::G3),Construction::Network => (Continuity::G0, Continuity::G2),Construction::Match => (Continuity::G1, Construction::Bridge.orders().1),@@ -224,14 +223,15 @@ mod tests {fn a_construction_refuses_what_it_does_not_build_and_names_what_it_does() {assert_eq!(Continuity::words(Continuity::G0, Continuity::G2), "g0, g1 or g2");assert_eq!(Continuity::words(Continuity::G4, Continuity::G4), "g4");- assert_eq!(Continuity::G2.built_by(Construction::Patch).unwrap(), Continuity::G2);- let e = Continuity::G3.built_by(Construction::Patch).unwrap_err().to_string();+ assert_eq!(Continuity::G4.built_by(Construction::Patch).unwrap(), Continuity::G4);+ let e = Continuity::G3.built_by(Construction::Network).unwrap_err().to_string();assert!(e.contains("not supported yet") && e.contains("g0, g1 or g2") && e.contains("g3"), "{e}");let e = Continuity::G0.built_by(Construction::Match).unwrap_err().to_string();assert!(e.contains("g1, g2 or g3"), "{e}");assert!(Continuity::G4.built_by(Construction::Bridge).is_err());assert!(Continuity::G4.built_by(Construction::BlendCurve).is_ok());- assert_eq!(Construction::Patch.offered(), vec![Continuity::G0, Continuity::G1, Continuity::G2]);+ assert_eq!(Construction::Patch.offered(), Continuity::ALL.to_vec());+ assert_eq!(Construction::Network.offered(), vec![Continuity::G0, Continuity::G1, Continuity::G2]);assert_eq!(Construction::BlendCurve.offered().first(), Some(&Continuity::G1));}}diff --git a/crates/kernel/src/fill_general_tests.rs b/crates/kernel/src/fill_general_tests.rsindex 870ff5a867..4ca551e15f 100644--- a/crates/kernel/src/fill_general_tests.rs+++ b/crates/kernel/src/fill_general_tests.rs@@ -533,12 +533,44 @@ fn seam_jumps(open: &Body, fill: &Body) -> Vec<[f64; 4]> {out}+/// The Continuity Analysis (`inspect.continuity`) of `fill` sewn into `open`, on the seams at+/// `hole`: per seam, its order over the whole edge, its order over the stations from 30 % to 70 %+/// (the corners left out), and the worst G3 jump there (1/mm²).+fn continuity_analysis(open: &Body, fill: &Body, hole: &[Vec3]) -> Vec<(Option<Continuity>, Option<Continuity>, f64)> {+ use crate::{ContinuityTolerances, EdgePick, pick_edges, seam_diagnostics};+ let sewn = stitch(&[open, fill], 1e-3).unwrap();+ let picks: Vec<EdgePick> = hole.iter().map(|p| EdgePick::Point(*p)).collect();+ let edges = pick_edges(&sewn, &picks).unwrap();+ let t = ContinuityTolerances::default();+ let limits = [t.gap_mm, t.angle_deg, t.curvature_per_mm, t.curvature_change_per_mm2, t.curvature_change_rate_per_mm3];+ let report = seam_diagnostics(&sewn, &edges, 33, t).unwrap();+ report+ .seams+ .iter()+ .map(|seam| {+ let inside: Vec<_> = seam.stations.iter().filter(|s| (0.3..=0.7).contains(&s.edge_fraction)).collect();+ let worst = |f: fn(&crate::SeamStation) -> f64| inside.iter().map(|s| f(s)).fold(0.0f64, f64::max);+ let metrics = [+ worst(|s| s.gap_mm),+ worst(|s| s.normal_angle_deg),+ worst(|s| s.curvature_jump_per_mm),+ worst(|s| s.curvature_change_jump_per_mm2),+ worst(|s| s.curvature_change_rate_jump_per_mm3),+ ];+ let met = metrics.iter().zip(limits).take_while(|(w, l)| **w <= *l).count();+ (seam.order, met.checked_sub(1).and_then(Continuity::from_order), metrics[3])+ })+ .collect()+}+/// A box's corner where a round of 8 up the vertical edge meets the rounds of 4 along the top/// (one blend face rolls the top round over the vertical one); that face taken off, and the hole-/// patched G2 and G3 to the rounds and the top around it. Read off the faces themselves in the-/// middle of each seam: both meet the tangent planes and the curvature; the G3 patch also meets-/// the curvature's rate of change, which the G2 patch leaves many times larger. G3 to an edge-/// between two faces is refused.+/// patched G2, G3 and G4 to the rounds and the top around it. Read off the faces themselves in+/// the middle of each seam: all meet the tangent planes and the curvature; the G3 patch also meets+/// the curvature's rate of change, which the G2 patch leaves many times larger. The Continuity+/// Analysis reads each seam's middle at the order asked, and the whole seam G1: at the corners the+/// rounds' curvatures differ, so no patch can meet both. G3 to an edge between two faces is+/// refused.#[test]fn a_corner_of_three_rounds_patched_g3_holds_the_curvature_change_a_g2_patch_does_not() {let solid = box_solid(Vec3::ZERO, Vec3::new(40.0, 40.0, 30.0)).unwrap();@@ -554,12 +586,19 @@ fn a_corner_of_three_rounds_patched_g3_holds_the_curvature_change_a_g2_patch_doeassert!(open.is_surface());let hole = [Vec3::new(34.828, 34.828, 30.0), Vec3::new(37.657, 37.657, 26.0), Vec3::new(38.828, 32.0, 28.828), Vec3::new(32.0, 38.828, 28.828)];let mut read = Vec::new();- for g in [Continuity::G2, Continuity::G3] {+ for g in [Continuity::G2, Continuity::G3, Continuity::G4] {let name = format!("three-round corner {}", g.as_str());let (fill, r) = patch_edges_report(&open, &hole, &spec(g)).unwrap();report(&name, &r);let seams = seam_jumps(&open, &fill);eprintln!("{name}: jumps of the fill's report {:?}; read off the faces, per seam [angle°, H2, H3, H4] {seams:?}", r.jumps);+ let analysed = continuity_analysis(&open, &fill, &hole);+ eprintln!("{name}: Continuity Analysis, per seam [order over the edge, order 30-70 %, worst G3 jump 30-70 % /mm²] {analysed:?}");+ assert_eq!(analysed.len(), 4, "{name}: four seams analysed");+ for (whole, middle, _) in &analysed {+ assert_eq!(*middle, Some(g), "{name}: the Continuity Analysis reads the order asked in the middle of each seam");+ assert_eq!(*whole, Some(Continuity::G1), "{name}: the corners, where the rounds' curvatures differ, hold the tangent plane only");+ }assert_eq!(seams.len(), 4, "{name}: four seams");for s in &seams {assert!(s[0] < PATCH_ANGLE_TOL_DEG, "{name}: the tangent planes meet: {s:?}");diff --git a/crates/smlib/SMLIB_PREBUILT b/crates/smlib/SMLIB_PREBUILTindex b6eb099516..207dd839f1 100644--- a/crates/smlib/SMLIB_PREBUILT+++ b/crates/smlib/SMLIB_PREBUILT@@ -1,10 +1,10 @@# Rust target, SHA-256 of smlib-<target>.tar.gz in the release prebuilt-<SMLIB_REV> of# tangency-labs/smlib. Written by scripts/fetch-smlib.sh --pin; never edited by hand.-aarch64-apple-darwin 5d58858aa07df01802bbda6349d706f0325b5a2cab32ae61b97e46fc7931be20-aarch64-pc-windows-msvc a888acec73e95960c1bafb82f4436ae3690a3ad6cca53fa11df612ba783202c7-aarch64-unknown-linux-gnu fb840ddc12ce2e20b3d8a986c4481919b80b401bf49601479feabc09f5bcacd1-i686-pc-windows-msvc b45081e2daf5770204e8adc60ff9c30f782351b01ef36448a7188549efd9e5f2-wasm32-unknown-unknown a8b9ccd974894f3986d6690765bad788b8b5b119433b74c219c0387a10a8ef33-x86_64-apple-darwin 2bc0eddedc9905a8a2217419da9e2b6c2ef73ff745ae428f117ae0c9588b83d5-x86_64-pc-windows-msvc e65325a734e2d16232b4ec976f676e1d50a5a6bbdd1423266547e9fa35623a8f-x86_64-unknown-linux-gnu 9a0d125698d83bd58ded8c95c4c19f6002fe9a8751031b5df5f6b1bb5633442f+aarch64-apple-darwin d5f9ee5b49f2b1b9777a27942401516a59384105c2dce58a6bd571efe7d77aa8+aarch64-pc-windows-msvc d5df522ed4459dad9ffba4d5b22c05f8bebcf4d5ba217f62395c2ea689492f14+aarch64-unknown-linux-gnu b7849d6dbdb358380b7352742dccfd33a71bc423e1fda18566fcd58a0b406ff3+i686-pc-windows-msvc 6b7cb77f7fd05f5f458689e49547ec9d9d4920f28cd79f5c16ae44fa8682bc46+wasm32-unknown-unknown 63f9c65ae041d1db4b8ffb7306bd6a4f4b7f125f6fb1772ca5dcc14763c76bd6+x86_64-apple-darwin 99a5e32ae73c82f9020a046245312cb5352974069a464af3ac9da1f624800ad1+x86_64-pc-windows-msvc 828211a338c42be882eb9084fef89087479b713dd641bb3aa0b3b2b70a2b3bfa+x86_64-unknown-linux-gnu f69203a49aa1c1a4272364cb13585c84557c466f4863adc66cb1a5f623462289diff --git a/crates/smlib/SMLIB_REV b/crates/smlib/SMLIB_REVindex af859a2f50..4ae676f19b 100644--- a/crates/smlib/SMLIB_REV+++ b/crates/smlib/SMLIB_REV@@ -1 +1 @@-5afca53ff480524e5afd33c0c4f413904a01de69+7e917f0a308d620491fdbc07c5e07fb29a2b8300diff --git a/crates/ui-egui/src/dialogs_surface.rs b/crates/ui-egui/src/dialogs_surface.rsindex b2b75dd134..b5678aa224 100644--- a/crates/ui-egui/src/dialogs_surface.rs+++ b/crates/ui-egui/src/dialogs_surface.rs@@ -144,6 +144,13 @@ fn patch_orders() -> Vec<Continuity> {Construction::Patch.offered()}+/// The patch's hover text: each order's line, then what the patch reaches at a corner whose+/// faces meet each other with different curvatures (tangent only: no surface smooth at the corner+/// has both curvatures there).+fn patch_continuity_tip() -> String {+ format!("{}\n{}", ui_kit::continuity_tip(&patch_orders()), crate::i18n::tr("ui.patch_continuity_corner_tip"))+}+fn blend_orders() -> Vec<Continuity> {Construction::Bridge.offered()}@@ -284,7 +291,7 @@ pub fn rows(ui: &mut egui::Ui, k: &mut Surf) -> bool {ui_kit::options(ui, "untrim_options", &mut [("Restore outer boundary", outer), ("In place (surfaces)", in_place)]);}Surf::Patch { continuity } => {- ui_kit::continuity_row(ui, "Continuity", "pa_cont", continuity, &patch_orders());+ ui_kit::continuity_row_explained(ui, "Continuity", "pa_cont", continuity, &patch_orders(), &patch_continuity_tip());}Surf::Blend { continuity, bulge, stitch } => {let [from, to] = continuity;@@ -1116,5 +1123,9 @@ mod tests {}}assert_eq!(ui_kit::continuity_tip(&blend_orders()).lines().count(), 4);+ // The patch's hover text adds what it does at a corner whose faces' curvatures differ.+ let tip = patch_continuity_tip();+ assert_eq!(tip.lines().count(), patch_orders().len() + 1, "{tip}");+ assert!(tip.lines().last().is_some_and(|l| l.contains("corner") && l.contains("G1")), "{tip}");}}diff --git a/examples/clean-up/three-round-corner.json b/examples/clean-up/three-round-corner.jsonindex fbbb958619..f67b999e91 100644--- a/examples/clean-up/three-round-corner.json+++ b/examples/clean-up/three-round-corner.json@@ -1,5 +1,5 @@{- "description": "A corner where three rounds meet: a 40 x 40 x 30 box with its vertical edge rounded R8, then its two top edges and the arc between them over that round rounded R4 (one tangent chain). The top round rolls over the vertical one in one blend face at the corner, which meets its neighbours tangent but jumps in curvature. It is taken off (face.delete with heal false) and the hole patched from its four edges with Curvature (g2) and, beside it, with Curvature change (g3). Both meet the rounds and the top in tangent plane and curvature; the g3 patch also meets the curvature's rate of change in the middle of each seam (below 1e-4 /mm^2, against 0.27 to 0.63 for g2). The g3 patch needs surface.patch to take g3.",+ "description": "A corner where three rounds meet: a 40 x 40 x 30 box with its vertical edge rounded R8, then its two top edges and the arc between them over that round rounded R4 (one tangent chain). The top round rolls over the vertical one in one blend face at the corner, which meets its neighbours tangent but jumps in curvature. It is taken off (face.delete with heal false) and the hole patched from its four edges with Curvature (g2) and, beside it, with Curvature change (g3). Both meet the rounds and the top in tangent plane and curvature; the g3 patch also meets the curvature's rate of change in the middle of each seam (below 1e-4 /mm^2, against 0.27 to 0.63 for g2).","commands": [{"command": "solid.box", "params": {"corner": [0, 0, 0], "length": 40, "width": 40, "height": 30, "body_name": "Plate"}},{"command": "solid.fillet", "params": {"body": "Plate", "edges": [[40, 40, 15]], "radius": 8}},diff --git a/tests/kernel-cases/continuity/g1-patch-g2-at-a-corner-whose-rounds-clash/expected.json b/tests/kernel-cases/continuity/g1-patch-g2-at-a-corner-whose-rounds-clash/expected.jsonnew file mode 100644index 0000000000..96dc1b3535--- /dev/null+++ b/tests/kernel-cases/continuity/g1-patch-g2-at-a-corner-whose-rounds-clash/expected.json@@ -0,0 +1,33 @@+{+ "sources": [],+ "body_count": 1,+ "what": "the hole a three-round corner's blend face leaves, patched g2 (Curvature): G1 and not G2 over each whole seam, since the faces round the hole meet each other G1 at its corners",+ "source": "analytic",+ "method": "box 40x40x30, its vertical edge at (40,40) rounded r8, then the top edges and the arc between them rounded r4; the blend face at the corner deleted (heal false), the four-sided hole patched g2 and stitched in. At each corner of the hole two of its neighbours (the r4 rounds, the r8 round) meet along their own G1 seam, their normal curvatures there differing by 1/4 or 1/8 per mm; a patch smooth at the corner has one curvature there, so it cannot meet both, and the fill asks no more than G1 near such a corner. Each seam's worst G2 station is its end: 0.125 or 0.25 per mm. In the middle of each seam (30-70 %) the patch reaches g2 (kernel test a_corner_of_three_rounds_patched_g3_holds_the_curvature_change_a_g2_patch_does_not).",+ "continuity": {+ "order": "g1",+ "exact": true,+ "edges": [+ [+ 34.828,+ 34.828,+ 30.0+ ],+ [+ 37.657,+ 37.657,+ 26.0+ ],+ [+ 38.828,+ 32.0,+ 28.828+ ],+ [+ 32.0,+ 38.828,+ 28.828+ ]+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/continuity/g1-patch-g2-at-a-corner-whose-rounds-clash/recipe.json b/tests/kernel-cases/continuity/g1-patch-g2-at-a-corner-whose-rounds-clash/recipe.jsonnew file mode 100644index 0000000000..fcc58d61ea--- /dev/null+++ b/tests/kernel-cases/continuity/g1-patch-g2-at-a-corner-whose-rounds-clash/recipe.json@@ -0,0 +1,104 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "corner": [+ 0,+ 0,+ 0+ ],+ "length": 40,+ "width": 40,+ "height": 30,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "body": "Plate",+ "edges": [+ [+ 40,+ 40,+ 15+ ]+ ],+ "radius": 8+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "body": "Plate",+ "edges": [+ [+ 40,+ 20,+ 30+ ],+ [+ 20,+ 40,+ 30+ ]+ ],+ "radius": 4+ }+ },+ {+ "command": "face.delete",+ "params": {+ "body": "Plate",+ "faces": [+ [+ 37.79,+ 36.155,+ 28.43+ ]+ ],+ "heal": false+ }+ },+ {+ "command": "surface.patch",+ "params": {+ "body": "Plate",+ "edges": [+ [+ 34.828,+ 34.828,+ 30.0+ ],+ [+ 37.657,+ 37.657,+ 26.0+ ],+ [+ 38.828,+ 32.0,+ 28.828+ ],+ [+ 32.0,+ 38.828,+ 28.828+ ]+ ],+ "continuity": "g2",+ "body_name": "Patch"+ }+ },+ {+ "command": "surface.stitch",+ "params": {+ "bodies": [+ "Plate",+ "Patch"+ ]+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/continuity/g1-patch-g3-at-a-corner-whose-rounds-clash/expected.json b/tests/kernel-cases/continuity/g1-patch-g3-at-a-corner-whose-rounds-clash/expected.jsonnew file mode 100644index 0000000000..2d9482c329--- /dev/null+++ b/tests/kernel-cases/continuity/g1-patch-g3-at-a-corner-whose-rounds-clash/expected.json@@ -0,0 +1,33 @@+{+ "sources": [],+ "body_count": 1,+ "what": "the hole a three-round corner's blend face leaves, patched g3 (Curvature change): G1 and not G2 over each whole seam, since the faces round the hole meet each other G1 at its corners",+ "source": "analytic",+ "method": "box 40x40x30, its vertical edge at (40,40) rounded r8, then the top edges and the arc between them rounded r4; the blend face at the corner deleted (heal false), the four-sided hole patched g3 and stitched in. At each corner of the hole two of its neighbours (the r4 rounds, the r8 round) meet along their own G1 seam, their normal curvatures there differing by 1/4 or 1/8 per mm; a patch smooth at the corner has one curvature there, so it cannot meet both, and the fill asks no more than G1 near such a corner. Each seam's worst G2 station is its end: 0.125 or 0.25 per mm. In the middle of each seam (30-70 %) the patch reaches g3 (kernel test a_corner_of_three_rounds_patched_g3_holds_the_curvature_change_a_g2_patch_does_not).",+ "continuity": {+ "order": "g1",+ "exact": true,+ "edges": [+ [+ 34.828,+ 34.828,+ 30.0+ ],+ [+ 37.657,+ 37.657,+ 26.0+ ],+ [+ 38.828,+ 32.0,+ 28.828+ ],+ [+ 32.0,+ 38.828,+ 28.828+ ]+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/continuity/g1-patch-g3-at-a-corner-whose-rounds-clash/recipe.json b/tests/kernel-cases/continuity/g1-patch-g3-at-a-corner-whose-rounds-clash/recipe.jsonnew file mode 100644index 0000000000..b2ea368fcf--- /dev/null+++ b/tests/kernel-cases/continuity/g1-patch-g3-at-a-corner-whose-rounds-clash/recipe.json@@ -0,0 +1,104 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "corner": [+ 0,+ 0,+ 0+ ],+ "length": 40,+ "width": 40,+ "height": 30,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "body": "Plate",+ "edges": [+ [+ 40,+ 40,+ 15+ ]+ ],+ "radius": 8+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "body": "Plate",+ "edges": [+ [+ 40,+ 20,+ 30+ ],+ [+ 20,+ 40,+ 30+ ]+ ],+ "radius": 4+ }+ },+ {+ "command": "face.delete",+ "params": {+ "body": "Plate",+ "faces": [+ [+ 37.79,+ 36.155,+ 28.43+ ]+ ],+ "heal": false+ }+ },+ {+ "command": "surface.patch",+ "params": {+ "body": "Plate",+ "edges": [+ [+ 34.828,+ 34.828,+ 30.0+ ],+ [+ 37.657,+ 37.657,+ 26.0+ ],+ [+ 38.828,+ 32.0,+ 28.828+ ],+ [+ 32.0,+ 38.828,+ 28.828+ ]+ ],+ "continuity": "g3",+ "body_name": "Patch"+ }+ },+ {+ "command": "surface.stitch",+ "params": {+ "bodies": [+ "Plate",+ "Patch"+ ]+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/continuity/g2-patch-g2-on-a-hole-in-one-sheet/expected.json b/tests/kernel-cases/continuity/g2-patch-g2-on-a-hole-in-one-sheet/expected.jsonnew file mode 100644index 0000000000..056ca57aeb--- /dev/null+++ b/tests/kernel-cases/continuity/g2-patch-g2-on-a-hole-in-one-sheet/expected.json@@ -0,0 +1,32 @@+{+ "sources": [],+ "body_count": 1,+ "what": "a square hole in one smooth sheet, patched g2 (Curvature): every seam reaches g2, corners included, since round the hole there is only the one surface and its corners ask nothing it cannot give",+ "source": "invariants",+ "method": "the sheet: a single-span cubic Bezier through control points (0,0), (13,8), (27,-8), (40,0) on XZ, extruded 40 as a surface; trimmed by the square x, y 12..28 swept along Z, keeping the outside. The hole's sides are two copies of the profile's middle (at y = 12 and 28) and two straight rulings (x = 12 and 28), all on the one face. Patched g2 from its four edges and stitched in. Each corner's two sides lie on the same surface, so they agree to every order and the fill holds the order asked up to the corners. Not exact: a fill may read higher where it happens to.",+ "continuity": {+ "order": "g2",+ "edges": [+ [+ 20,+ 12,+ 0.0+ ],+ [+ 28,+ 20,+ 2.002857+ ],+ [+ 20,+ 28,+ 0.0+ ],+ [+ 12,+ 20,+ -2.002857+ ]+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/continuity/g2-patch-g2-on-a-hole-in-one-sheet/recipe.json b/tests/kernel-cases/continuity/g2-patch-g2-on-a-hole-in-one-sheet/recipe.jsonnew file mode 100644index 0000000000..62a8c9afdf--- /dev/null+++ b/tests/kernel-cases/continuity/g2-patch-g2-on-a-hole-in-one-sheet/recipe.json@@ -0,0 +1,138 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": "XZ"+ }+ },+ {+ "command": "sketch.spline.control_point",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 13,+ 8+ ],+ [+ 27,+ -8+ ],+ [+ 40,+ 0+ ]+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "surface.extrude",+ "params": {+ "sketch": "Sketch1",+ "curves": [+ "s1"+ ],+ "distance": 40,+ "body_name": "Sheet"+ }+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": "XY"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 12,+ 12+ ],+ [+ 28,+ 12+ ],+ [+ 28,+ 28+ ],+ [+ 12,+ 28+ ],+ [+ 12,+ 12+ ]+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "surface.trim",+ "params": {+ "body": "Sheet",+ "curves": {+ "sketch": "Sketch2"+ },+ "keep": [+ 2,+ 2,+ -1.044595+ ]+ }+ },+ {+ "command": "surface.patch",+ "params": {+ "body": "Sheet",+ "edges": [+ [+ 20,+ 12,+ 0.0+ ],+ [+ 28,+ 20,+ 2.002857+ ],+ [+ 20,+ 28,+ 0.0+ ],+ [+ 12,+ 20,+ -2.002857+ ]+ ],+ "continuity": "g2",+ "body_name": "Patch"+ }+ },+ {+ "command": "surface.stitch",+ "params": {+ "bodies": [+ "Sheet",+ "Patch"+ ]+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/continuity/g3-patch-g3-on-a-hole-in-one-sheet/expected.json b/tests/kernel-cases/continuity/g3-patch-g3-on-a-hole-in-one-sheet/expected.jsonnew file mode 100644index 0000000000..cc0354bcc9--- /dev/null+++ b/tests/kernel-cases/continuity/g3-patch-g3-on-a-hole-in-one-sheet/expected.json@@ -0,0 +1,32 @@+{+ "sources": [],+ "body_count": 1,+ "what": "a square hole in one smooth sheet, patched g3 (Curvature change): every seam reaches g3, corners included, since round the hole there is only the one surface and its corners ask nothing it cannot give",+ "source": "invariants",+ "method": "the sheet: a single-span cubic Bezier through control points (0,0), (13,8), (27,-8), (40,0) on XZ, extruded 40 as a surface; trimmed by the square x, y 12..28 swept along Z, keeping the outside. The hole's sides are two copies of the profile's middle (at y = 12 and 28) and two straight rulings (x = 12 and 28), all on the one face. Patched g3 from its four edges and stitched in. Each corner's two sides lie on the same surface, so they agree to every order and the fill holds the order asked up to the corners. Not exact: a fill may read higher where it happens to.",+ "continuity": {+ "order": "g3",+ "edges": [+ [+ 20,+ 12,+ 0.0+ ],+ [+ 28,+ 20,+ 2.002857+ ],+ [+ 20,+ 28,+ 0.0+ ],+ [+ 12,+ 20,+ -2.002857+ ]+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/continuity/g3-patch-g3-on-a-hole-in-one-sheet/recipe.json b/tests/kernel-cases/continuity/g3-patch-g3-on-a-hole-in-one-sheet/recipe.jsonnew file mode 100644index 0000000000..61662b2179--- /dev/null+++ b/tests/kernel-cases/continuity/g3-patch-g3-on-a-hole-in-one-sheet/recipe.json@@ -0,0 +1,138 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": "XZ"+ }+ },+ {+ "command": "sketch.spline.control_point",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 13,+ 8+ ],+ [+ 27,+ -8+ ],+ [+ 40,+ 0+ ]+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "surface.extrude",+ "params": {+ "sketch": "Sketch1",+ "curves": [+ "s1"+ ],+ "distance": 40,+ "body_name": "Sheet"+ }+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": "XY"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 12,+ 12+ ],+ [+ 28,+ 12+ ],+ [+ 28,+ 28+ ],+ [+ 12,+ 28+ ],+ [+ 12,+ 12+ ]+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "surface.trim",+ "params": {+ "body": "Sheet",+ "curves": {+ "sketch": "Sketch2"+ },+ "keep": [+ 2,+ 2,+ -1.044595+ ]+ }+ },+ {+ "command": "surface.patch",+ "params": {+ "body": "Sheet",+ "edges": [+ [+ 20,+ 12,+ 0.0+ ],+ [+ 28,+ 20,+ 2.002857+ ],+ [+ 20,+ 28,+ 0.0+ ],+ [+ 12,+ 20,+ -2.002857+ ]+ ],+ "continuity": "g3",+ "body_name": "Patch"+ }+ },+ {+ "command": "surface.stitch",+ "params": {+ "bodies": [+ "Sheet",+ "Patch"+ ]+ }+ }+ ]+}\ No newline at end of file