mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-05 11:35:55 +00:00
242d8d9a7d
3 commits, squashed; the originals stay reachable from tag archive/merge-main-develop. -191b2f4c4jyviko: kernel-ladder: cases.py makes every committed case again -977230b7cjyviko: kernel-ladder: tier 04 cases grade their geometry -84473f61fjyviko: kernel-ladder: tier 06 grades the threaded boss; both hands and Tr40x14(P7) added Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
86 lines
16 KiB
Python
86 lines
16 KiB
Python
"""Reported recipes the ladder keeps verbatim: the reporters' own scripts, whose numbers (rounded
|
|
outline points, a modeller's sketch coordinates) are the case and have no generator here. cases.py
|
|
writes them unchanged. Plain Python 3, standard library only."""
|
|
import json
|
|
|
|
# tangency-labs/solidcraft#4623: pleated_union.py (24 pleats), two pleated skins (a loft between
|
|
# star outlines less the same loft moved in 1.1 mm) joined where they cross.
|
|
PLEATED_SKINS = json.loads(r"""[
|
|
{"command": "sketch.create", "params": {"plane": "XY", "offset": "-1", "name": "ConeLo"}},
|
|
{"command": "sketch.line", "params": {"points": [[115.7949, 0.0], [112.5082, 14.812], [111.8493, 29.9699], [104.8409, 43.4265], [100.2813, 57.8974], [90.0289, 69.0816], [81.8793, 81.8793], [69.0816, 90.0289], [57.8974, 100.2813], [43.4265, 104.8409], [29.9699, 111.8493], [14.812, 112.5082], [0.0, 115.7949], [-14.812, 112.5082], [-29.9699, 111.8493], [-43.4265, 104.8409], [-57.8974, 100.2813], [-69.0816, 90.0289], [-81.8793, 81.8793], [-90.0289, 69.0816], [-100.2813, 57.8974], [-104.8409, 43.4265], [-111.8493, 29.9699], [-112.5082, 14.812], [-115.7949, 0.0], [-112.5082, -14.812], [-111.8493, -29.9699], [-104.8409, -43.4265], [-100.2813, -57.8974], [-90.0289, -69.0816], [-81.8793, -81.8793], [-69.0816, -90.0289], [-57.8974, -100.2813], [-43.4265, -104.8409], [-29.9699, -111.8493], [-14.812, -112.5082], [-0.0, -115.7949], [14.812, -112.5082], [29.9699, -111.8493], [43.4265, -104.8409], [57.8974, -100.2813], [69.0816, -90.0289], [81.8793, -81.8793], [90.0289, -69.0816], [100.2813, -57.8974], [104.8409, -43.4265], [111.8493, -29.9699], [112.5082, -14.812]], "closed": true, "infer": false}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "sketch.create", "params": {"plane": "XY", "offset": "88.3", "name": "ConeHi"}},
|
|
{"command": "sketch.line", "params": {"points": [[14.39, 0.0], [13.9816, 1.8407], [13.8997, 3.7244], [13.0287, 5.3967], [12.4621, 7.195], [11.188, 8.5849], [10.1753, 10.1753], [8.5849, 11.188], [7.195, 12.4621], [5.3967, 13.0287], [3.7244, 13.8997], [1.8407, 13.9816], [0.0, 14.39], [-1.8407, 13.9816], [-3.7244, 13.8997], [-5.3967, 13.0287], [-7.195, 12.4621], [-8.5849, 11.188], [-10.1753, 10.1753], [-11.188, 8.5849], [-12.4621, 7.195], [-13.0287, 5.3967], [-13.8997, 3.7244], [-13.9816, 1.8407], [-14.39, 0.0], [-13.9816, -1.8407], [-13.8997, -3.7244], [-13.0287, -5.3967], [-12.4621, -7.195], [-11.188, -8.5849], [-10.1753, -10.1753], [-8.5849, -11.188], [-7.195, -12.4621], [-5.3967, -13.0287], [-3.7244, -13.8997], [-1.8407, -13.9816], [-0.0, -14.39], [1.8407, -13.9816], [3.7244, -13.8997], [5.3967, -13.0287], [7.195, -12.4621], [8.5849, -11.188], [10.1753, -10.1753], [11.188, -8.5849], [12.4621, -7.195], [13.0287, -5.3967], [13.8997, -3.7244], [13.9816, -1.8407]], "closed": true, "infer": false}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.loft", "params": {"sections": [{"sketch": "ConeLo"}, {"sketch": "ConeHi"}], "operation": "new", "body_name": "Cone", "name": "Cone"}},
|
|
{"command": "sketch.create", "params": {"plane": "XY", "offset": "-2", "name": "ConeInLo"}},
|
|
{"command": "sketch.line", "params": {"points": [[115.8304, 0.0], [112.5209, 14.8137], [111.8836, 29.9791], [104.8528, 43.4314], [100.3121, 57.9152], [90.0391, 69.0894], [81.9045, 81.9045], [69.0894, 90.0391], [57.9152, 100.3121], [43.4314, 104.8528], [29.9791, 111.8836], [14.8137, 112.5209], [0.0, 115.8304], [-14.8137, 112.5209], [-29.9791, 111.8836], [-43.4314, 104.8528], [-57.9152, 100.3121], [-69.0894, 90.0391], [-81.9045, 81.9045], [-90.0391, 69.0894], [-100.3121, 57.9152], [-104.8528, 43.4314], [-111.8836, 29.9791], [-112.5209, 14.8137], [-115.8304, 0.0], [-112.5209, -14.8137], [-111.8836, -29.9791], [-104.8528, -43.4314], [-100.3121, -57.9152], [-90.0391, -69.0894], [-81.9045, -81.9045], [-69.0894, -90.0391], [-57.9152, -100.3121], [-43.4314, -104.8528], [-29.9791, -111.8836], [-14.8137, -112.5209], [-0.0, -115.8304], [14.8137, -112.5209], [29.9791, -111.8836], [43.4314, -104.8528], [57.9152, -100.3121], [69.0894, -90.0391], [81.9045, -81.9045], [90.0391, -69.0894], [100.3121, -57.9152], [104.8528, -43.4314], [111.8836, -29.9791], [112.5209, -14.8137]], "closed": true, "infer": false}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "sketch.create", "params": {"plane": "XY", "offset": "89.3", "name": "ConeInHi"}},
|
|
{"command": "sketch.line", "params": {"points": [[12.1544, 0.0], [11.7876, 1.5519], [11.7403, 3.1458], [10.9843, 4.5499], [10.5261, 6.0772], [9.4325, 7.2378], [8.5945, 8.5945], [7.2378, 9.4325], [6.0772, 10.5261], [4.5499, 10.9843], [3.1458, 11.7403], [1.5519, 11.7876], [0.0, 12.1544], [-1.5519, 11.7876], [-3.1458, 11.7403], [-4.5499, 10.9843], [-6.0772, 10.5261], [-7.2378, 9.4325], [-8.5945, 8.5945], [-9.4325, 7.2378], [-10.5261, 6.0772], [-10.9843, 4.5499], [-11.7403, 3.1458], [-11.7876, 1.5519], [-12.1544, 0.0], [-11.7876, -1.5519], [-11.7403, -3.1458], [-10.9843, -4.5499], [-10.5261, -6.0772], [-9.4325, -7.2378], [-8.5945, -8.5945], [-7.2378, -9.4325], [-6.0772, -10.5261], [-4.5499, -10.9843], [-3.1458, -11.7403], [-1.5519, -11.7876], [-0.0, -12.1544], [1.5519, -11.7876], [3.1458, -11.7403], [4.5499, -10.9843], [6.0772, -10.5261], [7.2378, -9.4325], [8.5945, -8.5945], [9.4325, -7.2378], [10.5261, -6.0772], [10.9843, -4.5499], [11.7403, -3.1458], [11.7876, -1.5519]], "closed": true, "infer": false}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.loft", "params": {"sections": [{"sketch": "ConeInLo"}, {"sketch": "ConeInHi"}], "operation": "new", "body_name": "ConeIn", "name": "ConeIn"}},
|
|
{"command": "solid.combine", "params": {"target": "Cone", "tools": ["ConeIn"], "operation": "cut"}},
|
|
{"command": "sketch.create", "params": {"plane": "XY", "offset": "-1", "name": "LipLo"}},
|
|
{"command": "sketch.line", "params": {"points": [[114.4444, 0.0], [111.196, 14.6392], [110.5448, 29.6204], [103.6182, 42.9201], [99.1118, 57.2222], [88.979, 68.276], [80.9244, 80.9244], [68.276, 88.979], [57.2222, 99.1118], [42.9201, 103.6182], [29.6204, 110.5448], [14.6392, 111.196], [0.0, 114.4444], [-14.6392, 111.196], [-29.6204, 110.5448], [-42.9201, 103.6182], [-57.2222, 99.1118], [-68.276, 88.979], [-80.9244, 80.9244], [-88.979, 68.276], [-99.1118, 57.2222], [-103.6182, 42.9201], [-110.5448, 29.6204], [-111.196, 14.6392], [-114.4444, 0.0], [-111.196, -14.6392], [-110.5448, -29.6204], [-103.6182, -42.9201], [-99.1118, -57.2222], [-88.979, -68.276], [-80.9244, -80.9244], [-68.276, -88.979], [-57.2222, -99.1118], [-42.9201, -103.6182], [-29.6204, -110.5448], [-14.6392, -111.196], [-0.0, -114.4444], [14.6392, -111.196], [29.6204, -110.5448], [42.9201, -103.6182], [57.2222, -99.1118], [68.276, -88.979], [80.9244, -80.9244], [88.979, -68.276], [99.1118, -57.2222], [103.6182, -42.9201], [110.5448, -29.6204], [111.196, -14.6392]], "closed": true, "infer": false}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "sketch.create", "params": {"plane": "XY", "offset": "6", "name": "LipHi"}},
|
|
{"command": "sketch.line", "params": {"points": [[120.0, 0.0], [116.5939, 15.3499], [115.9111, 31.0583], [108.6482, 45.0036], [103.923, 60.0], [93.2984, 71.5903], [84.8528, 84.8528], [71.5903, 93.2984], [60.0, 103.923], [45.0036, 108.6482], [31.0583, 115.9111], [15.3499, 116.5939], [0.0, 120.0], [-15.3499, 116.5939], [-31.0583, 115.9111], [-45.0036, 108.6482], [-60.0, 103.923], [-71.5903, 93.2984], [-84.8528, 84.8528], [-93.2984, 71.5903], [-103.923, 60.0], [-108.6482, 45.0036], [-115.9111, 31.0583], [-116.5939, 15.3499], [-120.0, 0.0], [-116.5939, -15.3499], [-115.9111, -31.0583], [-108.6482, -45.0036], [-103.923, -60.0], [-93.2984, -71.5903], [-84.8528, -84.8528], [-71.5903, -93.2984], [-60.0, -103.923], [-45.0036, -108.6482], [-31.0583, -115.9111], [-15.3499, -116.5939], [-0.0, -120.0], [15.3499, -116.5939], [31.0583, -115.9111], [45.0036, -108.6482], [60.0, -103.923], [71.5903, -93.2984], [84.8528, -84.8528], [93.2984, -71.5903], [103.923, -60.0], [108.6482, -45.0036], [115.9111, -31.0583], [116.5939, -15.3499]], "closed": true, "infer": false}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.loft", "params": {"sections": [{"sketch": "LipLo"}, {"sketch": "LipHi"}], "operation": "new", "body_name": "Lip", "name": "Lip"}},
|
|
{"command": "sketch.create", "params": {"plane": "XY", "offset": "-2", "name": "LipInLo"}},
|
|
{"command": "sketch.line", "params": {"points": [[112.5508, 0.0], [109.3343, 14.3941], [108.7157, 29.1303], [101.8834, 42.2015], [97.4718, 56.2754], [87.4892, 67.1329], [79.5854, 79.5854], [67.1329, 87.4892], [56.2754, 97.4718], [42.2015, 101.8834], [29.1303, 108.7157], [14.3941, 109.3343], [0.0, 112.5508], [-14.3941, 109.3343], [-29.1303, 108.7157], [-42.2015, 101.8834], [-56.2754, 97.4718], [-67.1329, 87.4892], [-79.5854, 79.5854], [-87.4892, 67.1329], [-97.4718, 56.2754], [-101.8834, 42.2015], [-108.7157, 29.1303], [-109.3343, 14.3941], [-112.5508, 0.0], [-109.3343, -14.3941], [-108.7157, -29.1303], [-101.8834, -42.2015], [-97.4718, -56.2754], [-87.4892, -67.1329], [-79.5854, -79.5854], [-67.1329, -87.4892], [-56.2754, -97.4718], [-42.2015, -101.8834], [-29.1303, -108.7157], [-14.3941, -109.3343], [-0.0, -112.5508], [14.3941, -109.3343], [29.1303, -108.7157], [42.2015, -101.8834], [56.2754, -97.4718], [67.1329, -87.4892], [79.5854, -79.5854], [87.4892, -67.1329], [97.4718, -56.2754], [101.8834, -42.2015], [108.7157, -29.1303], [109.3343, -14.3941]], "closed": true, "infer": false}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "sketch.create", "params": {"plane": "XY", "offset": "7", "name": "LipInHi"}},
|
|
{"command": "sketch.line", "params": {"points": [[119.6937, 0.0], [116.2745, 15.3078], [115.6152, 30.979], [108.3505, 44.8803], [103.6577, 59.8468], [93.0427, 71.3942], [84.6362, 84.6362], [71.3942, 93.0427], [59.8468, 103.6577], [44.8803, 108.3505], [30.979, 115.6152], [15.3078, 116.2745], [0.0, 119.6937], [-15.3078, 116.2745], [-30.979, 115.6152], [-44.8803, 108.3505], [-59.8468, 103.6577], [-71.3942, 93.0427], [-84.6362, 84.6362], [-93.0427, 71.3942], [-103.6577, 59.8468], [-108.3505, 44.8803], [-115.6152, 30.979], [-116.2745, 15.3078], [-119.6937, 0.0], [-116.2745, -15.3078], [-115.6152, -30.979], [-108.3505, -44.8803], [-103.6577, -59.8468], [-93.0427, -71.3942], [-84.6362, -84.6362], [-71.3942, -93.0427], [-59.8468, -103.6577], [-44.8803, -108.3505], [-30.979, -115.6152], [-15.3078, -116.2745], [-0.0, -119.6937], [15.3078, -116.2745], [30.979, -115.6152], [44.8803, -108.3505], [59.8468, -103.6577], [71.3942, -93.0427], [84.6362, -84.6362], [93.0427, -71.3942], [103.6577, -59.8468], [108.3505, -44.8803], [115.6152, -30.979], [116.2745, -15.3078]], "closed": true, "infer": false}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.loft", "params": {"sections": [{"sketch": "LipInLo"}, {"sketch": "LipInHi"}], "operation": "new", "body_name": "LipIn", "name": "LipIn"}},
|
|
{"command": "solid.combine", "params": {"target": "Lip", "tools": ["LipIn"], "operation": "cut"}},
|
|
{"command": "solid.combine", "params": {"target": "Cone", "tools": ["Lip"], "operation": "join"}}
|
|
]""")
|
|
|
|
# tangency-labs/solidcraft#4092, reduced: a cap's neck, oval transition loft and chamber, a handle
|
|
# ring, two ribs and a rounded pad joined onto them (without the report's top flange).
|
|
LOFT_RIBS_PAD = json.loads(r"""[
|
|
{"command": "file.new", "params": {"name": "Native_loft_pad_union_repro"}},
|
|
{"command": "document.units", "params": {"units": "mm"}},
|
|
{"command": "solid.cylinder", "params": {"diameter": "36 mm", "height": "21 mm", "base": [0, 0, 0], "operation": "new", "name": "01_Neck_outer_D36_H21", "body_name": "NATIVE_CAP_BODY"}},
|
|
{"command": "sketch.create", "params": {"name": "02_Outer_transition_round", "plane": "XY", "offset": "21 mm"}},
|
|
{"command": "sketch.circle.center", "params": {"center": [0, 0], "diameter": 36}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "sketch.create", "params": {"name": "03_Outer_transition_ellipse", "plane": "XY", "offset": "38 mm"}},
|
|
{"command": "sketch.ellipse", "params": {"center": [0, 0], "major": [30.0, 0], "minor_radius": 20.0}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.loft", "params": {"sections": [{"sketch": "02_Outer_transition_round"}, {"sketch": "03_Outer_transition_ellipse"}], "operation": "join", "targets": ["NATIVE_CAP_BODY"], "name": "04_Outer_round_to_oval_transition"}},
|
|
{"command": "sketch.create", "params": {"name": "05_Upper_chamber_60x40", "plane": "XY", "offset": "38 mm"}},
|
|
{"command": "sketch.ellipse", "params": {"center": [0, 0], "major": [30.0, 0], "minor_radius": 20.0}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.extrude", "params": {"sketch": "05_Upper_chamber_60x40", "distance": 26, "operation": "join", "targets": ["NATIVE_CAP_BODY"], "name": "06_Upper_chamber_blank"}},
|
|
{"command": "sketch.create", "params": {"name": "Handle_outer_D24", "plane": {"origin": [-5, 0, 0], "x_dir": [0, 1, 0], "y_dir": [0, 0, 1]}}},
|
|
{"command": "sketch.circle.center", "params": {"center": [30, 47], "diameter": 24}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.extrude", "params": {"sketch": "Handle_outer_D24", "distance": 10, "operation": "join", "targets": ["NATIVE_CAP_BODY"], "name": "Handle_outer_D24_thickness10"}},
|
|
{"command": "sketch.create", "params": {"name": "Handle_lower_rib_X-8", "plane": {"origin": [-8, 0, 0], "x_dir": [0, 1, 0], "y_dir": [0, 0, 1]}}},
|
|
{"command": "sketch.arc.three_point", "params": {"start": [18.0, 37.5], "end": [19.5, 36.0], "through": [18.439339828220177, 36.43933982822018]}},
|
|
{"command": "sketch.line", "params": {"points": [[19.5, 36.0], [24.4516191451179, 36.0]]}},
|
|
{"command": "sketch.arc.three_point", "params": {"start": [24.4516191451179, 36.0], "end": [25.20742568340403, 38.79566835134765], "through": [25.89963546529897, 37.10853003117829]}},
|
|
{"command": "sketch.line", "params": {"points": [[25.20742568340403, 38.79566835134765], [20.25580653828613, 41.68411285266642]]}},
|
|
{"command": "sketch.arc.three_point", "params": {"start": [20.25580653828613, 41.68411285266642], "end": [18.0, 40.38844450131877], "through": [18.75290891031588, 41.68915773017231]}},
|
|
{"command": "sketch.line", "params": {"points": [[18.0, 40.38844450131877], [18.0, 37.5]]}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.extrude", "params": {"sketch": "Handle_lower_rib_X-8", "distance": 4, "operation": "join", "targets": ["NATIVE_CAP_BODY"], "name": "Handle_lower_rib_X-8_R1p5_thickness4"}},
|
|
{"command": "sketch.create", "params": {"name": "Handle_lower_rib_X4", "plane": {"origin": [4, 0, 0], "x_dir": [0, 1, 0], "y_dir": [0, 0, 1]}}},
|
|
{"command": "sketch.arc.three_point", "params": {"start": [18.0, 37.5], "end": [19.5, 36.0], "through": [18.439339828220177, 36.43933982822018]}},
|
|
{"command": "sketch.line", "params": {"points": [[19.5, 36.0], [24.4516191451179, 36.0]]}},
|
|
{"command": "sketch.arc.three_point", "params": {"start": [24.4516191451179, 36.0], "end": [25.20742568340403, 38.79566835134765], "through": [25.89963546529897, 37.10853003117829]}},
|
|
{"command": "sketch.line", "params": {"points": [[25.20742568340403, 38.79566835134765], [20.25580653828613, 41.68411285266642]]}},
|
|
{"command": "sketch.arc.three_point", "params": {"start": [20.25580653828613, 41.68411285266642], "end": [18.0, 40.38844450131877], "through": [18.75290891031588, 41.68915773017231]}},
|
|
{"command": "sketch.line", "params": {"points": [[18.0, 40.38844450131877], [18.0, 37.5]]}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.extrude", "params": {"sketch": "Handle_lower_rib_X4", "distance": 4, "operation": "join", "targets": ["NATIVE_CAP_BODY"], "name": "Handle_lower_rib_X4_R1p5_thickness4"}},
|
|
{"command": "sketch.create", "params": {"name": "Handle_root_pad_R3", "plane": {"origin": [0, 18, 0], "x_dir": [1, 0, 0], "y_dir": [0, 0, 1]}}},
|
|
{"command": "sketch.rectangle.rounded", "params": {"p0": [-8, 36], "p1": [8, 59], "radius": 3}},
|
|
{"command": "sketch.finish", "params": {}},
|
|
{"command": "solid.extrude", "params": {"sketch": "Handle_root_pad_R3", "distance": 7, "direction": "negative", "operation": "join", "targets": ["NATIVE_CAP_BODY"], "name": "Native_root_pad_R3"}}
|
|
]""")
|