Merge branch 'main' into jtran/units-indicator

This commit is contained in:
Frank Noirot
2025-03-21 10:23:42 -04:00
258 changed files with 1872 additions and 1326 deletions

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing angled_line.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([4.83, 12.56], %)
|> line(end = [15.1, 2.48])
|> line(end = [3.15, -9.85], tag = $seg01)

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing artifact_graph_example_code1.kcl
---
sketch001 = startSketchOn('XY')
sketch001 = startSketchOn(XY)
|> startProfileAt([-5, -5], %)
|> line(end = [0, 10])
|> line(end = [10.55, 0], tag = $seg01)

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing artifact_graph_example_code_no_3d.kcl
---
sketch003 = startSketchOn('YZ')
sketch003 = startSketchOn(YZ)
|> startProfileAt([5.82, 0], %)
|> angledLine([180, 11.54], %, $rectangleSegmentA001)
|> angledLine([
@ -15,7 +15,7 @@ sketch003 = startSketchOn('YZ')
], %, $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch004 = startSketchOn('-XZ')
sketch004 = startSketchOn(-XZ)
|> startProfileAt([0, 14.36], %)
|> line(end = [15.49, 0.05])
|> tangentialArcTo([0, 0], %)

View File

@ -2,9 +2,9 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing artifact_graph_example_code_offset_planes.kcl
---
offsetPlane001 = offsetPlane("XY", offset = 20)
offsetPlane002 = offsetPlane("XZ", offset = -50)
offsetPlane003 = offsetPlane("YZ", offset = 10)
offsetPlane001 = offsetPlane(XY, offset = 20)
offsetPlane002 = offsetPlane(XZ, offset = -50)
offsetPlane003 = offsetPlane(YZ, offset = 10)
sketch002 = startSketchOn(offsetPlane001)
|> startProfileAt([0, 0], %)

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing artifact_graph_sketch_on_face_etc.kcl
---
sketch001 = startSketchOn('XZ')
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [4, 8])
|> line(end = [5, -8], tag = $seg01)

View File

@ -4,7 +4,7 @@ description: Result of unparsing tests/assembly_mixed_units_cubes/cube-inches.kc
---
@settings(defaultLengthUnit = in)
sketch001 = startSketchOn('XY')
sketch001 = startSketchOn(XY)
cubeIn = startProfileAt([-10, -10], sketch001)
|> xLine(length = 5)
|> yLine(length = -5)

View File

@ -4,7 +4,7 @@ description: Result of unparsing tests/assembly_mixed_units_cubes/cube-mm.kcl
---
@settings(defaultLengthUnit = mm)
sketch001 = startSketchOn('XY')
sketch001 = startSketchOn(XY)
cubeMm = startProfileAt([10, 10], sketch001)
|> xLine(length = 5)
|> yLine(length = -5)

View File

@ -8,5 +8,5 @@ description: Result of unparsing tests/assembly_non_default_units/other1.kcl
import radius from "globals.kcl"
// Use the same units as in the main importing file.
startSketchOn('XZ')
startSketchOn(XZ)
|> circle(center = [0, 0], radius = 1)

View File

@ -5,5 +5,5 @@ description: Result of unparsing tests/assembly_non_default_units/other2.kcl
@settings(defaultLengthUnit = in)
// Use the same units as in the main importing file.
startSketchOn('XZ')
startSketchOn(XZ)
|> circle(center = [0, 2], radius = 1)

View File

@ -15,7 +15,7 @@ bondAngle = 104.5 // Bond angle in degrees
// Function to create a sphere representing an atom
fn createAtom(center, radius) {
return startSketchOn('XY')
return startSketchOn(XY)
|> circle(center = center, radius = radius)
|> extrude(length = radius * 2)
}

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing basic_fillet_cube_close_opposite.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10], tag = $thing)
|> line(end = [10, 0])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing basic_fillet_cube_end.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10], tag = $thing)
|> line(end = [10, 0])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing basic_fillet_cube_next_adjacent.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10], tag = $thing)
|> line(end = [10, 0], tag = $thing1)

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing basic_fillet_cube_previous_adjacent.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10], tag = $thing)
|> line(end = [10, 0], tag = $thing1)

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing basic_fillet_cube_start.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10], tag = $thing)
|> line(end = [10, 0])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing big_number_angle_to_match_length_x.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [1, 3.82], tag = $seg01)
|> angledLineToX([-angleToMatchLengthX(seg01, 3, %), 3], %)

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing big_number_angle_to_match_length_y.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [1, 3.82], tag = $seg01)
|> angledLineToX([-angleToMatchLengthY(seg01, 3, %), 3], %)

View File

@ -2,6 +2,6 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing circle_three_point.kcl
---
sketch001 = startSketchOn('XY')
sketch001 = startSketchOn(XY)
|> circleThreePoint(p1 = [25, 25], p2 = [30, 20], p3 = [27, 15])
|> extrude(length = 10)

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing circular_pattern3d_a_pattern.kcl
---
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [0, 2])
|> line(end = [3, 1])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing crazy_multi_profile.kcl
---
sketch001 = startSketchOn('XZ')
sketch001 = startSketchOn(XZ)
profile001 = startProfileAt([6.71, -3.66], sketch001)
|> line(end = [2.65, 9.02], tag = $seg02)
|> line(end = [3.73, -9.36], tag = $seg01)
@ -38,7 +38,7 @@ profile006 = startProfileAt([9.65, 3.82], sketch002)
|> close()
revolve001 = revolve(profile004, angle = 45, axis = getNextAdjacentEdge(seg01))
extrude002 = extrude(profile006, length = 4)
sketch003 = startSketchOn('-XZ')
sketch003 = startSketchOn(-XZ)
profile007 = startProfileAt([4.8, 7.55], sketch003)
|> line(end = [7.39, 2.58])
|> line(end = [7.02, -2.85])

View File

@ -45,7 +45,7 @@ miniHdmiHole = startSketchOn(XY)
])
|> close(%)
case = startSketchOn('XY')
case = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [caseWidth, 0], tag = $edge1)
|> line(endAbsolute = [caseWidth, caseLength], tag = $edge2)
@ -63,7 +63,7 @@ case = startSketchOn('XY')
)
fn m25Screw(x, y, height) {
screw = startSketchOn("XY")
screw = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> circle(center = [x, y], radius = 2.5)
|> hole(circle(center = [x, y], radius = 1.25), %)

View File

@ -12,7 +12,7 @@ outerDiameter = 35 / 64
length = 1 + 1 / 2
// create a sketch on the 'XY' plane
sketch000 = startSketchOn('XY')
sketch000 = startSketchOn(XY)
// create a profile of the outside of the pipe
outerProfile = circle(

View File

@ -3,7 +3,7 @@ source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing function_sketch.kcl
---
fn box(h, l, w) {
myBox = startSketchOn('XY')
myBox = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, l])
|> line(end = [w, 0])

View File

@ -3,7 +3,7 @@ source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing function_sketch_with_position.kcl
---
fn box(p, h, l, w) {
myBox = startSketchOn('XY')
myBox = startSketchOn(XY)
|> startProfileAt(p, %)
|> line(end = [0, l])
|> line(end = [w, 0])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing helix_ccw.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> circle(center = [5, 5], radius = 10)
|> extrude(length = 10)
|> helixRevolutions({

View File

@ -3,7 +3,7 @@ source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing helix_simple.kcl
---
// Create a helix around an edge.
helper001 = startSketchOn('XZ')
helper001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10], tag = $edge001)

View File

@ -4,7 +4,7 @@ description: Result of unparsing tests/import_function_not_sketch/my_functions.k
---
@settings(defaultLengthUnit = mm)
export part001 = startSketchOn('XY')
export part001 = startSketchOn(XY)
|> startProfileAt([4, 12], %)
|> line(end = [2, 0])
|> line(end = [0, -6])

View File

@ -7,5 +7,5 @@ export fn foo() {
}
// This interacts with the engine.
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> circle(center = [0, 0], radius = 10)

View File

@ -4,6 +4,6 @@ description: Result of unparsing tests/import_whole/exported_mod.kcl
---
@settings(defaultLengthUnit = inch)
startSketchOn('XY')
startSketchOn(XY)
|> circle(center = [5, 5], radius = 10)
|> extrude(length = 10)

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing kittycad_svg.kcl
---
svg = startSketchOn('XY')
svg = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [2.52, -26.04]) // MoveAbsolute
|> line(endAbsolute = [2.52, -25.2]) // VerticalLineAbsolute

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing linear_pattern3d_a_pattern.kcl
---
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [0, 2])
|> line(end = [3, 1])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing mike_stress_test.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([0.0, 0.0], %)
|> line(end = [
-0.3670208139314082,

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing neg_xz_plane.kcl
---
part001 = startSketchOn('-XZ')
part001 = startSketchOn(-XZ)
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [100, 100])
|> line(endAbsolute = [100, 0])

View File

@ -2,13 +2,13 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing out_of_band_sketches.kcl
---
sketch001 = startSketchOn('XZ')
sketch001 = startSketchOn(XZ)
profile001 = startProfileAt([27.67, 239.34], sketch001)
// enter sketch mode, start path, move path pen, disable sketch mode
|> line(end = [414.61, 0]) // extend path
|> line(end = [33.98, -389.36]) // extend path
sketch002 = startSketchOn('XY')
sketch002 = startSketchOn(XY)
profile002 = startProfileAt([67.04, -63.5], sketch002)
// enter sketch mode, start path, move path pen, disable sketch mode
|> line(end = [282.37, 0]) // extend path

View File

@ -11,7 +11,7 @@ FOS = 2
leg1 = 5 // inches
leg2 = 8 // inches
thickness = sqrt(distance * p * FOS * 6 / sigmaAllow / width) // inches
bracket = startSketchOn('XY')
bracket = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, leg1])
|> line(end = [leg2, 0])

View File

@ -12,7 +12,7 @@ circ = {
}
triangleLen = 500
p = startSketchOn('XY')
p = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> angledLine({ angle = 60, length = triangleLen }, %, $a)
|> angledLine({ angle = 180, length = triangleLen }, %, $b)

View File

@ -13,7 +13,7 @@ front_length = 6
Fx = 0.5
Fy = 0.5
sketch001 = startSketchOn('-YZ')
sketch001 = startSketchOn(-YZ)
|> startProfileAt([back_walls_width / 2, 0], %)
|> xLine(length = wall_thickness / 2)
|> angledLineToX({ angle = 45, to = back_walls_width }, %, $seg01)
@ -45,7 +45,7 @@ part001 = revolve(
},
)
sketch002 = startSketchOn('-YZ')
sketch002 = startSketchOn(-YZ)
|> startProfileAt([back_walls_width / 2, 0], %)
|> xLine(length = wall_thickness / 2)
|> angledLineToX({ angle = 45, to = back_walls_width }, %, $seg02)

View File

@ -2,9 +2,9 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing revolve_about_edge.kcl
---
sketch001 = startSketchOn('XY')
sketch001 = startSketchOn(XY)
|> startProfileAt([-25, 25], %)
|> yLine(length = -50, tag = $rectangleSegmentB001)
sketch002 = startSketchOn('XY')
sketch002 = startSketchOn(XY)
|> circle(center = [-50, 0], radius = 10)
|> revolve(angle = 90, axis = rectangleSegmentB001)

View File

@ -12,7 +12,7 @@ xs = 205804
ys = 71816
ox = 35 - (t(xs) % 70)
oy = 35 - (t(ys) % 70)
r = startSketchOn('XZ')
r = startSketchOn(XZ)
|> startProfileAt([ox, oy], %)
|> line(end = [1, 0])
|> line(end = [0, -1])

View File

@ -12,7 +12,7 @@ export boltThreadLength = 1.75
export fn bolt() {
// Create the head of the cap screw
boltHead = startSketchOn('XZ')
boltHead = startSketchOn(XZ)
|> circle(center = [0, 0], radius = boltHeadDiameter / 2, tag = $topEdge)
|> extrude(length = -boltHeadLength)
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])

View File

@ -12,7 +12,7 @@ export boltThreadLength = 1.75
export fn bolt() {
// Create the head of the cap screw
boltHead = startSketchOn('XZ')
boltHead = startSketchOn(XZ)
|> circle(center = [0, 0], radius = boltHeadDiameter / 2, tag = $topEdge)
|> extrude(length = -boltHeadLength)
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing sketch-on-chamfer-two-times-different-order.kcl
---
sketch001 = startSketchOn('XZ')
sketch001 = startSketchOn(XZ)
|> startProfileAt([75.8, 317.2], %) // [$startCapTag, $EndCapTag]
|> angledLine([0, 268.43], %, $rectangleSegmentA001)
|> angledLine([

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing sketch-on-chamfer-two-times.kcl
---
sketch001 = startSketchOn('XZ')
sketch001 = startSketchOn(XZ)
|> startProfileAt([75.8, 317.2], %) // [$startCapTag, $EndCapTag]
|> angledLine([0, 268.43], %, $rectangleSegmentA001)
|> angledLine([

View File

@ -3,7 +3,7 @@ source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing sketch_in_object.kcl
---
fn test() {
return startSketchOn('XY')
return startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 1])
|> line(end = [1, 0])
@ -14,7 +14,7 @@ fn test() {
fn test2() {
return {
thing1 = {
thing2 = startSketchOn('XY')
thing2 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 1])
|> line(end = [1, 0])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing sketch_on_face.kcl
---
part001 = startSketchOn('XY')
part001 = startSketchOn(XY)
|> startProfileAt([11.19, 28.35], %)
|> line(end = [28.67, -13.25], tag = $here)
|> line(end = [-4.12, -22.81])

View File

@ -26,7 +26,7 @@ thickness = sqrt(6 * M * FOS / (width * sigmaAllow))
filletR = 0.25
// Sketch the bracket and extrude with fillets
bracket = startSketchOn('XY')
bracket = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, wallMountL], tag = $outerEdge)
|> line(end = [-shelfMountL, 0], tag = $seg01)

View File

@ -3,7 +3,7 @@ source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing sketch_on_face_circle_tagged.kcl
---
fn cube(pos, scale) {
sg = startSketchOn('XY')
sg = startSketchOn(XY)
|> startProfileAt(pos, %)
|> line(end = [0, scale])
|> line(end = [scale, 0])

View File

@ -3,7 +3,7 @@ source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing sketch_on_face_end.kcl
---
fn cube(pos, scale) {
sg = startSketchOn('XY')
sg = startSketchOn(XY)
|> startProfileAt(pos, %)
|> line(end = [0, scale])
|> line(end = [scale, 0])

View File

@ -3,7 +3,7 @@ source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing sketch_on_face_end_negative_extrude.kcl
---
fn cube(pos, scale) {
sg = startSketchOn('XY')
sg = startSketchOn(XY)
|> startProfileAt(pos, %)
|> line(end = [0, scale])
|> line(end = [scale, 0])

View File

@ -3,7 +3,7 @@ source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing sketch_on_face_start.kcl
---
fn cube(pos, scale) {
sg = startSketchOn('XY')
sg = startSketchOn(XY)
|> startProfileAt(pos, %)
|> line(end = [0, scale])
|> line(end = [scale, 0])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing ssi_pattern.kcl
---
sketch001 = startSketchOn('XZ')
sketch001 = startSketchOn(XZ)
|> startProfileAt([-4.35, -12.26], %)
|> yLine(length = 10.2)
|> line(end = [0.54, -0.03])

View File

@ -8,7 +8,7 @@ angleOffset = 135
r = 1
angleStart = 110
startSketchOn('XY')
startSketchOn(XY)
|> startProfileAt([startX, startY], %)
|> angledLine({ angle = angleStart, length = .000001 }, %)
|> tangentialArc({ offset = angleOffset, radius = r }, %, $arc1)

View File

@ -12,7 +12,7 @@ export boltThreadLength = 1.75
export fn bolt() {
// Create the head of the cap screw
boltHead = startSketchOn('XZ')
boltHead = startSketchOn(XZ)
|> circle(center = [0, 0], radius = boltHeadDiameter / 2, tag = $topEdge)
|> extrude(length = -boltHeadLength)
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])

View File

@ -2,7 +2,7 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing xz_plane.kcl
---
part001 = startSketchOn('XZ')
part001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [100, 100])
|> line(endAbsolute = [100, 0])