diff --git a/docs/kcl-std/consts/std-math-E.md b/docs/kcl-std/consts/std-math-E.md index f2e929795..874fc0d86 100644 --- a/docs/kcl-std/consts/std-math-E.md +++ b/docs/kcl-std/consts/std-math-E.md @@ -18,7 +18,7 @@ E: number = 2.71828182845904523536028747135266250_ ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 30, length = 2 * E ^ 2) + |> angledLine(angle = 30deg, length = 2 * E ^ 2) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/consts/std-math-TAU.md b/docs/kcl-std/consts/std-math-TAU.md index 2e4ee4df3..8f1845729 100644 --- a/docs/kcl-std/consts/std-math-TAU.md +++ b/docs/kcl-std/consts/std-math-TAU.md @@ -18,7 +18,7 @@ TAU: number = 6.28318530717958647692528676655900577_ ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 50, length = 10 * TAU) + |> angledLine(angle = 50deg, length = 10 * TAU) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/consts/std-turns-ZERO.md b/docs/kcl-std/consts/std-turns-ZERO.md index 7ed8e19e7..db5d80596 100644 --- a/docs/kcl-std/consts/std-turns-ZERO.md +++ b/docs/kcl-std/consts/std-turns-ZERO.md @@ -8,7 +8,7 @@ layout: manual No turn, zero degrees/radians. ```kcl -turns::ZERO: number = 0 +turns::ZERO ``` diff --git a/docs/kcl-std/functions/std-math-abs.md b/docs/kcl-std/functions/std-math-abs.md index 6ab327d36..b93beb61d 100644 --- a/docs/kcl-std/functions/std-math-abs.md +++ b/docs/kcl-std/functions/std-math-abs.md @@ -27,7 +27,7 @@ abs(@input: number): number ### Examples ```kcl -myAngle = -120 +myAngle = -120deg sketch001 = startSketchOn(XZ) |> startProfile(at = [0, 0]) diff --git a/docs/kcl-std/functions/std-math-cos.md b/docs/kcl-std/functions/std-math-cos.md index 692a0485b..cbd3a6f9f 100644 --- a/docs/kcl-std/functions/std-math-cos.md +++ b/docs/kcl-std/functions/std-math-cos.md @@ -29,7 +29,7 @@ cos(@num: number(Angle)): number ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 30, length = 3 / cos(30deg)) + |> angledLine(angle = 30deg, length = 3 / cos(30deg)) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/functions/std-math-max.md b/docs/kcl-std/functions/std-math-max.md index 9c606e054..d45f48072 100644 --- a/docs/kcl-std/functions/std-math-max.md +++ b/docs/kcl-std/functions/std-math-max.md @@ -29,7 +29,7 @@ max(@input: [number; 1+]): number ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 70, length = max([15, 31, 4, 13, 22])) + |> angledLine(angle = 70deg, length = max([15, 31, 4, 13, 22])) |> line(end = [20, 0]) |> close() diff --git a/docs/kcl-std/functions/std-math-min.md b/docs/kcl-std/functions/std-math-min.md index b889e19b4..4fc273e87 100644 --- a/docs/kcl-std/functions/std-math-min.md +++ b/docs/kcl-std/functions/std-math-min.md @@ -29,7 +29,7 @@ min(@input: [number; 1+]): number ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 70, length = min([15, 31, 4, 13, 22])) + |> angledLine(angle = 70deg, length = min([15, 31, 4, 13, 22])) |> line(end = [20, 0]) |> close() diff --git a/docs/kcl-std/functions/std-math-polar.md b/docs/kcl-std/functions/std-math-polar.md index af820c779..b94a3cc8e 100644 --- a/docs/kcl-std/functions/std-math-polar.md +++ b/docs/kcl-std/functions/std-math-polar.md @@ -33,7 +33,7 @@ polar( ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> line(end = polar(angle = 30, length = 5), tag = $thing) + |> line(end = polar(angle = 30deg, length = 5), tag = $thing) |> line(end = [0, 5]) |> line(end = [segEndX(thing), 0]) |> line(end = [-20, 10]) diff --git a/docs/kcl-std/functions/std-math-pow.md b/docs/kcl-std/functions/std-math-pow.md index 64b2232e3..311a42848 100644 --- a/docs/kcl-std/functions/std-math-pow.md +++ b/docs/kcl-std/functions/std-math-pow.md @@ -33,7 +33,7 @@ pow( ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 50, length = pow(5, exp = 2)) + |> angledLine(angle = 50deg, length = pow(5, exp = 2)) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/functions/std-math-sin.md b/docs/kcl-std/functions/std-math-sin.md index 22b11ded7..68e53dadd 100644 --- a/docs/kcl-std/functions/std-math-sin.md +++ b/docs/kcl-std/functions/std-math-sin.md @@ -29,7 +29,7 @@ sin(@num: number(Angle)): number ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 50, length = 15 / sin(135deg)) + |> angledLine(angle = 50deg, length = 15 / sin(135deg)) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/functions/std-math-sqrt.md b/docs/kcl-std/functions/std-math-sqrt.md index 6d33555e4..3ff896242 100644 --- a/docs/kcl-std/functions/std-math-sqrt.md +++ b/docs/kcl-std/functions/std-math-sqrt.md @@ -29,7 +29,7 @@ sqrt(@input: number): number ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 50, length = sqrt(2500)) + |> angledLine(angle = 50deg, length = sqrt(2500)) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/functions/std-math-tan.md b/docs/kcl-std/functions/std-math-tan.md index 9c65eef9d..ca22123df 100644 --- a/docs/kcl-std/functions/std-math-tan.md +++ b/docs/kcl-std/functions/std-math-tan.md @@ -29,7 +29,7 @@ tan(@num: number(Angle)): number ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 50, length = 50 * tan((1 / 2): number(rad))) + |> angledLine(angle = 50deg, length = 50 * tan((1 / 2): number(rad))) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/functions/std-sketch-angledLine.md b/docs/kcl-std/functions/std-sketch-angledLine.md index ed60c6afb..983c42bab 100644 --- a/docs/kcl-std/functions/std-sketch-angledLine.md +++ b/docs/kcl-std/functions/std-sketch-angledLine.md @@ -46,7 +46,7 @@ angledLine( exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> yLine(endAbsolute = 15) - |> angledLine(angle = 30, length = 15) + |> angledLine(angle = 30deg, length = 15) |> line(end = [8, -10]) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/functions/std-sketch-angledLineThatIntersects.md b/docs/kcl-std/functions/std-sketch-angledLineThatIntersects.md index 3422738ed..d588a1846 100644 --- a/docs/kcl-std/functions/std-sketch-angledLineThatIntersects.md +++ b/docs/kcl-std/functions/std-sketch-angledLineThatIntersects.md @@ -42,7 +42,7 @@ exampleSketch = startSketchOn(XZ) |> line(endAbsolute = [5, 10]) |> line(endAbsolute = [-10, 10], tag = $lineToIntersect) |> line(endAbsolute = [0, 20]) - |> angledLineThatIntersects(angle = 80, intersectTag = lineToIntersect, offset = 10) + |> angledLineThatIntersects(angle = 80deg, intersectTag = lineToIntersect, offset = 10) |> close() example = extrude(exampleSketch, length = 10) diff --git a/docs/kcl-std/functions/std-sketch-arc.md b/docs/kcl-std/functions/std-sketch-arc.md index dc0ac94bb..e3909df53 100644 --- a/docs/kcl-std/functions/std-sketch-arc.md +++ b/docs/kcl-std/functions/std-sketch-arc.md @@ -53,7 +53,7 @@ for to construct your shape, you're likely looking for tangentialArc. exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> line(end = [10, 0]) - |> arc(angleStart = 0, angleEnd = 280, radius = 16) + |> arc(angleStart = 0, angleEnd = 280deg, radius = 16) |> close() example = extrude(exampleSketch, length = 10) diff --git a/docs/kcl-std/functions/std-sketch-extrude.md b/docs/kcl-std/functions/std-sketch-extrude.md index d1e191f17..be7b62a67 100644 --- a/docs/kcl-std/functions/std-sketch-extrude.md +++ b/docs/kcl-std/functions/std-sketch-extrude.md @@ -43,7 +43,7 @@ extruded in the same direction. example = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> line(end = [10, 0]) - |> arc(angleStart = 120, angleEnd = 0, radius = 5) + |> arc(angleStart = 120deg, angleEnd = 0, radius = 5) |> line(end = [5, 0]) |> line(end = [0, 10]) |> bezierCurve(control1 = [-10, 0], control2 = [2, 10], end = [-5, 10]) @@ -58,7 +58,7 @@ example = startSketchOn(XZ) ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [-10, 0]) - |> arc(angleStart = 120, angleEnd = -60, radius = 5) + |> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5) |> line(end = [10, 0]) |> line(end = [5, 0]) |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10]) @@ -75,7 +75,7 @@ example = extrude(exampleSketch, length = 10) ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [-10, 0]) - |> arc(angleStart = 120, angleEnd = -60, radius = 5) + |> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5) |> line(end = [10, 0]) |> line(end = [5, 0]) |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10]) @@ -92,7 +92,7 @@ example = extrude(exampleSketch, length = 20, symmetric = true) ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [-10, 0]) - |> arc(angleStart = 120, angleEnd = -60, radius = 5) + |> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5) |> line(end = [10, 0]) |> line(end = [5, 0]) |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10]) diff --git a/docs/kcl-std/functions/std-sketch-getNextAdjacentEdge.md b/docs/kcl-std/functions/std-sketch-getNextAdjacentEdge.md index 398e573b8..a85e47b24 100644 --- a/docs/kcl-std/functions/std-sketch-getNextAdjacentEdge.md +++ b/docs/kcl-std/functions/std-sketch-getNextAdjacentEdge.md @@ -30,10 +30,10 @@ getNextAdjacentEdge(@edge: tag): Edge exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> line(end = [10, 0]) - |> angledLine(angle = 60, length = 10) - |> angledLine(angle = 120, length = 10) + |> angledLine(angle = 60deg, length = 10) + |> angledLine(angle = 120deg, length = 10) |> line(end = [-10, 0]) - |> angledLine(angle = 240, length = 10, tag = $referenceEdge) + |> angledLine(angle = 240deg, length = 10, tag = $referenceEdge) |> close() example = extrude(exampleSketch, length = 5) diff --git a/docs/kcl-std/functions/std-sketch-getOppositeEdge.md b/docs/kcl-std/functions/std-sketch-getOppositeEdge.md index f3970fd37..cf859d7f3 100644 --- a/docs/kcl-std/functions/std-sketch-getOppositeEdge.md +++ b/docs/kcl-std/functions/std-sketch-getOppositeEdge.md @@ -30,10 +30,10 @@ getOppositeEdge(@edge: tag): Edge exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> line(end = [10, 0]) - |> angledLine(angle = 60, length = 10) - |> angledLine(angle = 120, length = 10) + |> angledLine(angle = 60deg, length = 10) + |> angledLine(angle = 120deg, length = 10) |> line(end = [-10, 0]) - |> angledLine(angle = 240, length = 10, tag = $referenceEdge) + |> angledLine(angle = 240deg, length = 10, tag = $referenceEdge) |> close() example = extrude(exampleSketch, length = 5) diff --git a/docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge.md b/docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge.md index 8f4a96d07..b9a2fd9b3 100644 --- a/docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge.md +++ b/docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge.md @@ -30,10 +30,10 @@ getPreviousAdjacentEdge(@edge: tag): Edge exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> line(end = [10, 0]) - |> angledLine(angle = 60, length = 10) - |> angledLine(angle = 120, length = 10) + |> angledLine(angle = 60deg, length = 10) + |> angledLine(angle = 120deg, length = 10) |> line(end = [-10, 0]) - |> angledLine(angle = 240, length = 10, tag = $referenceEdge) + |> angledLine(angle = 240deg, length = 10, tag = $referenceEdge) |> close() example = extrude(exampleSketch, length = 5) diff --git a/docs/kcl-std/functions/std-sketch-involuteCircular.md b/docs/kcl-std/functions/std-sketch-involuteCircular.md index e64c3e981..a0393e22b 100644 --- a/docs/kcl-std/functions/std-sketch-involuteCircular.md +++ b/docs/kcl-std/functions/std-sketch-involuteCircular.md @@ -43,11 +43,11 @@ a = 10 b = 14 startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> involuteCircular(startRadius = a, endRadius = b, angle = 60) + |> involuteCircular(startRadius = a, endRadius = b, angle = 60deg) |> involuteCircular( startRadius = a, endRadius = b, - angle = 60, + angle = 60deg, reverse = true, ) diff --git a/docs/kcl-std/functions/std-sketch-profileStart.md b/docs/kcl-std/functions/std-sketch-profileStart.md index 71e59b7c3..35909a36d 100644 --- a/docs/kcl-std/functions/std-sketch-profileStart.md +++ b/docs/kcl-std/functions/std-sketch-profileStart.md @@ -30,7 +30,7 @@ profileStart(@profile: Sketch): Point2d sketch001 = startSketchOn(XY) |> startProfile(at = [5, 2]) |> angledLine(angle = 120, length = 50, tag = $seg01) - |> angledLine(angle = segAng(seg01) + 120, length = 50) + |> angledLine(angle = segAng(seg01) + 120deg, length = 50) |> line(end = profileStart(%)) |> close() |> extrude(length = 20) diff --git a/docs/kcl-std/functions/std-sketch-profileStartX.md b/docs/kcl-std/functions/std-sketch-profileStartX.md index 88cc65536..2f61afa9f 100644 --- a/docs/kcl-std/functions/std-sketch-profileStartX.md +++ b/docs/kcl-std/functions/std-sketch-profileStartX.md @@ -30,8 +30,8 @@ profileStartX(@profile: Sketch): number(Length) sketch001 = startSketchOn(XY) |> startProfile(at = [5, 2]) |> angledLine(angle = -26.6, length = 50) - |> angledLine(angle = 90, length = 50) - |> angledLine(angle = 30, endAbsoluteX = profileStartX(%)) + |> angledLine(angle = 90deg, length = 50) + |> angledLine(angle = 30deg, endAbsoluteX = profileStartX(%)) ``` diff --git a/docs/kcl-std/functions/std-sketch-profileStartY.md b/docs/kcl-std/functions/std-sketch-profileStartY.md index 3001a0596..a259d035d 100644 --- a/docs/kcl-std/functions/std-sketch-profileStartY.md +++ b/docs/kcl-std/functions/std-sketch-profileStartY.md @@ -29,8 +29,8 @@ profileStartY(@profile: Sketch): number(Length) ```kcl sketch001 = startSketchOn(XY) |> startProfile(at = [5, 2]) - |> angledLine(angle = -60, length = 14) - |> angledLine(angle = 30, endAbsoluteY = profileStartY(%)) + |> angledLine(angle = -60deg, length = 14) + |> angledLine(angle = 30deg, endAbsoluteY = profileStartY(%)) ``` diff --git a/docs/kcl-std/functions/std-sketch-revolve.md b/docs/kcl-std/functions/std-sketch-revolve.md index 03ba6102f..e29a4d5ec 100644 --- a/docs/kcl-std/functions/std-sketch-revolve.md +++ b/docs/kcl-std/functions/std-sketch-revolve.md @@ -62,7 +62,7 @@ part001 = startSketchOn(XY) |> line(end = [0, -5.5]) |> line(end = [-2, 0]) |> close() - |> revolve(axis = Y) // default angle is 360 + |> revolve(axis = Y) // default angle is 360deg ``` @@ -72,7 +72,7 @@ part001 = startSketchOn(XY) // A donut shape. sketch001 = startSketchOn(XY) |> circle(center = [15, 0], radius = 5) - |> revolve(angle = 360, axis = Y) + |> revolve(angle = 360deg, axis = Y) ``` @@ -89,7 +89,7 @@ part001 = startSketchOn(XY) |> line(end = [0, -5.5]) |> line(end = [-2, 0]) |> close() - |> revolve(axis = Y, angle = 180) + |> revolve(axis = Y, angle = 180deg) ``` @@ -106,7 +106,7 @@ part001 = startSketchOn(XY) |> line(end = [0, -5.5]) |> line(end = [-2, 0]) |> close() - |> revolve(axis = Y, angle = 180) + |> revolve(axis = Y, angle = 180deg) part002 = startSketchOn(part001, face = END) |> startProfile(at = [4.5, -5]) @@ -131,7 +131,7 @@ box = startSketchOn(XY) sketch001 = startSketchOn(box, face = END) |> circle(center = [10, 10], radius = 4) - |> revolve(angle = -90, axis = Y) + |> revolve(angle = -90deg, axis = Y) ``` @@ -148,7 +148,7 @@ box = startSketchOn(XY) sketch001 = startSketchOn(box, face = END) |> circle(center = [10, 10], radius = 4) - |> revolve(angle = 90, axis = getOppositeEdge(revolveAxis)) + |> revolve(angle = 90deg, axis = getOppositeEdge(revolveAxis)) ``` @@ -165,7 +165,7 @@ box = startSketchOn(XY) sketch001 = startSketchOn(box, face = END) |> circle(center = [10, 10], radius = 4) - |> revolve(angle = 90, axis = getOppositeEdge(revolveAxis), tolerance = 0.0001) + |> revolve(angle = 90deg, axis = getOppositeEdge(revolveAxis), tolerance = 0.0001) ``` @@ -229,7 +229,7 @@ profile001 = startSketchOn(XY) sketch001 = startSketchOn(XY) |> circle(center = [-10, 10], radius = 4) - |> revolve(angle = 90, axis = revolveAxis) + |> revolve(angle = 90deg, axis = revolveAxis) ``` @@ -246,7 +246,7 @@ profile001 = startSketchOn(XY) sketch001 = startSketchOn(XY) |> circle(center = [-10, 10], radius = 4) - |> revolve(angle = 90, axis = revolveAxis) + |> revolve(angle = 90deg, axis = revolveAxis) ``` @@ -263,7 +263,7 @@ profile001 = startSketchOn(XY) sketch001 = startSketchOn(XY) |> circle(center = [-10, 10], radius = 4) - |> revolve(angle = 90, axis = revolveAxis, symmetric = true) + |> revolve(angle = 90deg, axis = revolveAxis, symmetric = true) ``` @@ -280,7 +280,7 @@ profile001 = startSketchOn(XY) sketch001 = startSketchOn(XY) |> circle(center = [-10, 10], radius = 4) - |> revolve(angle = 90, axis = revolveAxis, bidirectionalAngle = 50) + |> revolve(angle = 90deg, axis = revolveAxis, bidirectionalAngle = 50) ``` diff --git a/docs/kcl-std/functions/std-sketch-segLen.md b/docs/kcl-std/functions/std-sketch-segLen.md index 8e14d8601..53c773199 100644 --- a/docs/kcl-std/functions/std-sketch-segLen.md +++ b/docs/kcl-std/functions/std-sketch-segLen.md @@ -30,8 +30,8 @@ segLen(@tag: tag): number(Length) exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> angledLine(angle = 60, length = 10, tag = $thing) - |> tangentialArc(angle = -120, radius = 5) - |> angledLine(angle = -60, length = segLen(thing)) + |> tangentialArc(angle = -120deg, radius = 5) + |> angledLine(angle = -60deg, length = segLen(thing)) |> close() example = extrude(exampleSketch, length = 5) diff --git a/docs/kcl-std/functions/std-sketch-startSketchOn.md b/docs/kcl-std/functions/std-sketch-startSketchOn.md index 5f269b776..1a0bcf490 100644 --- a/docs/kcl-std/functions/std-sketch-startSketchOn.md +++ b/docs/kcl-std/functions/std-sketch-startSketchOn.md @@ -156,7 +156,7 @@ exampleSketch = startSketchOn(XY) |> line(end = [-2, 0]) |> close() -example = revolve(exampleSketch, axis = Y, angle = 180) +example = revolve(exampleSketch, axis = Y, angle = 180deg) exampleSketch002 = startSketchOn(example, face = END) |> startProfile(at = [4.5, -5]) @@ -189,7 +189,7 @@ exampleSketch = startSketchOn(XY) example = revolve( exampleSketch, axis = Y, - angle = 180, + angle = 180deg, tagEnd = $end01, ) diff --git a/docs/kcl-std/functions/std-sketch-sweep.md b/docs/kcl-std/functions/std-sketch-sweep.md index 1648d8f26..9ca9fd3bd 100644 --- a/docs/kcl-std/functions/std-sketch-sweep.md +++ b/docs/kcl-std/functions/std-sketch-sweep.md @@ -54,9 +54,9 @@ swept along the same path. sweepPath = startSketchOn(XZ) |> startProfile(at = [0.05, 0.05]) |> line(end = [0, 7]) - |> tangentialArc(angle = 90, radius = 5) + |> tangentialArc(angle = 90deg, radius = 5) |> line(end = [-3, 0]) - |> tangentialArc(angle = -90, radius = 5) + |> tangentialArc(angle = -90deg, radius = 5) |> line(end = [0, 7]) // Create a hole for the pipe. @@ -101,7 +101,7 @@ springSketch = startSketchOn(XZ) sketch001 = startSketchOn(XY) rectangleSketch = startProfile(sketch001, at = [-200, 23.86]) |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001) - |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61) + |> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61) |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -111,7 +111,7 @@ circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63) sketch002 = startSketchOn(YZ) sweepPath = startProfile(sketch002, at = [0, 0]) |> yLine(length = 231.81) - |> tangentialArc(radius = 80, angle = -90) + |> tangentialArc(radius = 80, angle = -90deg) |> xLine(length = 384.93) sweep([rectangleSketch, circleSketch], path = sweepPath) @@ -130,7 +130,7 @@ circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63) sketch002 = startSketchOn(YZ) sweepPath = startProfile(sketch002, at = [0, 0]) |> yLine(length = 231.81) - |> tangentialArc(radius = 80, angle = -90) + |> tangentialArc(radius = 80, angle = -90deg) |> xLine(length = 384.93) sweep(circleSketch, path = sweepPath, sectional = true) diff --git a/docs/kcl-std/functions/std-sketch-tangentialArc.md b/docs/kcl-std/functions/std-sketch-tangentialArc.md index ead2308a2..3adc0ac3d 100644 --- a/docs/kcl-std/functions/std-sketch-tangentialArc.md +++ b/docs/kcl-std/functions/std-sketch-tangentialArc.md @@ -47,7 +47,7 @@ for 'angle' degrees along the imaginary circle. ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 45, length = 10) + |> angledLine(angle = 45deg, length = 10) |> tangentialArc(end = [0, -10]) |> line(end = [-10, 0]) |> close() @@ -61,7 +61,7 @@ example = extrude(exampleSketch, length = 10) ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 60, length = 10) + |> angledLine(angle = 60deg, length = 10) |> tangentialArc(endAbsolute = [15, 15]) |> line(end = [10, -15]) |> close() @@ -75,9 +75,9 @@ example = extrude(exampleSketch, length = 10) ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 60, length = 10) - |> tangentialArc(radius = 10, angle = -120) - |> angledLine(angle = -60, length = 10) + |> angledLine(angle = 60deg, length = 10) + |> tangentialArc(radius = 10, angle = -120deg) + |> angledLine(angle = -60deg, length = 10) |> close() example = extrude(exampleSketch, length = 10) diff --git a/docs/kcl-std/functions/std-sketch-xLine.md b/docs/kcl-std/functions/std-sketch-xLine.md index 51a0c7f70..79dda97d5 100644 --- a/docs/kcl-std/functions/std-sketch-xLine.md +++ b/docs/kcl-std/functions/std-sketch-xLine.md @@ -38,10 +38,10 @@ xLine( exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> xLine(length = 15) - |> angledLine(angle = 80, length = 15) + |> angledLine(angle = 80deg, length = 15) |> line(end = [8, -10]) |> xLine(length = 10) - |> angledLine(angle = 120, length = 30) + |> angledLine(angle = 120deg, length = 30) |> xLine(length = -15) |> close() diff --git a/docs/kcl-std/functions/std-sketch-yLine.md b/docs/kcl-std/functions/std-sketch-yLine.md index 9797a94ca..8b09d328a 100644 --- a/docs/kcl-std/functions/std-sketch-yLine.md +++ b/docs/kcl-std/functions/std-sketch-yLine.md @@ -38,7 +38,7 @@ yLine( exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) |> yLine(length = 15) - |> angledLine(angle = 30, length = 15) + |> angledLine(angle = 30deg, length = 15) |> line(end = [8, -10]) |> yLine(length = -5) |> close() diff --git a/docs/kcl-std/functions/std-solid-appearance.md b/docs/kcl-std/functions/std-solid-appearance.md index c1e5420ba..224de4d1e 100644 --- a/docs/kcl-std/functions/std-solid-appearance.md +++ b/docs/kcl-std/functions/std-solid-appearance.md @@ -55,7 +55,7 @@ example = extrude(exampleSketch, length = 5) // Add color to a revolved solid. sketch001 = startSketchOn(XY) |> circle(center = [15, 0], radius = 5) - |> revolve(angle = 360, axis = Y) + |> revolve(angle = 360deg, axis = Y) |> appearance(color = '#ff0000', metalness = 90, roughness = 90) ``` @@ -196,9 +196,9 @@ example = extrude(exampleSketch, length = 1) sweepPath = startSketchOn(XZ) |> startProfile(at = [0.05, 0.05]) |> line(end = [0, 7]) - |> tangentialArc(angle = 90, radius = 5) + |> tangentialArc(angle = 90deg, radius = 5) |> line(end = [-3, 0]) - |> tangentialArc(angle = -90, radius = 5) + |> tangentialArc(angle = -90deg, radius = 5) |> line(end = [0, 7]) pipeHole = startSketchOn(XY) diff --git a/docs/kcl-std/functions/std-solid-patternTransform.md b/docs/kcl-std/functions/std-solid-patternTransform.md index ae9ef2d20..1d0564b63 100644 --- a/docs/kcl-std/functions/std-solid-patternTransform.md +++ b/docs/kcl-std/functions/std-solid-patternTransform.md @@ -50,7 +50,7 @@ Its properties are: - `rotation.axis` (a 3D point, defaults to the Z axis) - - `rotation.angle` (number of degrees) + - `rotation.angle` - `rotation.origin` (either "local" i.e. rotate around its own center, "global" i.e. rotate around the scene's center, or a 3D point, defaults to "local") @@ -135,7 +135,7 @@ fn transform(@i) { pow(0.9, exp = i) ], // Turn by 15 degrees each time. - rotation = { angle = 15 * i, origin = "local" } + rotation = { angle = 15deg * i, origin = "local" } } } @@ -171,7 +171,7 @@ fn transform(@i) { return { translate = [0, 0, -i * width], rotation = { - angle = 90 * i, + angle = 90deg * i, // Rotate around the overall scene's origin. origin = "global" } @@ -219,7 +219,7 @@ fn transform(@i) { // Transform functions can return multiple transforms. They'll be applied in order. return [ { translate = [30 * i, 0, 0] }, - { rotation = { angle = 45 * i } } + { rotation = { angle = 45deg * i } } ] } startSketchOn(XY) diff --git a/docs/kcl-std/functions/std-transform-rotate.md b/docs/kcl-std/functions/std-transform-rotate.md index 7083b5356..ddb68d8cc 100644 --- a/docs/kcl-std/functions/std-transform-rotate.md +++ b/docs/kcl-std/functions/std-transform-rotate.md @@ -72,9 +72,9 @@ rotation. sweepPath = startSketchOn(XZ) |> startProfile(at = [0.05, 0.05]) |> line(end = [0, 7]) - |> tangentialArc(angle = 90, radius = 5) + |> tangentialArc(angle = 90deg, radius = 5) |> line(end = [-3, 0]) - |> tangentialArc(angle = -90, radius = 5) + |> tangentialArc(angle = -90deg, radius = 5) |> line(end = [0, 7]) // Create a hole for the pipe. @@ -98,9 +98,9 @@ sweepSketch = startSketchOn(XY) sweepPath = startSketchOn(XZ) |> startProfile(at = [0.05, 0.05]) |> line(end = [0, 7]) - |> tangentialArc(angle = 90, radius = 5) + |> tangentialArc(angle = 90deg, radius = 5) |> line(end = [-3, 0]) - |> tangentialArc(angle = -90, radius = 5) + |> tangentialArc(angle = -90deg, radius = 5) |> line(end = [0, 7]) // Create a hole for the pipe. @@ -124,9 +124,9 @@ sweepSketch = startSketchOn(XY) sweepPath = startSketchOn(XZ) |> startProfile(at = [0.05, 0.05]) |> line(end = [0, 7]) - |> tangentialArc(angle = 90, radius = 5) + |> tangentialArc(angle = 90deg, radius = 5) |> line(end = [-3, 0]) - |> tangentialArc(angle = -90, radius = 5) + |> tangentialArc(angle = -90deg, radius = 5) |> line(end = [0, 7]) // Create a hole for the pipe. @@ -137,7 +137,7 @@ sweepSketch = startSketchOn(XY) |> circle(center = [0, 0], radius = 2) |> subtract2d(tool = pipeHole) |> sweep(path = sweepPath) - |> rotate(axis = Z, angle = 90) + |> rotate(axis = Z, angle = 90deg) ``` @@ -150,7 +150,7 @@ sweepSketch = startSketchOn(XY) import "tests/inputs/cube.sldprt" as cube cube - |> rotate(axis = [0, 0, 1.0], angle = 9) + |> rotate(axis = [0, 0, 1.0], angle = 9deg) ``` @@ -163,9 +163,9 @@ cube sweepPath = startSketchOn(XZ) |> startProfile(at = [0.05, 0.05]) |> line(end = [0, 7]) - |> tangentialArc(angle = 90, radius = 5) + |> tangentialArc(angle = 90deg, radius = 5) |> line(end = [-3, 0]) - |> tangentialArc(angle = -90, radius = 5) + |> tangentialArc(angle = -90deg, radius = 5) |> line(end = [0, 7]) // Create a hole for the pipe. @@ -176,7 +176,7 @@ sweepSketch = startSketchOn(XY) |> circle(center = [0, 0], radius = 2) |> subtract2d(tool = pipeHole) |> sweep(path = sweepPath) - |> rotate(axis = [0, 0, 1.0], angle = 90) + |> rotate(axis = [0, 0, 1.0], angle = 90deg) ``` @@ -199,13 +199,13 @@ circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63) sketch002 = startSketchOn(YZ) sweepPath = startProfile(sketch002, at = [0, 0]) |> yLine(length = 231.81) - |> tangentialArc(radius = 80, angle = -90) + |> tangentialArc(radius = 80, angle = -90deg) |> xLine(length = 384.93) parts = sweep([rectangleSketch, circleSketch], path = sweepPath) // Rotate the sweeps. -rotate(parts, axis = [0, 0, 1.0], angle = 90) +rotate(parts, axis = [0, 0, 1.0], angle = 90deg) ``` @@ -228,7 +228,7 @@ profile001 = square() profile002 = square() |> translate(x = 0, y = 0, z = 20) - |> rotate(axis = [0, 0, 1.0], angle = 45) + |> rotate(axis = [0, 0, 1.0], angle = 45deg) loft([profile001, profile002]) diff --git a/docs/kcl-std/functions/std-transform-scale.md b/docs/kcl-std/functions/std-transform-scale.md index d19ffae11..4a954a41e 100644 --- a/docs/kcl-std/functions/std-transform-scale.md +++ b/docs/kcl-std/functions/std-transform-scale.md @@ -54,9 +54,9 @@ look like the model moves and gets bigger at the same time. Say you have a squar sweepPath = startSketchOn(XZ) |> startProfile(at = [0.05, 0.05]) |> line(end = [0, 7]) - |> tangentialArc(angle = 90, radius = 5) + |> tangentialArc(angle = 90deg, radius = 5) |> line(end = [-3, 0]) - |> tangentialArc(angle = -90, radius = 5) + |> tangentialArc(angle = -90deg, radius = 5) |> line(end = [0, 7]) // Create a hole for the pipe. @@ -93,7 +93,7 @@ cube sketch001 = startSketchOn(XY) rectangleSketch = startProfile(sketch001, at = [-200, 23.86]) |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001) - |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61) + |> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61) |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -103,7 +103,7 @@ circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63) sketch002 = startSketchOn(YZ) sweepPath = startProfile(sketch002, at = [0, 0]) |> yLine(length = 231.81) - |> tangentialArc(radius = 80, angle = -90) + |> tangentialArc(radius = 80, angle = -90deg) |> xLine(length = 384.93) parts = sweep([rectangleSketch, circleSketch], path = sweepPath) diff --git a/docs/kcl-std/functions/std-transform-translate.md b/docs/kcl-std/functions/std-transform-translate.md index 54e5e6468..cedc1fd6e 100644 --- a/docs/kcl-std/functions/std-transform-translate.md +++ b/docs/kcl-std/functions/std-transform-translate.md @@ -47,9 +47,9 @@ and then rotate it using the `rotate` function to create a loft. sweepPath = startSketchOn(XZ) |> startProfile(at = [0.05, 0.05]) |> line(end = [0, 7]) - |> tangentialArc(angle = 90, radius = 5) + |> tangentialArc(angle = 90deg, radius = 5) |> line(end = [-3, 0]) - |> tangentialArc(angle = -90, radius = 5) + |> tangentialArc(angle = -90deg, radius = 5) |> line(end = [0, 7]) // Create a hole for the pipe. @@ -91,7 +91,7 @@ cube sketch001 = startSketchOn(XY) rectangleSketch = startProfile(sketch001, at = [-200, 23.86]) |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001) - |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61) + |> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61) |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -101,7 +101,7 @@ circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63) sketch002 = startSketchOn(YZ) sweepPath = startProfile(sketch002, at = [0, 0]) |> yLine(length = 231.81) - |> tangentialArc(radius = 80, angle = -90) + |> tangentialArc(radius = 80, angle = -90deg) |> xLine(length = 384.93) parts = sweep([rectangleSketch, circleSketch], path = sweepPath) @@ -162,7 +162,7 @@ profile001 = square() profile002 = square() |> translate(z = 20) - |> rotate(axis = [0, 0, 1.0], angle = 45) + |> rotate(axis = [0, 0, 1.0], angle = 45deg) loft([profile001, profile002]) diff --git a/docs/kcl-std/functions/std-units-toDegrees.md b/docs/kcl-std/functions/std-units-toDegrees.md index cbd199fb2..b5fd04e4a 100644 --- a/docs/kcl-std/functions/std-units-toDegrees.md +++ b/docs/kcl-std/functions/std-units-toDegrees.md @@ -29,7 +29,7 @@ units::toDegrees(@num: number(Angle)): number(deg) ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 50, length = 70 * cos(units::toDegrees((PI / 4): number(rad)))) + |> angledLine(angle = 50deg, length = 70 * cos(units::toDegrees((PI / 4): number(rad)))) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/functions/std-units-toRadians.md b/docs/kcl-std/functions/std-units-toRadians.md index 536edb243..ef5f47764 100644 --- a/docs/kcl-std/functions/std-units-toRadians.md +++ b/docs/kcl-std/functions/std-units-toRadians.md @@ -29,7 +29,7 @@ units::toRadians(@num: number(Angle)): number(rad) ```kcl exampleSketch = startSketchOn(XZ) |> startProfile(at = [0, 0]) - |> angledLine(angle = 50, length = 70 * cos(units::toRadians(45))) + |> angledLine(angle = 50deg, length = 70 * cos(units::toRadians(45deg))) |> yLine(endAbsolute = 0) |> close() diff --git a/docs/kcl-std/types/std-types-tag.md b/docs/kcl-std/types/std-types-tag.md index bbb0612ea..2f7959620 100644 --- a/docs/kcl-std/types/std-types-tag.md +++ b/docs/kcl-std/types/std-types-tag.md @@ -17,7 +17,7 @@ startSketchOn(XZ) |> startProfile(at = origin) |> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001) |> angledLine( - angle = segAng(rectangleSegmentA001) - 90, + angle = segAng(rectangleSegmentA001) - 90deg, length = 196.99, tag = $rectangleSegmentB001, ) @@ -80,7 +80,7 @@ fn rect(origin) { |> startProfile(at = origin) |> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001) |> angledLine( - angle = segAng(rectangleSegmentA001) - 90, + angle = segAng(rectangleSegmentA001) - 90deg, length = 196.99 tag = $rectangleSegmentB001, ) diff --git a/rust/kcl-lib/src/execution/exec_ast.rs b/rust/kcl-lib/src/execution/exec_ast.rs index 85396b6b6..f44cb6f74 100644 --- a/rust/kcl-lib/src/execution/exec_ast.rs +++ b/rust/kcl-lib/src/execution/exec_ast.rs @@ -1156,7 +1156,7 @@ impl Node { KclValue::Number { value: l / r, meta, ty } } BinaryOperator::Mod => { - let (l, r, ty) = NumericType::combine_div(left, right); + let (l, r, ty) = NumericType::combine_mod(left, right); self.warn_on_unknown(&ty, "Modulo of", exec_state); KclValue::Number { value: l % r, meta, ty } } diff --git a/rust/kcl-lib/src/execution/types.rs b/rust/kcl-lib/src/execution/types.rs index 84453da69..c4f4d911f 100644 --- a/rust/kcl-lib/src/execution/types.rs +++ b/rust/kcl-lib/src/execution/types.rs @@ -499,20 +499,6 @@ impl NumericType { NumericType::Known(UnitType::Angle(UnitAngle::Degrees)) } - pub fn expect_default_length(&self) -> Self { - match self { - NumericType::Default { len, .. } => NumericType::Known(UnitType::Length(*len)), - _ => unreachable!(), - } - } - - pub fn expect_default_angle(&self) -> Self { - match self { - NumericType::Default { angle, .. } => NumericType::Known(UnitType::Angle(*angle)), - _ => unreachable!(), - } - } - /// Combine two types when we expect them to be equal, erring on the side of less coercion. To be /// precise, only adjusting one number or the other when they are of known types. /// @@ -554,15 +540,10 @@ impl NumericType { (at, Any) => (a.n, b.n, at), (Any, bt) => (a.n, b.n, bt), - (Default { .. }, Default { .. }) | (_, Unknown) | (Unknown, _) => (a.n, b.n, Unknown), - // Known types and compatible, but needs adjustment. (t @ Known(UnitType::Length(l1)), Known(UnitType::Length(l2))) => (a.n, l2.adjust_to(b.n, l1).0, t), (t @ Known(UnitType::Angle(a1)), Known(UnitType::Angle(a2))) => (a.n, a2.adjust_to(b.n, a1).0, t), - // Known but incompatible. - (Known(_), Known(_)) => (a.n, b.n, Unknown), - // Known and unknown => we assume the known one, possibly with adjustment (Known(UnitType::Count), Default { .. }) | (Default { .. }, Known(UnitType::Count)) => { (a.n, b.n, Known(UnitType::Count)) @@ -570,9 +551,12 @@ impl NumericType { (t @ Known(UnitType::Length(l1)), Default { len: l2, .. }) => (a.n, l2.adjust_to(b.n, l1).0, t), (Default { len: l1, .. }, t @ Known(UnitType::Length(l2))) => (l1.adjust_to(a.n, l2).0, b.n, t), - (t @ Known(UnitType::Angle(a1)), Default { angle: a2, .. }) => (a.n, a2.adjust_to(b.n, a1).0, t), (Default { angle: a1, .. }, t @ Known(UnitType::Angle(a2))) => (a1.adjust_to(a.n, a2).0, b.n, t), + + (Known(_), Known(_)) | (Default { .. }, Default { .. }) | (_, Unknown) | (Unknown, _) => { + (a.n, b.n, Unknown) + } } } @@ -647,6 +631,20 @@ impl NumericType { } } + /// Combine two types for modulo-like operations. + pub fn combine_mod(a: TyF64, b: TyF64) -> (f64, f64, NumericType) { + use NumericType::*; + match (a.ty, b.ty) { + (at @ Default { .. }, bt @ Default { .. }) if at == bt => (a.n, b.n, at), + (at, bt) if at == bt => (a.n, b.n, at), + (Default { .. }, Default { .. }) => (a.n, b.n, Unknown), + (at, Known(UnitType::Count) | Any) => (a.n, b.n, at), + (at @ Known(_), Default { .. }) => (a.n, b.n, at), + (Known(UnitType::Count), _) => (a.n, b.n, Known(UnitType::Count)), + _ => (a.n, b.n, Unknown), + } + } + pub fn from_parsed(suffix: NumericSuffix, settings: &super::MetaSettings) -> Self { match suffix { NumericSuffix::None => NumericType::Default { @@ -851,7 +849,7 @@ impl std::fmt::Display for UnitType { } } -// TODO called UnitLen so as not to clash with UnitLength in settings) +// TODO called UnitLen so as not to clash with UnitLength in settings. /// A unit of length. #[derive(Debug, Default, Clone, Copy, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Eq)] #[ts(export)] diff --git a/rust/kcl-lib/src/std/math.rs b/rust/kcl-lib/src/std/math.rs index ec7890862..8ef316927 100644 --- a/rust/kcl-lib/src/std/math.rs +++ b/rust/kcl-lib/src/std/math.rs @@ -18,7 +18,7 @@ pub async fn rem(exec_state: &mut ExecState, args: Args) -> Result startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 30, +/// angle = 30deg, /// length = 2 * E ^ 2, /// ) /// |> yLine(endAbsolute = 0) @@ -47,7 +47,7 @@ export E = 2.71828182845904523536028747135266250_ /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 50, +/// angle = 50deg, /// length = 10 * TAU, /// ) /// |> yLine(endAbsolute = 0) @@ -63,7 +63,7 @@ export TAU = 6.28318530717958647692528676655900577_ /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 30, +/// angle = 30deg, /// length = 3 / cos(30deg), /// ) /// |> yLine(endAbsolute = 0) @@ -80,7 +80,7 @@ export fn cos(@num: number(Angle)): number {} /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 50, +/// angle = 50deg, /// length = 15 / sin(135deg), /// ) /// |> yLine(endAbsolute = 0) @@ -97,7 +97,7 @@ export fn sin(@num: number(Angle)): number {} /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 50, +/// angle = 50deg, /// length = 50 * tan((1/2): number(rad)), /// ) /// |> yLine(endAbsolute = 0) @@ -185,7 +185,7 @@ export fn atan2(y: number(Length), x: number(Length)): number(rad) {} /// ``` /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) -/// |> line(end = polar(angle = 30, length = 5), tag = $thing) +/// |> line(end = polar(angle = 30deg, length = 5), tag = $thing) /// |> line(end = [0, 5]) /// |> line(end = [segEndX(thing), 0]) /// |> line(end = [-20, 10]) @@ -226,7 +226,7 @@ export fn rem( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 50, +/// angle = 50deg, /// length = sqrt(2500), /// ) /// |> yLine(endAbsolute = 0) @@ -240,7 +240,7 @@ export fn sqrt(@input: number): number {} /// Compute the absolute value of a number. /// /// ``` -/// myAngle = -120 +/// myAngle = -120deg /// /// sketch001 = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) @@ -312,7 +312,7 @@ export fn ceil(@input: number): number {} /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 70, +/// angle = 70deg, /// length = min([15, 31, 4, 13, 22]) /// ) /// |> line(end = [20, 0]) @@ -332,7 +332,7 @@ export fn min( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 70, +/// angle = 70deg, /// length = max([15, 31, 4, 13, 22]) /// ) /// |> line(end = [20, 0]) @@ -352,7 +352,7 @@ export fn max( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 50, +/// angle = 50deg, /// length = pow(5, exp = 2), /// ) /// |> yLine(endAbsolute = 0) diff --git a/rust/kcl-lib/std/sketch.kcl b/rust/kcl-lib/std/sketch.kcl index 142b306ea..c2628b376 100644 --- a/rust/kcl-lib/std/sketch.kcl +++ b/rust/kcl-lib/std/sketch.kcl @@ -128,7 +128,7 @@ /// |> line(end = [-2, 0]) /// |> close() /// -/// example = revolve(exampleSketch, axis = Y, angle = 180) +/// example = revolve(exampleSketch, axis = Y, angle = 180deg) /// /// exampleSketch002 = startSketchOn(example, face = END) /// |> startProfile(at = [4.5, -5]) @@ -154,7 +154,7 @@ /// |> line(end = [-2, 0]) /// |> close() /// -/// example = revolve(exampleSketch, axis = Y, angle = 180, tagEnd = $end01) +/// example = revolve(exampleSketch, axis = Y, angle = 180deg, tagEnd = $end01) /// /// exampleSketch002 = startSketchOn(example, face = end01) /// |> startProfile(at = [4.5, -5]) @@ -283,7 +283,7 @@ export fn circle( /// |> startProfile(at = [0, 0]) /// |> line(end = [10, 0]) /// |> arc( -/// angleStart = 120, +/// angleStart = 120deg, /// angleEnd = 0, /// radius = 5, /// ) @@ -303,8 +303,8 @@ export fn circle( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [-10, 0]) /// |> arc( -/// angleStart = 120, -/// angleEnd = -60, +/// angleStart = 120deg, +/// angleEnd = -60deg, /// radius = 5, /// ) /// |> line(end = [10, 0]) @@ -325,8 +325,8 @@ export fn circle( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [-10, 0]) /// |> arc( -/// angleStart = 120, -/// angleEnd = -60, +/// angleStart = 120deg, +/// angleEnd = -60deg, /// radius = 5, /// ) /// |> line(end = [10, 0]) @@ -347,8 +347,8 @@ export fn circle( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [-10, 0]) /// |> arc( -/// angleStart = 120, -/// angleEnd = -60, +/// angleStart = 120deg, +/// angleEnd = -60deg, /// radius = 5, /// ) /// |> line(end = [10, 0]) @@ -404,7 +404,7 @@ export fn extrude( /// |> line(end = [0, -5.5]) /// |> line(end = [-2, 0]) /// |> close() -/// |> revolve(axis = Y) // default angle is 360 +/// |> revolve(axis = Y) // default angle is 360deg /// ``` /// /// ```kcl @@ -412,7 +412,7 @@ export fn extrude( /// sketch001 = startSketchOn(XY) /// |> circle( center = [15, 0], radius = 5 ) /// |> revolve( -/// angle = 360, +/// angle = 360deg, /// axis = Y, /// ) /// ``` @@ -428,7 +428,7 @@ export fn extrude( /// |> line(end = [0, -5.5]) /// |> line(end = [-2, 0]) /// |> close() -/// |> revolve(axis = Y, angle = 180) +/// |> revolve(axis = Y, angle = 180deg) /// ``` /// /// ```kcl @@ -442,7 +442,7 @@ export fn extrude( /// |> line(end = [0, -5.5]) /// |> line(end = [-2, 0]) /// |> close() -/// |> revolve(axis = Y, angle = 180) +/// |> revolve(axis = Y, angle = 180deg) /// /// part002 = startSketchOn(part001, face = END) /// |> startProfile(at = [4.5, -5]) @@ -465,7 +465,7 @@ export fn extrude( /// sketch001 = startSketchOn(box, face = END) /// |> circle( center = [10,10], radius = 4 ) /// |> revolve( -/// angle = -90, +/// angle = -90deg, /// axis = Y /// ) /// ``` @@ -482,7 +482,7 @@ export fn extrude( /// sketch001 = startSketchOn(box, face = END) /// |> circle( center = [10,10], radius = 4 ) /// |> revolve( -/// angle = 90, +/// angle = 90deg, /// axis = getOppositeEdge(revolveAxis) /// ) /// ``` @@ -499,7 +499,7 @@ export fn extrude( /// sketch001 = startSketchOn(box, face = END) /// |> circle( center = [10,10], radius = 4 ) /// |> revolve( -/// angle = 90, +/// angle = 90deg, /// axis = getOppositeEdge(revolveAxis), /// tolerance = 0.0001 /// ) @@ -558,7 +558,7 @@ export fn extrude( /// /// sketch001 = startSketchOn(XY) /// |> circle(center = [-10, 10], radius = 4) -/// |> revolve(angle = 90, axis = revolveAxis) +/// |> revolve(angle = 90deg, axis = revolveAxis) /// ``` /// /// ```kcl @@ -571,7 +571,7 @@ export fn extrude( /// /// sketch001 = startSketchOn(XY) /// |> circle(center = [-10, 10], radius = 4) -/// |> revolve(angle = 90, axis = revolveAxis) +/// |> revolve(angle = 90deg, axis = revolveAxis) /// ``` /// /// ```kcl @@ -584,7 +584,7 @@ export fn extrude( /// /// sketch001 = startSketchOn(XY) /// |> circle(center = [-10, 10], radius = 4) -/// |> revolve(angle = 90, axis = revolveAxis, symmetric = true) +/// |> revolve(angle = 90deg, axis = revolveAxis, symmetric = true) /// ``` /// /// ```kcl @@ -597,7 +597,7 @@ export fn extrude( /// /// sketch001 = startSketchOn(XY) /// |> circle(center = [-10, 10], radius = 4) -/// |> revolve(angle = 90, axis = revolveAxis, bidirectionalAngle = 50) +/// |> revolve(angle = 90deg, axis = revolveAxis, bidirectionalAngle = 50) /// ``` @(impl = std_rust) export fn revolve( @@ -651,16 +651,16 @@ export fn patternTransform2d( /// |> startProfile(at = [0, 0]) /// |> line(end = [10, 0]) /// |> angledLine( -/// angle = 60, +/// angle = 60deg, /// length = 10, /// ) /// |> angledLine( -/// angle = 120, +/// angle = 120deg, /// length = 10, /// ) /// |> line(end = [-10, 0]) /// |> angledLine( -/// angle = 240, +/// angle = 240deg, /// length = 10, /// tag = $referenceEdge, /// ) @@ -685,16 +685,16 @@ export fn getOppositeEdge( /// |> startProfile(at = [0, 0]) /// |> line(end = [10, 0]) /// |> angledLine( -/// angle = 60, +/// angle = 60deg, /// length = 10, /// ) /// |> angledLine( -/// angle = 120, +/// angle = 120deg, /// length = 10, /// ) /// |> line(end = [-10, 0]) /// |> angledLine( -/// angle = 240, +/// angle = 240deg, /// length = 10, /// tag = $referenceEdge, /// ) @@ -719,16 +719,16 @@ export fn getNextAdjacentEdge( /// |> startProfile(at = [0, 0]) /// |> line(end = [10, 0]) /// |> angledLine( -/// angle = 60, +/// angle = 60deg, /// length = 10, /// ) /// |> angledLine( -/// angle = 120, +/// angle = 120deg, /// length = 10, /// ) /// |> line(end = [-10, 0]) /// |> angledLine( -/// angle = 240, +/// angle = 240deg, /// length = 10, /// tag = $referenceEdge, /// ) @@ -855,9 +855,9 @@ export fn polygon( /// sweepPath = startSketchOn(XZ) /// |> startProfile(at = [0.05, 0.05]) /// |> line(end = [0, 7]) -/// |> tangentialArc(angle = 90, radius = 5) +/// |> tangentialArc(angle = 90deg, radius = 5) /// |> line(end = [-3, 0]) -/// |> tangentialArc(angle = -90, radius = 5) +/// |> tangentialArc(angle = -90deg, radius = 5) /// |> line(end = [0, 7]) /// /// // Create a hole for the pipe. @@ -903,7 +903,7 @@ export fn polygon( /// rectangleSketch = startProfile(sketch001, at = [-200, 23.86]) /// |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001) /// |> angledLine( -/// angle = segAng(rectangleSegmentA001) - 90, +/// angle = segAng(rectangleSegmentA001) - 90deg, /// length = 50.61, /// ) /// |> angledLine( @@ -918,7 +918,7 @@ export fn polygon( /// sketch002 = startSketchOn(YZ) /// sweepPath = startProfile(sketch002, at = [0, 0]) /// |> yLine(length = 231.81) -/// |> tangentialArc(radius = 80, angle = -90) +/// |> tangentialArc(radius = 80, angle = -90deg) /// |> xLine(length = 384.93) /// /// sweep([rectangleSketch, circleSketch], path = sweepPath) @@ -933,7 +933,7 @@ export fn polygon( /// sketch002 = startSketchOn(YZ) /// sweepPath = startProfile(sketch002, at = [0, 0]) /// |> yLine(length = 231.81) -/// |> tangentialArc(radius = 80, angle = -90) +/// |> tangentialArc(radius = 80, angle = -90deg) /// |> xLine(length = 384.93) /// /// sweep(circleSketch, path = sweepPath, sectional = true) @@ -1311,9 +1311,9 @@ export fn lastSegY( /// length = 10, /// tag = $thing, /// ) -/// |> tangentialArc(angle = -120, radius = 5) +/// |> tangentialArc(angle = -120deg, radius = 5) /// |> angledLine( -/// angle = -60, +/// angle = -60deg, /// length = segLen(thing), /// ) /// |> close() @@ -1430,7 +1430,7 @@ export fn tangentToEnd( /// sketch001 = startSketchOn(XY) /// |> startProfile(at = [5, 2]) /// |> angledLine(angle = 120, length = 50 , tag = $seg01) -/// |> angledLine(angle = segAng(seg01) + 120, length = 50 ) +/// |> angledLine(angle = segAng(seg01) + 120deg, length = 50 ) /// |> line(end = profileStart(%)) /// |> close() /// |> extrude(length = 20) @@ -1447,8 +1447,8 @@ export fn profileStart( /// sketch001 = startSketchOn(XY) /// |> startProfile(at = [5, 2]) /// |> angledLine(angle = -26.6, length = 50) -/// |> angledLine(angle = 90, length = 50) -/// |> angledLine(angle = 30, endAbsoluteX = profileStartX(%)) +/// |> angledLine(angle = 90deg, length = 50) +/// |> angledLine(angle = 30deg, endAbsoluteX = profileStartX(%)) /// ``` @(impl = std_rust) export fn profileStartX( @@ -1461,8 +1461,8 @@ export fn profileStartX( /// ```kcl /// sketch001 = startSketchOn(XY) /// |> startProfile(at = [5, 2]) -/// |> angledLine(angle = -60, length = 14 ) -/// |> angledLine(angle = 30, endAbsoluteY = profileStartY(%)) +/// |> angledLine(angle = -60deg, length = 14 ) +/// |> angledLine(angle = 30deg, endAbsoluteY = profileStartY(%)) /// ``` @(impl = std_rust) export fn profileStartY( @@ -1477,8 +1477,8 @@ export fn profileStartY( /// b = 14 /// startSketchOn(XZ) /// |> startProfile(at = [0, 0]) -/// |> involuteCircular(startRadius = a, endRadius = b, angle = 60) -/// |> involuteCircular(startRadius = a, endRadius = b, angle = 60, reverse = true) +/// |> involuteCircular(startRadius = a, endRadius = b, angle = 60deg) +/// |> involuteCircular(startRadius = a, endRadius = b, angle = 60deg, reverse = true) /// ``` @(impl = std_rust) export fn involuteCircular( @@ -1541,13 +1541,13 @@ export fn line( /// |> startProfile(at = [0, 0]) /// |> xLine(length = 15) /// |> angledLine( -/// angle = 80, +/// angle = 80deg, /// length = 15, /// ) /// |> line(end = [8, -10]) /// |> xLine(length = 10) /// |> angledLine( -/// angle = 120, +/// angle = 120deg, /// length = 30, /// ) /// |> xLine(length = -15) @@ -1576,7 +1576,7 @@ export fn xLine( /// |> startProfile(at = [0, 0]) /// |> yLine(length = 15) /// |> angledLine( -/// angle = 30, +/// angle = 30deg, /// length = 15, /// ) /// |> line(end = [8, -10]) @@ -1606,7 +1606,7 @@ export fn yLine( /// |> startProfile(at = [0, 0]) /// |> yLine(endAbsolute = 15) /// |> angledLine( -/// angle = 30, +/// angle = 30deg, /// length = 15, /// ) /// |> line(end = [8, -10]) @@ -1646,7 +1646,7 @@ export fn angledLine( /// |> line(endAbsolute = [-10, 10], tag = $lineToIntersect) /// |> line(endAbsolute = [0, 20]) /// |> angledLineThatIntersects( -/// angle = 80, +/// angle = 80deg, /// intersectTag = lineToIntersect, /// offset = 10, /// ) @@ -1719,7 +1719,7 @@ export fn close( /// |> line(end = [10, 0]) /// |> arc( /// angleStart = 0, -/// angleEnd = 280, +/// angleEnd = 280deg, /// radius = 16 /// ) /// |> close() @@ -1773,7 +1773,7 @@ export fn arc( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 45, +/// angle = 45deg, /// length = 10, /// ) /// |> tangentialArc(end = [0, -10]) @@ -1787,7 +1787,7 @@ export fn arc( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 60, +/// angle = 60deg, /// length = 10, /// ) /// |> tangentialArc(endAbsolute = [15, 15]) @@ -1801,12 +1801,12 @@ export fn arc( /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 60, +/// angle = 60deg, /// length = 10, /// ) -/// |> tangentialArc(radius = 10, angle = -120) +/// |> tangentialArc(radius = 10, angle = -120deg) /// |> angledLine( -/// angle = -60, +/// angle = -60deg, /// length = 10, /// ) /// |> close() diff --git a/rust/kcl-lib/std/solid.kcl b/rust/kcl-lib/std/solid.kcl index e75c41344..f433c5c31 100644 --- a/rust/kcl-lib/std/solid.kcl +++ b/rust/kcl-lib/std/solid.kcl @@ -402,7 +402,7 @@ export fn hollow( /// /// - `rotation.axis` (a 3D point, defaults to the Z axis) /// -/// - `rotation.angle` (number of degrees) +/// - `rotation.angle` /// /// - `rotation.origin` (either "local" i.e. rotate around its own center, "global" i.e. rotate around the scene's center, or a 3D point, defaults to "local") /// @@ -462,7 +462,7 @@ export fn hollow( /// scale = [pow(1.1, exp = i), pow(1.1, exp = i), pow(0.9, exp = i)], /// // Turn by 15 degrees each time. /// rotation = { -/// angle = 15 * i, +/// angle = 15deg * i, /// origin = "local", /// } /// } @@ -498,7 +498,7 @@ export fn hollow( /// return { /// translate = [0, 0, -i * width], /// rotation = { -/// angle = 90 * i, +/// angle = 90deg * i, /// // Rotate around the overall scene's origin. /// origin = "global", /// } @@ -539,7 +539,7 @@ export fn hollow( /// // Transform functions can return multiple transforms. They'll be applied in order. /// return [ /// { translate = [30 * i, 0, 0] }, -/// { rotation = { angle = 45 * i } }, +/// { rotation = { angle = 45deg * i } }, /// ] /// } /// startSketchOn(XY) @@ -943,7 +943,7 @@ export fn subtract( /// // Add color to a revolved solid. /// sketch001 = startSketchOn(XY) /// |> circle( center = [15, 0], radius = 5 ) -/// |> revolve( angle = 360, axis = Y) +/// |> revolve( angle = 360deg, axis = Y) /// |> appearance( /// color = '#ff0000', /// metalness = 90, @@ -1093,9 +1093,9 @@ export fn subtract( /// sweepPath = startSketchOn(XZ) /// |> startProfile(at = [0.05, 0.05]) /// |> line(end = [0, 7]) -/// |> tangentialArc(angle = 90, radius = 5) +/// |> tangentialArc(angle = 90deg, radius = 5) /// |> line(end = [-3, 0]) -/// |> tangentialArc(angle = -90, radius = 5) +/// |> tangentialArc(angle = -90deg, radius = 5) /// |> line(end = [0, 7]) /// /// pipeHole = startSketchOn(XY) diff --git a/rust/kcl-lib/std/transform.kcl b/rust/kcl-lib/std/transform.kcl index d42187ebd..95d0a8272 100644 --- a/rust/kcl-lib/std/transform.kcl +++ b/rust/kcl-lib/std/transform.kcl @@ -108,9 +108,9 @@ export fn mirror2d( /// sweepPath = startSketchOn(XZ) /// |> startProfile(at = [0.05, 0.05]) /// |> line(end = [0, 7]) -/// |> tangentialArc(angle = 90, radius = 5) +/// |> tangentialArc(angle = 90deg, radius = 5) /// |> line(end = [-3, 0]) -/// |> tangentialArc(angle = -90, radius = 5) +/// |> tangentialArc(angle = -90deg, radius = 5) /// |> line(end = [0, 7]) /// /// // Create a hole for the pipe. @@ -164,7 +164,7 @@ export fn mirror2d( /// rectangleSketch = startProfile(sketch001, at = [-200, 23.86]) /// |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001) /// |> angledLine( -/// angle = segAng(rectangleSegmentA001) - 90, +/// angle = segAng(rectangleSegmentA001) - 90deg, /// length = 50.61, /// ) /// |> angledLine( @@ -179,7 +179,7 @@ export fn mirror2d( /// sketch002 = startSketchOn(YZ) /// sweepPath = startProfile(sketch002, at = [0, 0]) /// |> yLine(length = 231.81) -/// |> tangentialArc(radius = 80, angle = -90) +/// |> tangentialArc(radius = 80, angle = -90deg) /// |> xLine(length = 384.93) /// /// parts = sweep([rectangleSketch, circleSketch], path = sweepPath) @@ -233,7 +233,7 @@ export fn mirror2d( /// /// profile002 = square() /// |> translate(z = 20) -/// |> rotate(axis = [0, 0, 1.0], angle = 45) +/// |> rotate(axis = [0, 0, 1.0], angle = 45deg) /// /// loft([profile001, profile002]) /// ``` @@ -290,9 +290,9 @@ export fn translate( /// sweepPath = startSketchOn(XZ) /// |> startProfile(at = [0.05, 0.05]) /// |> line(end = [0, 7]) -/// |> tangentialArc(angle = 90, radius = 5) +/// |> tangentialArc(angle = 90deg, radius = 5) /// |> line(end = [-3, 0]) -/// |> tangentialArc(angle = -90, radius = 5) +/// |> tangentialArc(angle = -90deg, radius = 5) /// |> line(end = [0, 7]) /// /// // Create a hole for the pipe. @@ -323,9 +323,9 @@ export fn translate( /// sweepPath = startSketchOn(XZ) /// |> startProfile(at = [0.05, 0.05]) /// |> line(end = [0, 7]) -/// |> tangentialArc(angle = 90, radius = 5) +/// |> tangentialArc(angle = 90deg, radius = 5) /// |> line(end = [-3, 0]) -/// |> tangentialArc(angle = -90, radius = 5) +/// |> tangentialArc(angle = -90deg, radius = 5) /// |> line(end = [0, 7]) /// /// // Create a hole for the pipe. @@ -354,9 +354,9 @@ export fn translate( /// sweepPath = startSketchOn(XZ) /// |> startProfile(at = [0.05, 0.05]) /// |> line(end = [0, 7]) -/// |> tangentialArc(angle = 90, radius = 5) +/// |> tangentialArc(angle = 90deg, radius = 5) /// |> line(end = [-3, 0]) -/// |> tangentialArc(angle = -90, radius = 5) +/// |> tangentialArc(angle = -90deg, radius = 5) /// |> line(end = [0, 7]) /// /// // Create a hole for the pipe. @@ -375,7 +375,7 @@ export fn translate( /// |> sweep(path = sweepPath) /// |> rotate( /// axis = Z, -/// angle = 90, +/// angle = 90deg, /// ) /// ``` /// @@ -387,7 +387,7 @@ export fn translate( /// cube /// |> rotate( /// axis = [0, 0, 1.0], -/// angle = 9, +/// angle = 9deg, /// ) /// ``` /// @@ -398,9 +398,9 @@ export fn translate( /// sweepPath = startSketchOn(XZ) /// |> startProfile(at = [0.05, 0.05]) /// |> line(end = [0, 7]) -/// |> tangentialArc(angle = 90, radius = 5) +/// |> tangentialArc(angle = 90deg, radius = 5) /// |> line(end = [-3, 0]) -/// |> tangentialArc(angle = -90, radius = 5) +/// |> tangentialArc(angle = -90deg, radius = 5) /// |> line(end = [0, 7]) /// /// // Create a hole for the pipe. @@ -419,7 +419,7 @@ export fn translate( /// |> sweep(path = sweepPath) /// |> rotate( /// axis = [0, 0, 1.0], -/// angle = 90, +/// angle = 90deg, /// ) /// ``` /// @@ -445,13 +445,13 @@ export fn translate( /// sketch002 = startSketchOn(YZ) /// sweepPath = startProfile(sketch002, at = [0, 0]) /// |> yLine(length = 231.81) -/// |> tangentialArc(radius = 80, angle = -90) +/// |> tangentialArc(radius = 80, angle = -90deg) /// |> xLine(length = 384.93) /// /// parts = sweep([rectangleSketch, circleSketch], path = sweepPath) /// /// // Rotate the sweeps. -/// rotate(parts, axis = [0, 0, 1.0], angle = 90) +/// rotate(parts, axis = [0, 0, 1.0], angle = 90deg) /// ``` /// /// ```kcl @@ -471,7 +471,7 @@ export fn translate( /// /// profile002 = square() /// |> translate(x = 0, y = 0, z = 20) -/// |> rotate(axis = [0, 0, 1.0], angle = 45) +/// |> rotate(axis = [0, 0, 1.0], angle = 45deg) /// /// loft([profile001, profile002]) /// ``` @@ -518,9 +518,9 @@ export fn rotate( /// sweepPath = startSketchOn(XZ) /// |> startProfile(at = [0.05, 0.05]) /// |> line(end = [0, 7]) -/// |> tangentialArc(angle = 90, radius = 5) +/// |> tangentialArc(angle = 90deg, radius = 5) /// |> line(end = [-3, 0]) -/// |> tangentialArc(angle = -90, radius = 5) +/// |> tangentialArc(angle = -90deg, radius = 5) /// |> line(end = [0, 7]) /// /// // Create a hole for the pipe. @@ -560,7 +560,7 @@ export fn rotate( /// rectangleSketch = startProfile(sketch001, at = [-200, 23.86]) /// |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001) /// |> angledLine( -/// angle = segAng(rectangleSegmentA001) - 90, +/// angle = segAng(rectangleSegmentA001) - 90deg, /// length = 50.61, /// ) /// |> angledLine( @@ -575,7 +575,7 @@ export fn rotate( /// sketch002 = startSketchOn(YZ) /// sweepPath = startProfile(sketch002, at = [0, 0]) /// |> yLine(length = 231.81) -/// |> tangentialArc(radius = 80, angle = -90) +/// |> tangentialArc(radius = 80, angle = -90deg) /// |> xLine(length = 384.93) /// /// parts = sweep([rectangleSketch, circleSketch], path = sweepPath) diff --git a/rust/kcl-lib/std/turns.kcl b/rust/kcl-lib/std/turns.kcl index e32776a59..2b8ecfc0b 100644 --- a/rust/kcl-lib/std/turns.kcl +++ b/rust/kcl-lib/std/turns.kcl @@ -4,7 +4,7 @@ @settings(defaultLengthUnit = mm, kclVersion = 1.0) /// No turn, zero degrees/radians. -export ZERO = 0 +export ZERO = 0: number(Angle) /// A quarter turn, 90 degrees or π/2 radians. export QUARTER_TURN = 90deg diff --git a/rust/kcl-lib/std/types.kcl b/rust/kcl-lib/std/types.kcl index 3a3ea736c..9c474660b 100644 --- a/rust/kcl-lib/std/types.kcl +++ b/rust/kcl-lib/std/types.kcl @@ -73,7 +73,7 @@ export type string /// |> startProfile(at = origin) /// |> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001) /// |> angledLine( -/// angle = segAng(rectangleSegmentA001) - 90, +/// angle = segAng(rectangleSegmentA001) - 90deg, /// length = 196.99, /// tag = $rectangleSegmentB001, /// ) @@ -136,7 +136,7 @@ export type string /// |> startProfile(at = origin) /// |> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001) /// |> angledLine( -/// angle = segAng(rectangleSegmentA001) - 90, +/// angle = segAng(rectangleSegmentA001) - 90deg, /// length = 196.99 /// tag = $rectangleSegmentB001, /// ) diff --git a/rust/kcl-lib/std/units.kcl b/rust/kcl-lib/std/units.kcl index 9c204ce4c..9237b26dc 100644 --- a/rust/kcl-lib/std/units.kcl +++ b/rust/kcl-lib/std/units.kcl @@ -46,8 +46,8 @@ export fn toYards(@num: number(Length)): number(yd) { /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 50, -/// length = 70 * cos(units::toRadians(45)), +/// angle = 50deg, +/// length = 70 * cos(units::toRadians(45deg)), /// ) /// |> yLine(endAbsolute = 0) /// |> close() @@ -64,7 +64,7 @@ export fn toRadians(@num: number(Angle)): number(rad) { /// exampleSketch = startSketchOn(XZ) /// |> startProfile(at = [0, 0]) /// |> angledLine( -/// angle = 50, +/// angle = 50deg, /// length = 70 * cos(units::toDegrees((PI/4): number(rad))), /// ) /// |> yLine(endAbsolute = 0)