Kwargs: startProfileAt (#6424)
Previous: ``` startProfileAt([x, y], %) startProfileAt([x, y], sketch001) ``` New: ``` startProfile(%, at = [x, y]) startProfile(sketch001, at = [x, y]) ```
This commit is contained in:
@ -40,7 +40,7 @@ async fn kcl_test_fillet_duplicate_tags() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute_engine_error_return() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([5.5229, 5.25217], %)
|
||||
|> startProfile(at = [5.5229, 5.25217])
|
||||
|> line(end = [10.50433, -1.19122])
|
||||
|> line(end = [8.01362, -5.48731])
|
||||
|> line(end = [-1.02877, -6.76825])
|
||||
@ -157,7 +157,7 @@ async fn kcl_test_negative_args() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_basic_tangential_arc_with_point() {
|
||||
let code = r#"boxSketch = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> tangentialArc(end = [-5, 5])
|
||||
|> line(end = [5, -15])
|
||||
@ -171,7 +171,7 @@ async fn kcl_test_basic_tangential_arc_with_point() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_basic_tangential_arc_to() {
|
||||
let code = r#"boxSketch = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> tangentialArc(endAbsolute = [-5, 15])
|
||||
|> line(end = [5, -15])
|
||||
@ -190,7 +190,7 @@ length = 12
|
||||
|
||||
fn box = (sk1, sk2, scale, plane) => {
|
||||
boxsketch = startSketchOn(plane)
|
||||
|> startProfileAt([sk1, sk2], %)
|
||||
|> startProfile(at = [sk1, sk2])
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -222,7 +222,7 @@ shelfMountL = 9
|
||||
wallMountL = 8
|
||||
|
||||
bracket = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, wallMountL])
|
||||
|> tangentialArc(radius = filletR, angle = 90 )
|
||||
|> line(end = [-shelfMountL, 0])
|
||||
@ -237,7 +237,7 @@ bracket = startSketchOn(XY)
|
||||
|> extrude(length = width)
|
||||
|
||||
part001 = startSketchOn(XY)
|
||||
|> startProfileAt([-15.53, -10.28], %)
|
||||
|> startProfile(at = [-15.53, -10.28])
|
||||
|> line(end = [10.49, -2.08])
|
||||
|> line(end = [10.42, 8.47])
|
||||
|> line(end = [-19.16, 5.1])
|
||||
@ -245,19 +245,19 @@ part001 = startSketchOn(XY)
|
||||
|> extrude(length = 4)
|
||||
|
||||
part002 = startSketchOn('-XZ')
|
||||
|> startProfileAt([-9.35, 19.18], %)
|
||||
|> startProfile(at = [-9.35, 19.18])
|
||||
|> line(end = [32.14, -2.47])
|
||||
|> line(end = [8.39, -3.73])
|
||||
|> close()
|
||||
|
||||
part003 = startSketchOn('-XZ')
|
||||
|> startProfileAt([13.82, 16.51], %)
|
||||
|> startProfile(at = [13.82, 16.51])
|
||||
|> line(end = [-6.24, -30.82])
|
||||
|> line(end = [8.39, -3.73])
|
||||
|> close()
|
||||
|
||||
part004 = startSketchOn(YZ)
|
||||
|> startProfileAt([19.04, 20.22], %)
|
||||
|> startProfile(at = [19.04, 20.22])
|
||||
|> line(end = [9.44, -30.16])
|
||||
|> line(end = [8.39, -3.73])
|
||||
|> close()
|
||||
@ -270,7 +270,7 @@ part004 = startSketchOn(YZ)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_holes() {
|
||||
let code = r#"square = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10])
|
||||
@ -289,7 +289,7 @@ async fn optional_params() {
|
||||
let code = r#"
|
||||
fn other_circle = (pos, radius, tag?) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> arc(angleEnd = 360, angleStart = 0, radius = radius)
|
||||
|> close()
|
||||
|> extrude(length = 2)
|
||||
@ -311,7 +311,7 @@ async fn kcl_test_rounded_with_holes() {
|
||||
|
||||
fn roundedRectangle = (pos, w, l, cornerRadius) => {
|
||||
rr = startSketchOn(XY)
|
||||
|> startProfileAt([pos[0] - w/2, 0], %)
|
||||
|> startProfile(at = [pos[0] - w/2, 0])
|
||||
|> line(endAbsolute = [pos[0] - w/2, pos[1] - l/2 + cornerRadius])
|
||||
|> tarc([pos[0] - w/2 + cornerRadius, pos[1] - l/2], %, $arc0)
|
||||
|> line(endAbsolute = [pos[0] + w/2 - cornerRadius, pos[1] - l/2])
|
||||
@ -376,7 +376,7 @@ async fn kcl_test_patterns_linear_basic() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_patterns_linear_basic_3d() {
|
||||
let code = r#"part = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0,1])
|
||||
|> line(end = [1, 0])
|
||||
|> line(end = [0, -1])
|
||||
@ -420,7 +420,7 @@ async fn kcl_test_patterns_linear_basic_holes() {
|
||||
|> patternLinear2d(axis = [1,1], instances = 13, distance = 3)
|
||||
|
||||
rectangle = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 50])
|
||||
|> line(end = [50, 0])
|
||||
|> line(end = [0, -50])
|
||||
@ -449,7 +449,7 @@ async fn kcl_test_patterns_circular_basic_2d() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_patterns_circular_basic_3d() {
|
||||
let code = r#"part = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0,1])
|
||||
|> line(end = [1, 0])
|
||||
|> line(end = [0, -1])
|
||||
@ -465,7 +465,7 @@ async fn kcl_test_patterns_circular_basic_3d() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_patterns_circular_3d_tilted_axis() {
|
||||
let code = r#"part = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0,1])
|
||||
|> line(end = [1, 0])
|
||||
|> line(end = [0, -1])
|
||||
@ -573,7 +573,7 @@ model = cube"#;
|
||||
async fn kcl_test_cube_mm() {
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -595,7 +595,7 @@ async fn kcl_test_cube_cm() {
|
||||
let code = r#"@settings(defaultLengthUnit = cm)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -617,7 +617,7 @@ async fn kcl_test_cube_m() {
|
||||
let code = r#"@settings(defaultLengthUnit = m)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -639,7 +639,7 @@ async fn kcl_test_cube_in() {
|
||||
let code = r#"@settings(defaultLengthUnit = in)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -661,7 +661,7 @@ async fn kcl_test_cube_ft() {
|
||||
let code = r#"@settings(defaultLengthUnit = ft)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -683,7 +683,7 @@ async fn kcl_test_cube_yd() {
|
||||
let code = r#"@settings(defaultLengthUnit = yd)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -704,7 +704,7 @@ myCube = cube([0,0], 10)
|
||||
async fn kcl_test_error_sketch_on_arc_face() {
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> tangentialArc(end = [0, scale], tag = $here)
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -716,7 +716,7 @@ part001 = cube([0, 0], 20)
|
||||
|> extrude(length = 20)
|
||||
|
||||
part002 = startSketchOn(part001, face = part001.sketch.tags.here)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [5, 0])
|
||||
|> line(end = [5, 5])
|
||||
|> line(end = [0, 5])
|
||||
@ -740,7 +740,7 @@ part002 = startSketchOn(part001, face = part001.sketch.tags.here)
|
||||
async fn kcl_test_sketch_on_face_of_face() {
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -752,7 +752,7 @@ part001 = cube([0,0], 20)
|
||||
|> extrude(length = 20)
|
||||
|
||||
part002 = startSketchOn(part001, face = END)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10])
|
||||
@ -760,7 +760,7 @@ part002 = startSketchOn(part001, face = END)
|
||||
|> extrude(length = 5)
|
||||
|
||||
part003 = startSketchOn(part002, face = END)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 5])
|
||||
|> line(end = [5, 0])
|
||||
|> line(end = [0, -5])
|
||||
@ -775,7 +775,7 @@ part003 = startSketchOn(part002, face = END)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_stdlib_kcl_error_right_code_path() {
|
||||
let code = r#"square = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10])
|
||||
@ -800,7 +800,7 @@ async fn kcl_test_stdlib_kcl_error_right_code_path() {
|
||||
async fn kcl_test_sketch_on_face_circle() {
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -828,7 +828,7 @@ async fn kcl_test_stdlib_kcl_error_circle() {
|
||||
// Create a function that defines the body width and length of the mounting plate. Tag the corners so they can be passed through the fillet function.
|
||||
fn rectShape = (pos, w, l) => {
|
||||
rr = startSketchOn(XY)
|
||||
|> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %)
|
||||
|> startProfile(at = [pos[0] - (w / 2), pos[1] - (l / 2)])
|
||||
|> line(endAbsolute = [pos[0] + w / 2, pos[1] - (l / 2)], tag = $edge1)
|
||||
|> line(endAbsolute = [pos[0] + w / 2, pos[1] + l / 2], tag = $edge2)
|
||||
|> line(endAbsolute = [pos[0] - (w / 2), pos[1] + l / 2], tag = $edge3)
|
||||
@ -872,7 +872,7 @@ part = rectShape([0, 0], 20, 20)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_simple_revolve() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4, 12], %)
|
||||
|> startProfile(at = [4, 12])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -6])
|
||||
|> line(end = [4, -6])
|
||||
@ -892,7 +892,7 @@ async fn kcl_test_simple_revolve() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_simple_revolve_uppercase() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4, 12], %)
|
||||
|> startProfile(at = [4, 12])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -6])
|
||||
|> line(end = [4, -6])
|
||||
@ -912,7 +912,7 @@ async fn kcl_test_simple_revolve_uppercase() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_simple_revolve_negative() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4, 12], %)
|
||||
|> startProfile(at = [4, 12])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -6])
|
||||
|> line(end = [4, -6])
|
||||
@ -932,7 +932,7 @@ async fn kcl_test_simple_revolve_negative() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_revolve_bad_angle_low() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4, 12], %)
|
||||
|> startProfile(at = [4, 12])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -6])
|
||||
|> line(end = [4, -6])
|
||||
@ -958,7 +958,7 @@ async fn kcl_test_revolve_bad_angle_low() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_revolve_bad_angle_high() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4, 12], %)
|
||||
|> startProfile(at = [4, 12])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -6])
|
||||
|> line(end = [4, -6])
|
||||
@ -984,7 +984,7 @@ async fn kcl_test_revolve_bad_angle_high() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_simple_revolve_custom_angle() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4, 12], %)
|
||||
|> startProfile(at = [4, 12])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -6])
|
||||
|> line(end = [4, -6])
|
||||
@ -1004,7 +1004,7 @@ async fn kcl_test_simple_revolve_custom_angle() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_simple_revolve_custom_axis() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4, 12], %)
|
||||
|> startProfile(at = [4, 12])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -6])
|
||||
|> line(end = [4, -6])
|
||||
@ -1024,7 +1024,7 @@ async fn kcl_test_simple_revolve_custom_axis() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_revolve_on_edge() {
|
||||
let code = r#"box = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10], tag = $revolveAxis)
|
||||
@ -1032,7 +1032,7 @@ async fn kcl_test_revolve_on_edge() {
|
||||
|> extrude(length = 10)
|
||||
|
||||
sketch001 = startSketchOn(box, face = END)
|
||||
|> startProfileAt([5, 10], %)
|
||||
|> startProfile(at = [5, 10])
|
||||
|> line(end = [0, -10])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, 10])
|
||||
@ -1048,7 +1048,7 @@ sketch001 = startSketchOn(box, face = END)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_revolve_on_edge_get_edge() {
|
||||
let code = r#"box = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10], tag = $revolveAxis)
|
||||
@ -1056,7 +1056,7 @@ async fn kcl_test_revolve_on_edge_get_edge() {
|
||||
|> extrude(length = 10)
|
||||
|
||||
sketch001 = startSketchOn(box, face = revolveAxis)
|
||||
|> startProfileAt([5, 10], %)
|
||||
|> startProfile(at = [5, 10])
|
||||
|> line(end = [0, -10])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, 10])
|
||||
@ -1078,7 +1078,7 @@ sketch001 = startSketchOn(box, face = revolveAxis)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_revolve_on_face_circle_edge() {
|
||||
let code = r#"box = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, -20], tag = $revolveAxis)
|
||||
@ -1100,7 +1100,7 @@ sketch001 = startSketchOn(box, face = "END")
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_revolve_on_face_circle() {
|
||||
let code = r#"box = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [20, 0], tag = $revolveAxis)
|
||||
|> line(end = [0, -20])
|
||||
@ -1122,7 +1122,7 @@ sketch001 = startSketchOn(box, face = "END")
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_revolve_on_face() {
|
||||
let code = r#"box = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10])
|
||||
@ -1130,7 +1130,7 @@ async fn kcl_test_revolve_on_face() {
|
||||
|> extrude(length = 10)
|
||||
|
||||
sketch001 = startSketchOn(box, face = END)
|
||||
|> startProfileAt([5, 10], %)
|
||||
|> startProfile(at = [5, 10])
|
||||
|> line(end = [0, -10])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, 10])
|
||||
@ -1162,7 +1162,7 @@ async fn kcl_test_basic_revolve_circle() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_simple_revolve_sketch_on_edge() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4, 12], %)
|
||||
|> startProfile(at = [4, 12])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -6])
|
||||
|> line(end = [4, -6])
|
||||
@ -1174,7 +1174,7 @@ async fn kcl_test_simple_revolve_sketch_on_edge() {
|
||||
|> revolve(axis = Y, angle = 180)
|
||||
|
||||
part002 = startSketchOn(part001, face = END)
|
||||
|> startProfileAt([4.5, -5], %)
|
||||
|> startProfile(at = [4.5, -5])
|
||||
|> line(end = [0, 5])
|
||||
|> line(end = [5, 0])
|
||||
|> line(end = [0, -5])
|
||||
@ -1190,7 +1190,7 @@ part002 = startSketchOn(part001, face = END)
|
||||
async fn kcl_test_plumbus_fillets() {
|
||||
let code = r#"fn make_circle = (ext, face, pos, radius) => {
|
||||
sg = startSketchOn(ext, face = face)
|
||||
|> startProfileAt([pos[0] + radius, pos[1]], %)
|
||||
|> startProfile(at = [pos[0] + radius, pos[1]])
|
||||
|> arc(
|
||||
angleEnd = 360,
|
||||
angleStart = 0,
|
||||
@ -1204,7 +1204,7 @@ async fn kcl_test_plumbus_fillets() {
|
||||
|
||||
fn pentagon = (len) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt([-len / 2, -len / 2], %)
|
||||
|> startProfile(at = [-len / 2, -len / 2])
|
||||
|> angledLine(angle = 0, length = len, tag = $a)
|
||||
|> angledLine(
|
||||
angle = segAng(a) + 180 - 108,
|
||||
@ -1312,7 +1312,7 @@ filletR = 0.25
|
||||
|
||||
// Sketch the bracket and extrude with fillets
|
||||
bracket = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, wallMountL], tag = $outerEdge)
|
||||
|> line(end = [-shelfMountL, 0])
|
||||
|> line(end = [0, -thickness])
|
||||
@ -1337,7 +1337,7 @@ bracket = startSketchOn(XY)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_error_empty_start_sketch_on_string() {
|
||||
let code = r#"part001 = startSketchOn('-XZ')
|
||||
|> startProfileAt([75.75, 184.25], %)
|
||||
|> startProfile(at = [75.75, 184.25])
|
||||
|> line(end = [190.03, -118.13])
|
||||
|> line(end = [-33.38, -202.86])
|
||||
|> line(end = [-315.86, -64.2])
|
||||
@ -1368,7 +1368,7 @@ dia = 4
|
||||
|
||||
fn squareHole = (l, w) => {
|
||||
squareHoleSketch = startSketchOn(XY)
|
||||
|> startProfileAt([-width / 2, -length / 2], %)
|
||||
|> startProfile(at = [-width / 2, -length / 2])
|
||||
|> line(endAbsolute = [width / 2, -length / 2])
|
||||
|> line(endAbsolute = [width / 2, length / 2])
|
||||
|> line(endAbsolute = [-width / 2, length / 2])
|
||||
@ -1395,7 +1395,7 @@ async fn kcl_test_array_of_sketches() {
|
||||
let code = r#"plane001 = startSketchOn(XZ)
|
||||
|
||||
profile001 = plane001
|
||||
|> startProfileAt([40.82, 240.82], %)
|
||||
|> startProfile(at = [40.82, 240.82])
|
||||
|> line(end = [235.72, -8.16])
|
||||
|> line(end = [13.27, -253.07])
|
||||
|> line(end = [-247.97, -19.39])
|
||||
@ -1403,7 +1403,7 @@ profile001 = plane001
|
||||
|> close()
|
||||
|
||||
profile002 = plane001
|
||||
|> startProfileAt([47.17, -71.91], %)
|
||||
|> startProfile(at = [47.17, -71.91])
|
||||
|> line(end = [247.96, -4.03])
|
||||
|> line(end = [-17.26, -116.79])
|
||||
|> line(end = [-235.87, 12.66])
|
||||
@ -1424,7 +1424,7 @@ async fn kcl_test_circular_pattern3d_array_of_extrudes() {
|
||||
let code = r#"plane001 = startSketchOn(XZ)
|
||||
|
||||
sketch001 = plane001
|
||||
|> startProfileAt([40.82, 240.82], %)
|
||||
|> startProfile(at = [40.82, 240.82])
|
||||
|> line(end = [235.72, -8.16])
|
||||
|> line(end = [13.27, -253.07])
|
||||
|> line(end = [-247.97, -19.39])
|
||||
@ -1433,7 +1433,7 @@ sketch001 = plane001
|
||||
|> extrude(length = 10)
|
||||
|
||||
sketch002 = plane001
|
||||
|> startProfileAt([47.17, -71.91], %)
|
||||
|> startProfile(at = [47.17, -71.91])
|
||||
|> line(end = [247.96, -4.03])
|
||||
|> line(end = [-17.26, -116.79])
|
||||
|> line(end = [-235.87, 12.66])
|
||||
@ -1475,7 +1475,7 @@ cornerFilletRad = 0.5
|
||||
holeDia = 0.5
|
||||
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([-foot1Length, 0], %)
|
||||
|> startProfile(at = [-foot1Length, 0])
|
||||
|> line(end = [0, thickness], tag = $cornerFillet1)
|
||||
|> line(end = [foot1Length, 0])
|
||||
|> line(end = [0, height], tag = $fillet1)
|
||||
@ -1523,7 +1523,7 @@ cornerChamferRad = 0.5
|
||||
holeDia = 0.5
|
||||
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([-foot1Length, 0], %)
|
||||
|> startProfile(at = [-foot1Length, 0])
|
||||
|> line(end = [0, thickness], tag = $cornerChamfer1)
|
||||
|> line(end = [foot1Length, 0])
|
||||
|> line(end = [0, height], tag = $chamfer1)
|
||||
@ -1555,7 +1555,7 @@ baseExtrusion = extrude(sketch001, length = width)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_shell_with_tag() {
|
||||
let code = r#"sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([61.74, 206.13], %)
|
||||
|> startProfile(at = [61.74, 206.13])
|
||||
|> xLine(length = 305.11, tag = $seg01)
|
||||
|> yLine(length = -291.85)
|
||||
|> xLine(length = -segLen(seg01))
|
||||
@ -1576,7 +1576,7 @@ async fn kcl_test_shell_with_tag() {
|
||||
async fn kcl_test_linear_pattern3d_filleted_sketch() {
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -1607,7 +1607,7 @@ pattn1 = patternLinear3d(
|
||||
async fn kcl_test_circular_pattern3d_filleted_sketch() {
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -1634,7 +1634,7 @@ pattn2 = patternCircular3d(part001, axis = [0,0, 1], center = [-20, -20, -20], i
|
||||
async fn kcl_test_circular_pattern3d_chamfered_sketch() {
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -1660,7 +1660,7 @@ pattn2 = patternCircular3d(part001, axis = [0,0, 1], center = [-20, -20, -20], i
|
||||
async fn kcl_test_tag_chamfer_with_more_than_one_edge_should_fail() {
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> startProfile(at = pos)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
|> line(end = [0, -scale])
|
||||
@ -1694,7 +1694,7 @@ part001 = cube([0,0], 20)
|
||||
async fn kcl_test_duplicate_tags_should_error() {
|
||||
let code = r#"fn triangle = (len) => {
|
||||
return startSketchOn(XY)
|
||||
|> startProfileAt([-len / 2, -len / 2], %)
|
||||
|> startProfile(at = [-len / 2, -len / 2])
|
||||
|> angledLine(angle = 0, length = len , tag = $a)
|
||||
|> angledLine(
|
||||
angle = segAng(a) + 120,
|
||||
@ -1769,7 +1769,7 @@ async fn kcl_test_extrude_custom_plane() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_arc_error_same_start_end() {
|
||||
let code = r#"startSketchOn(XY)
|
||||
|> startProfileAt([10, 0], %)
|
||||
|> startProfile(at = [10, 0])
|
||||
|> arc(
|
||||
angleStart = 180,
|
||||
angleEnd = 180,
|
||||
@ -1793,7 +1793,7 @@ async fn kcl_test_arc_error_same_start_end() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_to_x_90() {
|
||||
let code = r#"exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 90, endAbsoluteX = 10)
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [-10, 0])
|
||||
@ -1813,7 +1813,7 @@ example = extrude(exampleSketch, length = 10)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_to_x_270() {
|
||||
let code = r#"exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 270, endAbsoluteX = 10)
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [-10, 0])
|
||||
@ -1833,7 +1833,7 @@ example = extrude(exampleSketch, length = 10)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_to_y_0() {
|
||||
let code = r#"exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 0, endAbsoluteY = 20)
|
||||
|> line(end = [-20, 0])
|
||||
|> angledLine(angle = 70, endAbsoluteY = 10)
|
||||
@ -1853,7 +1853,7 @@ example = extrude(exampleSketch, length = 10)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_to_y_180() {
|
||||
let code = r#"exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 180, endAbsoluteY = 20)
|
||||
|> line(end = [-20, 0])
|
||||
|> angledLine(angle = 70, endAbsoluteY = 10)
|
||||
@ -1873,7 +1873,7 @@ example = extrude(exampleSketch, length = 10)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_of_x_length_90() {
|
||||
let code = r#"sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 90, lengthX = 90, tag = $edge1)
|
||||
|> angledLine(angle = -15, lengthX = -15, tag = $edge2)
|
||||
|> line(end = [0, -5])
|
||||
@ -1893,7 +1893,7 @@ extrusion = extrude(sketch001, length = 10)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_of_x_length_270() {
|
||||
let code = r#"sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 90, lengthX = 90, tag = $edge1)
|
||||
|> angledLine(angle = -15, lengthX = -15, tag = $edge2)
|
||||
|> line(end = [0, -5])
|
||||
@ -1913,7 +1913,7 @@ extrusion = extrude(sketch001, length = 10)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_of_y_length_0() {
|
||||
let code = r#"exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|> angledLine(angle = 0, lengthY = 10)
|
||||
|> line(end = [0, 10])
|
||||
@ -1935,7 +1935,7 @@ example = extrude(exampleSketch, length = 10)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_of_y_length_180() {
|
||||
let code = r#"exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|> angledLine(angle = 180, lengthY = 10)
|
||||
|> line(end = [0, 10])
|
||||
@ -1957,7 +1957,7 @@ example = extrude(exampleSketch, length = 10)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_angled_line_of_y_length_negative_180() {
|
||||
let code = r#"exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|> angledLine(angle = -180, lengthY = 10)
|
||||
|> line(end = [0, 10])
|
||||
@ -2017,7 +2017,7 @@ someFunction('INVALID')
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_error_no_auth_websocket() {
|
||||
let code = r#"const sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([61.74, 206.13], %)
|
||||
|> startProfile(at = [61.74, 206.13])
|
||||
|> xLine(length = 305.11, tag = $seg01)
|
||||
|> yLine(length = -291.85)
|
||||
|> xLine(length = -segLen(seg01))
|
||||
@ -2052,7 +2052,7 @@ length = 1 + 1 / 2
|
||||
|
||||
// create a sketch on the XY plane
|
||||
sketch000 = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, innerDiameter / 2])
|
||||
"#;
|
||||
|
||||
|
Reference in New Issue
Block a user