Skip to content

Commit

Permalink
Rename args: end and endAbsolute
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchalmers committed Dec 17, 2024
1 parent e99f814 commit 4e8305d
Show file tree
Hide file tree
Showing 196 changed files with 36,785 additions and 36,769 deletions.
6 changes: 3 additions & 3 deletions src/wasm-lib/kcl/common.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export fn buildSketch = (plane, offset) => {
h = height()
return startSketchOn(plane)
|> startProfileAt(offset, %)
|> line(to = [w, 0])
|> line(to = [0, h])
|> line(to = [-w, 0])
|> line(end = [w, 0])
|> line(end = [0, h])
|> line(end = [-w, 0])
|> close()
}
48 changes: 24 additions & 24 deletions src/wasm-lib/kcl/src/std/appearance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // Add color to an extruded solid.
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line(end = [10, 0])
/// |> line(end = [0, 10])
/// |> line(end = [-10, 0])
/// |> line(endAbsolute = [10, 0])
/// |> line(endAbsolute = [0, 10])
/// |> line(endAbsolute = [-10, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
Expand All @@ -94,9 +94,9 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// fn cube(center) {
/// return startSketchOn('XY')
/// |> startProfileAt([center[0] - 10, center[1] - 10], %)
/// |> line(end = [center[0] + 10, center[1] - 10])
/// |> line(end = [center[0] + 10, center[1] + 10])
/// |> line(end = [center[0] - 10, center[1] + 10])
/// |> line(endAbsolute = [center[0] + 10, center[1] - 10])
/// |> line(endAbsolute = [center[0] + 10, center[1] + 10])
/// |> line(endAbsolute = [center[0] - 10, center[1] + 10])
/// |> close()
/// |> extrude(length = 10)
/// }
Expand All @@ -114,9 +114,9 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // This example shows setting the appearance _after_ the shell.
/// firstSketch = startSketchOn('XY')
/// |> startProfileAt([-12, 12], %)
/// |> line(to = [24, 0])
/// |> line(to = [0, -24])
/// |> line(to = [-24, 0])
/// |> line(end = [24, 0])
/// |> line(end = [0, -24])
/// |> line(end = [-24, 0])
/// |> close()
/// |> extrude(length = 6)
///
Expand All @@ -136,9 +136,9 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // This example shows setting the appearance _before_ the shell.
/// firstSketch = startSketchOn('XY')
/// |> startProfileAt([-12, 12], %)
/// |> line(to = [24, 0])
/// |> line(to = [0, -24])
/// |> line(to = [-24, 0])
/// |> line(end = [24, 0])
/// |> line(end = [0, -24])
/// |> line(end = [-24, 0])
/// |> close()
/// |> extrude(length = 6)
/// |> appearance({
Expand All @@ -158,9 +158,9 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // This example shows _before_ the pattern.
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line(to = [0, 2])
/// |> line(to = [3, 1])
/// |> line(to = [0, -4])
/// |> line(end = [0, 2])
/// |> line(end = [3, 1])
/// |> line(end = [0, -4])
/// |> close()
///
/// example = extrude(exampleSketch, length = 1)
Expand All @@ -181,9 +181,9 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // This example shows _after_ the pattern.
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line(to = [0, 2])
/// |> line(to = [3, 1])
/// |> line(to = [0, -4])
/// |> line(end = [0, 2])
/// |> line(end = [3, 1])
/// |> line(end = [0, -4])
/// |> close()
///
/// example = extrude(exampleSketch, length = 1)
Expand All @@ -203,9 +203,9 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // Color the result of a 2D pattern that was extruded.
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([.5, 25], %)
/// |> line(to = [0, 5])
/// |> line(to = [-1, 0])
/// |> line(to = [0, -5])
/// |> line(end = [0, 5])
/// |> line(end = [-1, 0])
/// |> line(end = [0, -5])
/// |> close()
/// |> patternCircular2d({
/// center = [0, 0],
Expand All @@ -228,17 +228,17 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// // Create a path for the sweep.
/// sweepPath = startSketchOn('XZ')
/// |> startProfileAt([0.05, 0.05], %)
/// |> line(to = [0, 7])
/// |> line(end = [0, 7])
/// |> tangentialArc({
/// offset: 90,
/// radius: 5
/// }, %)
/// |> line(to = [-3, 0])
/// |> line(end = [-3, 0])
/// |> tangentialArc({
/// offset: -90,
/// radius: 5
/// }, %)
/// |> line(to = [0, 7])
/// |> line(end = [0, 7])
///
/// pipeHole = startSketchOn('XY')
/// |> circle({
Expand Down
20 changes: 10 additions & 10 deletions src/wasm-lib/kcl/src/std/chamfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
///
/// mountingPlateSketch = startSketchOn("XY")
/// |> startProfileAt([-width/2, -length/2], %)
/// |> line(end = [width/2, -length/2], tag = $edge1)
/// |> line(end = [width/2, length/2], tag = $edge2)
/// |> line(end = [-width/2, length/2], tag = $edge3)
/// |> line(endAbsolute = [width/2, -length/2], tag = $edge1)
/// |> line(endAbsolute = [width/2, length/2], tag = $edge2)
/// |> line(endAbsolute = [-width/2, length/2], tag = $edge3)
/// |> close(tag = $edge4)
///
/// mountingPlate = extrude(mountingPlateSketch, length = thickness)
Expand All @@ -72,9 +72,9 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// fn cube(pos, scale) {
/// sg = startSketchOn('XY')
/// |> startProfileAt(pos, %)
/// |> line(to = [0, scale])
/// |> line(to = [scale, 0])
/// |> line(to = [0, -scale])
/// |> line(end = [0, scale])
/// |> line(end = [scale, 0])
/// |> line(end = [0, -scale])
///
/// return sg
/// }
Expand All @@ -89,10 +89,10 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
///
/// sketch001 = startSketchOn(part001, chamfer1)
/// |> startProfileAt([10, 10], %)
/// |> line(to = [2, 0])
/// |> line(to = [0, 2])
/// |> line(to = [-2, 0])
/// |> line(end = [profileStartX(%), profileStartY(%)])
/// |> line(end = [2, 0])
/// |> line(end = [0, 2])
/// |> line(end = [-2, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
/// |> extrude(length = 10)
/// ```
Expand Down
16 changes: 8 additions & 8 deletions src/wasm-lib/kcl/src/std/extrude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ pub async fn extrude(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// ```no_run
/// example = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line(to = [10, 0])
/// |> line(end = [10, 0])
/// |> arc({
/// angleStart = 120,
/// angleEnd = 0,
/// radius = 5,
/// }, %)
/// |> line(to = [5, 0])
/// |> line(to = [0, 10])
/// |> line(end = [5, 0])
/// |> line(end = [0, 10])
/// |> bezierCurve({
/// control1 = [-10, 0],
/// control2 = [2, 10],
/// to = [-5, 10],
/// }, %)
/// |> line(to = [-5, -2])
/// |> line(end = [-5, -2])
/// |> close()
/// |> extrude(length = 10)
/// ```
Expand All @@ -62,15 +62,15 @@ pub async fn extrude(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// angleEnd = -60,
/// radius = 5,
/// }, %)
/// |> line(to = [10, 0])
/// |> line(to = [5, 0])
/// |> line(end = [10, 0])
/// |> line(end = [5, 0])
/// |> bezierCurve({
/// control1 = [-3, 0],
/// control2 = [2, 10],
/// to = [-5, 10],
/// }, %)
/// |> line(to = [-4, 10])
/// |> line(to = [-5, -2])
/// |> line(end = [-4, 10])
/// |> line(end = [-5, -2])
/// |> close()
///
/// example = extrude(exampleSketch, length = 10)
Expand Down
24 changes: 12 additions & 12 deletions src/wasm-lib/kcl/src/std/fillet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
///
/// mountingPlateSketch = startSketchOn("XY")
/// |> startProfileAt([-width/2, -length/2], %)
/// |> line(end = [width/2, -length/2], tag = $edge1)
/// |> line(end = [width/2, length/2], tag = $edge2)
/// |> line(end = [-width/2, length/2], tag = $edge3)
/// |> line(endAbsolute = [width/2, -length/2], tag = $edge1)
/// |> line(endAbsolute = [width/2, length/2], tag = $edge2)
/// |> line(endAbsolute = [-width/2, length/2], tag = $edge3)
/// |> close(tag = $edge4)
///
/// mountingPlate = extrude(mountingPlateSketch, length = thickness)
Expand All @@ -100,9 +100,9 @@ pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
///
/// mountingPlateSketch = startSketchOn("XY")
/// |> startProfileAt([-width/2, -length/2], %)
/// |> line(end = [width/2, -length/2], tag = $edge1)
/// |> line(end = [width/2, length/2], tag = $edge2)
/// |> line(end = [-width/2, length/2], tag = $edge3)
/// |> line(endAbsolute = [width/2, -length/2], tag = $edge1)
/// |> line(endAbsolute = [width/2, length/2], tag = $edge2)
/// |> line(endAbsolute = [-width/2, length/2], tag = $edge3)
/// |> close(tag = $edge4)
///
/// mountingPlate = extrude(mountingPlateSketch, length = thickness)
Expand Down Expand Up @@ -198,7 +198,7 @@ pub async fn get_opposite_edge(exec_state: &mut ExecState, args: Args) -> Result
/// ```no_run
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line(to = [10, 0])
/// |> line(end = [10, 0])
/// |> angledLine({
/// angle = 60,
/// length = 10,
Expand All @@ -207,7 +207,7 @@ pub async fn get_opposite_edge(exec_state: &mut ExecState, args: Args) -> Result
/// angle = 120,
/// length = 10,
/// }, %)
/// |> line(to = [-10, 0])
/// |> line(end = [-10, 0])
/// |> angledLine({
/// angle = 240,
/// length = 10,
Expand Down Expand Up @@ -271,7 +271,7 @@ pub async fn get_next_adjacent_edge(exec_state: &mut ExecState, args: Args) -> R
/// ```no_run
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line(to = [10, 0])
/// |> line(end = [10, 0])
/// |> angledLine({
/// angle = 60,
/// length = 10,
Expand All @@ -280,7 +280,7 @@ pub async fn get_next_adjacent_edge(exec_state: &mut ExecState, args: Args) -> R
/// angle = 120,
/// length = 10,
/// }, %)
/// |> line(to = [-10, 0])
/// |> line(end = [-10, 0])
/// |> angledLine({
/// angle = 240,
/// length = 10,
Expand Down Expand Up @@ -356,7 +356,7 @@ pub async fn get_previous_adjacent_edge(exec_state: &mut ExecState, args: Args)
/// ```no_run
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line(to = [10, 0])
/// |> line(end = [10, 0])
/// |> angledLine({
/// angle = 60,
/// length = 10,
Expand All @@ -365,7 +365,7 @@ pub async fn get_previous_adjacent_edge(exec_state: &mut ExecState, args: Args)
/// angle = 120,
/// length = 10,
/// }, %)
/// |> line(to = [-10, 0])
/// |> line(end = [-10, 0])
/// |> angledLine({
/// angle = 240,
/// length = 10,
Expand Down
30 changes: 15 additions & 15 deletions src/wasm-lib/kcl/src/std/loft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// // Loft a square and a triangle.
/// squareSketch = startSketchOn('XY')
/// |> startProfileAt([-100, 200], %)
/// |> line(to = [200, 0])
/// |> line(to = [0, -200])
/// |> line(to = [-200, 0])
/// |> line(end = [profileStartX(%), profileStartY(%)])
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// triangleSketch = startSketchOn(offsetPlane('XY', 75))
/// |> startProfileAt([0, 125], %)
/// |> line(to = [-15, -30])
/// |> line(to = [30, 0])
/// |> line(end = [profileStartX(%), profileStartY(%)])
/// |> line(end = [-15, -30])
/// |> line(end = [30, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// loft([squareSketch, triangleSketch])
Expand All @@ -71,10 +71,10 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// // Loft a square, a circle, and another circle.
/// squareSketch = startSketchOn('XY')
/// |> startProfileAt([-100, 200], %)
/// |> line(to = [200, 0])
/// |> line(to = [0, -200])
/// |> line(to = [-200, 0])
/// |> line(end = [profileStartX(%), profileStartY(%)])
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch0 = startSketchOn(offsetPlane('XY', 75))
Expand All @@ -90,10 +90,10 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// // Loft a square, a circle, and another circle with options.
/// squareSketch = startSketchOn('XY')
/// |> startProfileAt([-100, 200], %)
/// |> line(to = [200, 0])
/// |> line(to = [0, -200])
/// |> line(to = [-200, 0])
/// |> line(end = [profileStartX(%), profileStartY(%)])
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch0 = startSketchOn(offsetPlane('XY', 75))
Expand Down
Loading

0 comments on commit 4e8305d

Please sign in to comment.