SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Wave 56/509: kernel-cases: threads cases from modelled-thread reports (1 of 2)
Brennen Herbruck5f8a58956f5c
diff --git a/tests/kernel-cases/threads/1250-external-m10x1.5-shaft-full-length/expected.json b/tests/kernel-cases/threads/1250-external-m10x1.5-shaft-full-length/expected.jsonnew file mode 100644index 0000000000..0772527259--- /dev/null+++ b/tests/kernel-cases/threads/1250-external-m10x1.5-shaft-full-length/expected.json@@ -0,0 +1,31 @@+{+ "sources": [+ "tangency-labs/solidcraft#1250"+ ],+ "what": "a modelled external M10 thread over the whole length of a 10 mm shaft (8 turns)",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. Shaft R=5.0 L=12, M10x1.5 (P=1.5) over its whole length, both ends free: V = pi R^2 L - (L/P) V_turn = 942.4778 - 8 x 20.09743 = 781.6984 mm3. COM on the axis at L/2 (6): the groove is symmetric over whole turns. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 781.6984,+ "center_of_mass": [+ 0,+ 0,+ 6.0+ ],+ "bbox": {+ "min": [+ -5.0,+ -5.0,+ 0+ ],+ "max": [+ 5.0,+ 5.0,+ 12+ ]+ },+ "tolerance": {+ "rel": 0.01+ }+}diff --git a/tests/kernel-cases/threads/1250-external-m10x1.5-shaft-full-length/recipe.json b/tests/kernel-cases/threads/1250-external-m10x1.5-shaft-full-length/recipe.jsonnew file mode 100644index 0000000000..a0b5cc458b--- /dev/null+++ b/tests/kernel-cases/threads/1250-external-m10x1.5-shaft-full-length/recipe.json@@ -0,0 +1,24 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 5.0,+ "height": 12,+ "body_name": "Shaft"+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 5.0,+ 0,+ 6.0+ ],+ "designation": "M10x1.5",+ "modeled": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/1395-long-external-m6-thread-24-turns/expected.json b/tests/kernel-cases/threads/1395-long-external-m6-thread-24-turns/expected.jsonnew file mode 100644index 0000000000..fa969c2ec6--- /dev/null+++ b/tests/kernel-cases/threads/1395-long-external-m6-thread-24-turns/expected.json@@ -0,0 +1,31 @@+{+ "sources": [+ "tangency-labs/solidcraft#1395"+ ],+ "what": "a long modelled external thread: M6 over a 24 mm shaft (24 turns), the kind that once ran out of depth in the boolean",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. Shaft R=3.0 L=24, M6 (P=1.0) over its whole length, both ends free: V = pi R^2 L - (L/P) V_turn = 678.5840 - 24 x 5.31713 = 550.9729 mm3. COM on the axis at L/2 (12): the groove is symmetric over whole turns. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 550.9729,+ "center_of_mass": [+ 0,+ 0,+ 12.0+ ],+ "bbox": {+ "min": [+ -3.0,+ -3.0,+ 0+ ],+ "max": [+ 3.0,+ 3.0,+ 24+ ]+ },+ "tolerance": {+ "rel": 0.01+ }+}diff --git a/tests/kernel-cases/threads/1395-long-external-m6-thread-24-turns/recipe.json b/tests/kernel-cases/threads/1395-long-external-m6-thread-24-turns/recipe.jsonnew file mode 100644index 0000000000..f7b7ddff5c--- /dev/null+++ b/tests/kernel-cases/threads/1395-long-external-m6-thread-24-turns/recipe.json@@ -0,0 +1,24 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 3.0,+ "height": 24,+ "body_name": "Shaft"+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 3.0,+ 0,+ 12.0+ ],+ "designation": "M6",+ "modeled": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/1443-m5x0.7-thread-in-5mm-hole/expected.json b/tests/kernel-cases/threads/1443-m5x0.7-thread-in-5mm-hole/expected.jsonnew file mode 100644index 0000000000..4e13a41ccc--- /dev/null+++ b/tests/kernel-cases/threads/1443-m5x0.7-thread-in-5mm-hole/expected.json@@ -0,0 +1,32 @@+{+ "sources": [+ "tangency-labs/solidcraft#1443",+ "tangency-labs/solidcraft#3060"+ ],+ "what": "a modelled M5x0.7 thread in a 5 mm hole (refused: it would cut 0.00 mm of the thread's depth)",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. A 5 mm hole through a D14 x 4.2 disc, drawn at the thread's nominal size, takes a modelled M5x0.7: the hole is first filled to the tap drill (major - pitch = 4.3 mm, rho=2.15), then the groove is cut, the same thread as in a hole drilled at the tap drill. Whole length, both ends free (6 turns): V = pi 7^2 4.2 - pi 2.15^2 4.2 - 6 x V_turn(clipped at rho) = 646.5398 - 60.9925 - 6 x 1.45465 = 576.8194 mm3. The thin lips a tap leaves at each end are below 0.2% of the volume. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 576.8194,+ "tolerance": {+ "rel": 0.01+ },+ "bbox": {+ "min": [+ -7,+ -7,+ 0+ ],+ "max": [+ 7,+ 7,+ 4.2+ ]+ },+ "center_of_mass": [+ 0,+ 0,+ 2.1+ ]+}diff --git a/tests/kernel-cases/threads/1443-m5x0.7-thread-in-5mm-hole/recipe.json b/tests/kernel-cases/threads/1443-m5x0.7-thread-in-5mm-hole/recipe.jsonnew file mode 100644index 0000000000..62b5047182--- /dev/null+++ b/tests/kernel-cases/threads/1443-m5x0.7-thread-in-5mm-hole/recipe.json@@ -0,0 +1,35 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 7,+ "height": 4.2,+ "body_name": "Nut"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 0,+ 0,+ 4.2+ ],+ "diameter": 5+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 2.5,+ 0,+ 2.1+ ],+ "designation": "M5x0.7",+ "modeled": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2038-cut-threaded-stud-from-bored-block/expected.json b/tests/kernel-cases/threads/2038-cut-threaded-stud-from-bored-block/expected.jsonnew file mode 100644index 0000000000..a460ae2a23--- /dev/null+++ b/tests/kernel-cases/threads/2038-cut-threaded-stud-from-bored-block/expected.json@@ -0,0 +1,26 @@+{+ "sources": [+ "tangency-labs/solidcraft#2038"+ ],+ "what": "cutting an externally threaded stud out of a block bored at the tap drill (to make the internal thread): the boolean found no result",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. Block 40x40x14 with a 19.2 mm bore (r=9.6). Stud R=10.5, 24 long (passing through, helix runs out of both ends), M21x1.8 over its whole length. Cutting the stud from the block removes block intersect stud = the ring 9.6<=r<=10.5 over the 14 mm slab minus the stud's groove there: pi (10.5^2 - 9.6^2) 14 - (14/1.8) x V_turn_ext(clipped to r>=9.6) = 795.6398 - 7.778 x 60.41976 = 325.7083. V = 22400 - pi 9.6^2 14 - 325.7083 = 18020.8832 mm3. One body remains (the stud is consumed). Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 18020.8832,+ "tolerance": {+ "rel": 0.003+ },+ "bbox": {+ "min": [+ -20,+ -20,+ 0+ ],+ "max": [+ 20,+ 20,+ 14+ ]+ }+}diff --git a/tests/kernel-cases/threads/2038-cut-threaded-stud-from-bored-block/recipe.json b/tests/kernel-cases/threads/2038-cut-threaded-stud-from-bored-block/recipe.jsonnew file mode 100644index 0000000000..929bff5422--- /dev/null+++ b/tests/kernel-cases/threads/2038-cut-threaded-stud-from-bored-block/recipe.json@@ -0,0 +1,65 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "corner": [+ -20,+ -20,+ 0+ ],+ "length": 40,+ "width": 40,+ "height": 14,+ "body_name": "Block"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 0,+ 0,+ 14+ ],+ "diameter": 19.2+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 10.5,+ "height": 24,+ "base": [+ 0,+ 0,+ -5+ ],+ "operation": "new",+ "body_name": "Stud"+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 10.5,+ 0,+ 10+ ],+ "designation": "M21x1.8",+ "modeled": true+ }+ },+ {+ "command": "solid.combine",+ "params": {+ "target": "Block",+ "tools": [+ "Stud"+ ],+ "operation": "cut"+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2038-internal-then-external-thread-on-one-body/expected.json b/tests/kernel-cases/threads/2038-internal-then-external-thread-on-one-body/expected.jsonnew file mode 100644index 0000000000..348d8afac4--- /dev/null+++ b/tests/kernel-cases/threads/2038-internal-then-external-thread-on-one-body/expected.json@@ -0,0 +1,26 @@+{+ "sources": [+ "tangency-labs/solidcraft#2038"+ ],+ "what": "two modelled threads on one body, an internal one then an external one (the second was refused: no cylindrical face there to thread)",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. Cylinder A R=16 h=12 with a 12.163 mm blind hole 10 deep from the bottom (rho=6.0815), M13.5x1.337 over 8 mm from the open mouth ending inside the wall: V_A = pi 16^2 12 - pi rho^2 10 - (8/1.337) x V_turn_int = 8400.9644. A boss R=13.05 h=14 joined on top, M26.1x1.814 over 10 mm from its free top end: V = V_A + pi 13.05^2 14 - (10/1.814) x 79.63016 = 15452.2840 mm3. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 15452.284,+ "tolerance": {+ "rel": 0.01+ },+ "bbox": {+ "min": [+ -16,+ -16,+ 0+ ],+ "max": [+ 16,+ 16,+ 26+ ]+ }+}diff --git a/tests/kernel-cases/threads/2038-internal-then-external-thread-on-one-body/recipe.json b/tests/kernel-cases/threads/2038-internal-then-external-thread-on-one-body/recipe.jsonnew file mode 100644index 0000000000..492ae5be66--- /dev/null+++ b/tests/kernel-cases/threads/2038-internal-then-external-thread-on-one-body/recipe.json@@ -0,0 +1,71 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 16,+ "height": 12,+ "body_name": "A"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 0,+ 0,+ 0+ ],+ "direction": [+ 0,+ 0,+ 1+ ],+ "diameter": 12.163,+ "depth": 10+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 6.0815,+ 0,+ 1+ ],+ "designation": "M13.5x1.337",+ "length": 8,+ "modeled": true+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 13.05,+ "height": 14,+ "base": [+ 0,+ 0,+ 12+ ],+ "operation": "join",+ "targets": [+ "A"+ ]+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 13.05,+ 0,+ 25+ ],+ "designation": "M26.1x1.814",+ "length": 10,+ "modeled": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2038-join-two-threaded-bodies/expected.json b/tests/kernel-cases/threads/2038-join-two-threaded-bodies/expected.jsonnew file mode 100644index 0000000000..f5d4e0525b--- /dev/null+++ b/tests/kernel-cases/threads/2038-join-two-threaded-bodies/expected.json@@ -0,0 +1,26 @@+{+ "sources": [+ "tangency-labs/solidcraft#2038"+ ],+ "what": "joining a body with an internal modelled thread to one with an external modelled thread, touching in a plane (the join ran for over ten minutes)",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. A as in the one-body case (V_A = 8400.9644). B: cylinder R=13.05 h=14 with M26.1x1.814 over its whole length, both ends free: V_B = pi 13.05^2 14 - (14/1.814) x 79.63016 = 6875.7294. They touch only in the plane z=12 (B's flat end on A's flat top), so the join is one solid with V = V_A + V_B = 15276.6938 mm3. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 15276.6938,+ "tolerance": {+ "rel": 0.01+ },+ "bbox": {+ "min": [+ -16,+ -16,+ 0+ ],+ "max": [+ 16,+ 16,+ 26+ ]+ }+}diff --git a/tests/kernel-cases/threads/2038-join-two-threaded-bodies/recipe.json b/tests/kernel-cases/threads/2038-join-two-threaded-bodies/recipe.jsonnew file mode 100644index 0000000000..39a51e9b35--- /dev/null+++ b/tests/kernel-cases/threads/2038-join-two-threaded-bodies/recipe.json@@ -0,0 +1,78 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 16,+ "height": 12,+ "body_name": "A"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 0,+ 0,+ 0+ ],+ "direction": [+ 0,+ 0,+ 1+ ],+ "diameter": 12.163,+ "depth": 10+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 6.0815,+ 0,+ 1+ ],+ "designation": "M13.5x1.337",+ "length": 8,+ "modeled": true+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 13.05,+ "height": 14,+ "base": [+ 0,+ 0,+ 12+ ],+ "operation": "new",+ "body_name": "B"+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 13.05,+ 0,+ 19+ ],+ "designation": "M26.1x1.814",+ "modeled": true+ }+ },+ {+ "command": "solid.combine",+ "params": {+ "target": "A",+ "tools": [+ "B"+ ],+ "operation": "join"+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2115-tapped-hole-drill-is-major-minus-pitch/expected.json b/tests/kernel-cases/threads/2115-tapped-hole-drill-is-major-minus-pitch/expected.jsonnew file mode 100644index 0000000000..7b78d5c93c--- /dev/null+++ b/tests/kernel-cases/threads/2115-tapped-hole-drill-is-major-minus-pitch/expected.json@@ -0,0 +1,28 @@+{+ "sources": [+ "tangency-labs/solidcraft#3311",+ "tangency-labs/solidcraft#2115",+ "tangency-labs/solidcraft#2367",+ "tangency-labs/solidcraft#2440",+ "tangency-labs/solidcraft#2441"+ ],+ "what": "tapped holes (Hole with a thread size, no diameter) are drilled at the tap drill, not at the major diameter",+ "source": "analytic",+ "method": "Tapped hole rule: the drill is the major diameter minus the pitch (M3 0.5 -> 2.5, M5 0.8 -> 4.2, M8 1.25 -> 6.75, M8.5x1 -> 7.5, M12 1.75 -> 10.25). Plate 100x40x12 with five holes in one row, each a cylinder pi r^2 h: M3: drill 2.5 x 12; M5: drill 4.2 x 12; M8: drill 6.75 x 12; M8.5x1: drill 7.5 x 12; M12: drill 10.25 x 8. V = 48000 - sum = 46155.1547 mm3. Faces: the plate's 6, one wall per through hole (four), a wall and a flat floor for the blind M12: 6 + 4 + 2 = 12.",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 46155.1547,+ "faces": 12,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 100,+ 40,+ 12+ ]+ }+}diff --git a/tests/kernel-cases/threads/2115-tapped-hole-drill-is-major-minus-pitch/recipe.json b/tests/kernel-cases/threads/2115-tapped-hole-drill-is-major-minus-pitch/recipe.jsonnew file mode 100644index 0000000000..71c2bc326b--- /dev/null+++ b/tests/kernel-cases/threads/2115-tapped-hole-drill-is-major-minus-pitch/recipe.json@@ -0,0 +1,74 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "corner": [+ 0,+ 0,+ 0+ ],+ "length": 100,+ "width": 40,+ "height": 12,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 10,+ 20,+ 12+ ],+ "thread": "M3"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 25,+ 20,+ 12+ ],+ "thread": "M5"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 45,+ 20,+ 12+ ],+ "thread": "M8"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 65,+ 20,+ 12+ ],+ "thread": "M8.5x1"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 88,+ 20,+ 12+ ],+ "thread": "M12",+ "depth": 8+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2152-m3x0.2-thread-in-3mm-hole/expected.json b/tests/kernel-cases/threads/2152-m3x0.2-thread-in-3mm-hole/expected.jsonnew file mode 100644index 0000000000..2664548f8f--- /dev/null+++ b/tests/kernel-cases/threads/2152-m3x0.2-thread-in-3mm-hole/expected.json@@ -0,0 +1,31 @@+{+ "sources": [+ "tangency-labs/solidcraft#2152"+ ],+ "what": "a modelled M3x0.2 thread in a 3 mm hole (the same refusal as a hole at the nominal size)",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. A 3 mm hole through a D10 x 2 disc, drawn at the thread's nominal size, takes a modelled M3x0.2: the hole is first filled to the tap drill (major - pitch = 2.8 mm, rho=1.4), then the groove is cut, the same thread as in a hole drilled at the tap drill. Whole length, both ends free (10 turns): V = pi 5^2 2 - pi 1.4^2 2 - 10 x V_turn(clipped at rho) = 157.0796 - 12.3150 - 10 x 0.07477 = 144.0169 mm3. The thin lips a tap leaves at each end are below 0.2% of the volume. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 144.0169,+ "tolerance": {+ "rel": 0.01+ },+ "bbox": {+ "min": [+ -5,+ -5,+ 0+ ],+ "max": [+ 5,+ 5,+ 2+ ]+ },+ "center_of_mass": [+ 0,+ 0,+ 1.0+ ]+}diff --git a/tests/kernel-cases/threads/2152-m3x0.2-thread-in-3mm-hole/recipe.json b/tests/kernel-cases/threads/2152-m3x0.2-thread-in-3mm-hole/recipe.jsonnew file mode 100644index 0000000000..498616351e--- /dev/null+++ b/tests/kernel-cases/threads/2152-m3x0.2-thread-in-3mm-hole/recipe.json@@ -0,0 +1,35 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 5,+ "height": 2,+ "body_name": "Nut"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 0,+ 0,+ 2+ ],+ "diameter": 3+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 1.5,+ 0,+ 1.0+ ],+ "designation": "M3x0.2",+ "modeled": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2193-modelled-m33x3.5-thread/expected.json b/tests/kernel-cases/threads/2193-modelled-m33x3.5-thread/expected.jsonnew file mode 100644index 0000000000..63ef76df8b--- /dev/null+++ b/tests/kernel-cases/threads/2193-modelled-m33x3.5-thread/expected.json@@ -0,0 +1,33 @@+{+ "sources": [+ "tangency-labs/solidcraft#2193",+ "tangency-labs/solidcraft#2263",+ "tangency-labs/solidcraft#4153"+ ],+ "what": "a modelled M33x3.5 thread, a size the thread menu lacked (designation typed by hand), on a 33 mm shaft (4 turns)",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. Shaft R=16.5 L=14, M33x3.5 (P=3.5) over its whole length, both ends free: V = pi R^2 L - (L/P) V_turn = 11974.1804 - 4 x 368.57682 = 10499.8731 mm3. COM on the axis at L/2 (7): the groove is symmetric over whole turns. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 10499.8731,+ "center_of_mass": [+ 0,+ 0,+ 7.0+ ],+ "bbox": {+ "min": [+ -16.5,+ -16.5,+ 0+ ],+ "max": [+ 16.5,+ 16.5,+ 14+ ]+ },+ "tolerance": {+ "rel": 0.01+ }+}diff --git a/tests/kernel-cases/threads/2193-modelled-m33x3.5-thread/recipe.json b/tests/kernel-cases/threads/2193-modelled-m33x3.5-thread/recipe.jsonnew file mode 100644index 0000000000..d06d644342--- /dev/null+++ b/tests/kernel-cases/threads/2193-modelled-m33x3.5-thread/recipe.json@@ -0,0 +1,24 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 16.5,+ "height": 14,+ "body_name": "Shaft"+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 16.5,+ 0,+ 7.0+ ],+ "designation": "M33x3.5",+ "modeled": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2209-fine-m44x1-thread-on-shaft/expected.json b/tests/kernel-cases/threads/2209-fine-m44x1-thread-on-shaft/expected.jsonnew file mode 100644index 0000000000..248347d4a9--- /dev/null+++ b/tests/kernel-cases/threads/2209-fine-m44x1-thread-on-shaft/expected.json@@ -0,0 +1,31 @@+{+ "sources": [+ "tangency-labs/solidcraft#2209"+ ],+ "what": "a fine modelled thread on a large shaft (M44x1 on a 44 mm shaft, 4 turns), which once cut about 9% too much",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. Shaft R=22.0 L=4, M44x1 (P=1.0) over its whole length, both ends free: V = pi R^2 L - (L/P) V_turn = 6082.1234 - 4 x 41.66397 = 5915.4675 mm3. COM on the axis at L/2 (2): the groove is symmetric over whole turns. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 5915.4675,+ "center_of_mass": [+ 0,+ 0,+ 2.0+ ],+ "bbox": {+ "min": [+ -22.0,+ -22.0,+ 0+ ],+ "max": [+ 22.0,+ 22.0,+ 4+ ]+ },+ "tolerance": {+ "rel": 0.01+ }+}diff --git a/tests/kernel-cases/threads/2209-fine-m44x1-thread-on-shaft/recipe.json b/tests/kernel-cases/threads/2209-fine-m44x1-thread-on-shaft/recipe.jsonnew file mode 100644index 0000000000..f0ee29b27d--- /dev/null+++ b/tests/kernel-cases/threads/2209-fine-m44x1-thread-on-shaft/recipe.json@@ -0,0 +1,24 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 22.0,+ "height": 4,+ "body_name": "Shaft"+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 22.0,+ 0,+ 2.0+ ],+ "designation": "M44x1",+ "modeled": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2209-m44x1.5-thread-on-flange-hub/expected.json b/tests/kernel-cases/threads/2209-m44x1.5-thread-on-flange-hub/expected.jsonnew file mode 100644index 0000000000..b14440cc94--- /dev/null+++ b/tests/kernel-cases/threads/2209-m44x1.5-thread-on-flange-hub/expected.json@@ -0,0 +1,26 @@+{+ "sources": [+ "tangency-labs/solidcraft#2209"+ ],+ "what": "a full-diameter M44x1.5 modelled thread on the hub of a flange, which once failed to rebuild a closed shell",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. Flange R=40 h=8 plus a hub R=22 h=10, M44x1.5 over 6 mm from the free top end, ending inside the hub (4 turns, no end effect): V = pi 40^2 8 + pi 22^2 10 - 4 x V_turn = 40212.3860 + 15205.3084 - 4 x 93.26935 = 55044.6170 mm3. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 55044.617,+ "tolerance": {+ "rel": 0.01+ },+ "bbox": {+ "min": [+ -40,+ -40,+ 0+ ],+ "max": [+ 40,+ 40,+ 18+ ]+ }+}diff --git a/tests/kernel-cases/threads/2209-m44x1.5-thread-on-flange-hub/recipe.json b/tests/kernel-cases/threads/2209-m44x1.5-thread-on-flange-hub/recipe.jsonnew file mode 100644index 0000000000..03a8e1e99c--- /dev/null+++ b/tests/kernel-cases/threads/2209-m44x1.5-thread-on-flange-hub/recipe.json@@ -0,0 +1,41 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 40,+ "height": 8,+ "body_name": "Flange"+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 22.0,+ "height": 10,+ "base": [+ 0,+ 0,+ 8+ ],+ "operation": "join",+ "targets": [+ "Flange"+ ]+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 22.0,+ 0,+ 16+ ],+ "designation": "M44x1.5",+ "length": 6,+ "modeled": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/threads/2369-m8-thread-in-6.3mm-hole-bored-to-minor/expected.json b/tests/kernel-cases/threads/2369-m8-thread-in-6.3mm-hole-bored-to-minor/expected.jsonnew file mode 100644index 0000000000..c5d33d5628--- /dev/null+++ b/tests/kernel-cases/threads/2369-m8-thread-in-6.3mm-hole-bored-to-minor/expected.json@@ -0,0 +1,33 @@+{+ "sources": [+ "tangency-labs/solidcraft#2369",+ "tangency-labs/solidcraft#2688",+ "tangency-labs/solidcraft#2853"+ ],+ "what": "a modelled M8 thread in a hole narrower than the thread's minor diameter (6.3 mm, and 6 mm in #2688), refused as 'the face is too far from the thread's diameter'",+ "source": "analytic",+ "method": "ISO 68-1 basic profile: H = P sqrt3/2, basic depth 5H/8. External groove (the space between teeth): a trapezoid P/4 wide at the root radius d/2 - 5H/8, widening by 2 tan30 per unit of radius to 7P/8 at d/2. Internal groove: P/8 wide at the major radius d/2, widening to 3P/4 at the minor radius, cut only where there is material (r >= hole radius). Pappus: volume per turn = 2 pi A rc (A the trapezoid area, rc its centroid radius from the axis); a helical sweep of L/P turns removes exactly (L/P) x that, where each end of the thread is a free end or lies inside material. A 6.3 mm hole through a D16 x 5 disc takes a modelled M8 (P=1.25). The hole is narrower than the thread's minor diameter 8 - 2 x 5H/8 = 6.6468 mm (ISO D1 = D - 1.0825 P), so a tap takes the extra material off first: the hole is bored out to the minor diameter (rho=3.3234) and the groove cut from there. Whole length (4 turns): V = pi 8^2 5 - pi rho^2 5 - 4 x V_turn(clipped at rho) = 1005.3096 - 173.4961 - 4 x 8.32555 = 798.5114 mm3. Tolerance 1%: a modelled thread is a faceted helical solid (radial chord error up to 1% of the pitch on every wall, i.e. a volume deficit of about 4/3 x sag/R).",+ "outcome": "solid",+ "body_count": 1,+ "volume_mm3": 798.5114,+ "center_of_mass": [+ 0,+ 0,+ 2.5+ ],+ "tolerance": {+ "rel": 0.01+ },+ "bbox": {+ "min": [+ -8,+ -8,+ 0+ ],+ "max": [+ 8,+ 8,+ 5+ ]+ }+}diff --git a/tests/kernel-cases/threads/2369-m8-thread-in-6.3mm-hole-bored-to-minor/recipe.json b/tests/kernel-cases/threads/2369-m8-thread-in-6.3mm-hole-bored-to-minor/recipe.jsonnew file mode 100644index 0000000000..7b1eaebf5f--- /dev/null+++ b/tests/kernel-cases/threads/2369-m8-thread-in-6.3mm-hole-bored-to-minor/recipe.json@@ -0,0 +1,35 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 8,+ "height": 5,+ "body_name": "Nut"+ }+ },+ {+ "command": "solid.hole",+ "params": {+ "position": [+ 0,+ 0,+ 5+ ],+ "diameter": 6.3+ }+ },+ {+ "command": "solid.thread",+ "params": {+ "face": [+ 3.15,+ 0,+ 2.5+ ],+ "designation": "M8",+ "modeled": true+ }+ }+ ]+}