Skip to content

Commit

Permalink
Support = in record initialisation
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Cameron <[email protected]>
  • Loading branch information
nrc committed Nov 24, 2024
1 parent f760a77 commit dcfff56
Show file tree
Hide file tree
Showing 163 changed files with 5,953 additions and 5,886 deletions.
4 changes: 2 additions & 2 deletions docs/kcl/abs.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ myAngle = -120
sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([8, 0], %)
|> angledLine({ angle: abs(myAngle), length: 5 }, %)
|> angledLine({ angle = abs(myAngle), length = 5 }, %)
|> line([-5, 0], %)
|> angledLine({ angle: myAngle, length: 5 }, %)
|> angledLine({ angle = myAngle, length = 5 }, %)
|> close(%)

baseExtrusion = extrude(5, sketch001)
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/acos.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ acos(num: number) -> number
sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLine({
angle: toDegrees(acos(0.5)),
length: 10
angle = toDegrees(acos(0.5)),
length = 10
}, %)
|> line([5, 0], %)
|> lineTo([12, 0], %)
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/angleToMatchLengthY.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([1, 2], %, $seg01)
|> angledLine({
angle: angleToMatchLengthY(seg01, 15, %),
length: 5
angle = angleToMatchLengthY(seg01, 15, %),
length = 5
}, %)
|> yLineTo(0, %)
|> close(%)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/angledLine.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ angledLine(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> yLineTo(15, %)
|> angledLine({ angle: 30, length: 15 }, %)
|> angledLine({ angle = 30, length = 15 }, %)
|> line([8, -10], %)
|> yLineTo(0, %)
|> close(%)
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/angledLineOfXLength.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ angledLineOfXLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -
```js
sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLineOfXLength({ angle: 45, length: 10 }, %, $edge1)
|> angledLineOfXLength({ angle: -15, length: 20 }, %, $edge2)
|> angledLineOfXLength({ angle = 45, length = 10 }, %, $edge1)
|> angledLineOfXLength({ angle = -15, length = 20 }, %, $edge2)
|> line([0, -5], %)
|> close(%, $edge3)

Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/angledLineOfYLength.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ angledLineOfYLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> angledLineOfYLength({ angle: 45, length: 10 }, %)
|> angledLineOfYLength({ angle = 45, length = 10 }, %)
|> line([0, 10], %)
|> angledLineOfYLength({ angle: 135, length: 10 }, %)
|> angledLineOfYLength({ angle = 135, length = 10 }, %)
|> line([-10, 0], %)
|> line([0, -30], %)

Expand Down
6 changes: 3 additions & 3 deletions docs/kcl/angledLineThatIntersects.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ exampleSketch = startSketchOn('XZ')
|> lineTo([-10, 10], %, $lineToIntersect)
|> lineTo([0, 20], %)
|> angledLineThatIntersects({
angle: 80,
intersectTag: lineToIntersect,
offset: 10
angle = 80,
intersectTag = lineToIntersect,
offset = 10
}, %)
|> close(%)

Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/angledLineToX.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sk
```js
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLineToX({ angle: 30, to: 10 }, %)
|> angledLineToX({ angle = 30, to = 10 }, %)
|> line([0, 10], %)
|> line([-10, 0], %)
|> close(%)
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/angledLineToY.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ angledLineToY(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sk
```js
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLineToY({ angle: 60, to: 20 }, %)
|> angledLineToY({ angle = 60, to = 20 }, %)
|> line([-20, 0], %)
|> angledLineToY({ angle: 70, to: 10 }, %)
|> angledLineToY({ angle = 70, to = 10 }, %)
|> close(%)

example = extrude(10, exampleSketch)
Expand Down
6 changes: 3 additions & 3 deletions docs/kcl/arc.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> arc({
angleStart: 0,
angleEnd: 280,
radius: 16
angleStart = 0,
angleEnd = 280,
radius = 16
}, %)
|> close(%)
example = extrude(10, exampleSketch)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/arcTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ arcTo(data: ArcToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
```js
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> arcTo({ end: [10, 0], interior: [5, 5] }, %)
|> arcTo({ end = [10, 0], interior = [5, 5] }, %)
|> close(%)
example = extrude(10, exampleSketch)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/asin.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ asin(num: number) -> number
sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLine({
angle: toDegrees(asin(0.5)),
length: 20
angle = toDegrees(asin(0.5)),
length = 20
}, %)
|> yLineTo(0, %)
|> close(%)
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/atan.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ atan(num: number) -> number
sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLine({
angle: toDegrees(atan(1.25)),
length: 20
angle = toDegrees(atan(1.25)),
length = 20
}, %)
|> yLineTo(0, %)
|> close(%)
Expand Down
6 changes: 3 additions & 3 deletions docs/kcl/bezierCurve.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([0, 10], %)
|> bezierCurve({
to: [10, 10],
control1: [5, 0],
control2: [5, 10]
to = [10, 10],
control1 = [5, 0],
control2 = [5, 10]
}, %)
|> lineTo([10, 0], %)
|> close(%)
Expand Down
8 changes: 4 additions & 4 deletions docs/kcl/chamfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ mountingPlateSketch = startSketchOn("XY")

mountingPlate = extrude(thickness, mountingPlateSketch)
|> chamfer({
length: chamferLength,
tags: [
length = chamferLength,
tags = [
getNextAdjacentEdge(edge1),
getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3),
Expand All @@ -72,8 +72,8 @@ part001 = cube([0, 0], 20)
|> close(%, $line1)
|> extrude(20, %)
|> chamfer({
length: 10,
tags: [getOppositeEdge(line1)]
length = 10,
tags = [getOppositeEdge(line1)]
}, %, $chamfer1) // We tag the chamfer to reference it later.

sketch001 = startSketchOn(part001, chamfer1)
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/circle.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ circle(data: CircleData, sketch_surface_or_group: SketchOrSurface, tag?: TagDecl

```js
exampleSketch = startSketchOn("-XZ")
|> circle({ center: [0, 0], radius: 10 }, %)
|> circle({ center = [0, 0], radius = 10 }, %)

example = extrude(5, exampleSketch)
```
Expand All @@ -44,7 +44,7 @@ exampleSketch = startSketchOn("XZ")
|> line([0, 30], %)
|> line([-30, 0], %)
|> close(%)
|> hole(circle({ center: [0, 15], radius: 5 }, %), %)
|> hole(circle({ center = [0, 15], radius = 5 }, %), %)

example = extrude(5, exampleSketch)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/cos.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ cos(num: number) -> number
exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %)
|> angledLine({
angle: 30,
length: 3 / cos(toRadians(30))
angle = 30,
length = 3 / cos(toRadians(30))
}, %)
|> yLineTo(0, %)
|> close(%)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/e.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ e() -> number
```js
exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %)
|> angledLine({ angle: 30, length: 2 * e() ^ 2 }, %)
|> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %)
|> yLineTo(0, %)
|> close(%)

Expand Down
24 changes: 12 additions & 12 deletions docs/kcl/extrude.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ example = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> arc({
angleStart: 120,
angleEnd: 0,
radius: 5
angleStart = 120,
angleEnd = 0,
radius = 5
}, %)
|> line([5, 0], %)
|> line([0, 10], %)
|> bezierCurve({
control1: [-10, 0],
control2: [2, 10],
to: [-5, 10]
control1 = [-10, 0],
control2 = [2, 10],
to = [-5, 10]
}, %)
|> line([-5, -2], %)
|> close(%)
Expand All @@ -54,16 +54,16 @@ example = startSketchOn('XZ')
exampleSketch = startSketchOn('XZ')
|> startProfileAt([-10, 0], %)
|> arc({
angleStart: 120,
angleEnd: -60,
radius: 5
angleStart = 120,
angleEnd = -60,
radius = 5
}, %)
|> line([10, 0], %)
|> line([5, 0], %)
|> bezierCurve({
control1: [-3, 0],
control2: [2, 10],
to: [-5, 10]
control1 = [-3, 0],
control2 = [2, 10],
to = [-5, 10]
}, %)
|> line([-4, 10], %)
|> line([-5, -2], %)
Expand Down
10 changes: 5 additions & 5 deletions docs/kcl/fillet.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ mountingPlateSketch = startSketchOn("XY")

mountingPlate = extrude(thickness, mountingPlateSketch)
|> fillet({
radius: filletRadius,
tags: [
radius = filletRadius,
tags = [
getNextAdjacentEdge(edge1),
getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3),
Expand All @@ -70,9 +70,9 @@ mountingPlateSketch = startSketchOn("XY")

mountingPlate = extrude(thickness, mountingPlateSketch)
|> fillet({
radius: filletRadius,
tolerance: 0.000001,
tags: [
radius = filletRadius,
tolerance = 0.000001,
tags = [
getNextAdjacentEdge(edge1),
getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3),
Expand Down
10 changes: 5 additions & 5 deletions docs/kcl/getNextAdjacentEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ getNextAdjacentEdge(tag: TagIdentifier) -> Uuid
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %)
|> angledLine({ angle = 60, length = 10 }, %)
|> angledLine({ angle = 120, length = 10 }, %)
|> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|> close(%)

example = extrude(5, exampleSketch)
|> fillet({
radius: 3,
tags: [getNextAdjacentEdge(referenceEdge)]
radius = 3,
tags = [getNextAdjacentEdge(referenceEdge)]
}, %)
```

Expand Down
10 changes: 5 additions & 5 deletions docs/kcl/getOppositeEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ getOppositeEdge(tag: TagIdentifier) -> Uuid
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %)
|> angledLine({ angle = 60, length = 10 }, %)
|> angledLine({ angle = 120, length = 10 }, %)
|> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|> close(%)

example = extrude(5, exampleSketch)
|> fillet({
radius: 3,
tags: [getOppositeEdge(referenceEdge)]
radius = 3,
tags = [getOppositeEdge(referenceEdge)]
}, %)
```

Expand Down
10 changes: 5 additions & 5 deletions docs/kcl/getPreviousAdjacentEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ getPreviousAdjacentEdge(tag: TagIdentifier) -> Uuid
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %)
|> angledLine({ angle = 60, length = 10 }, %)
|> angledLine({ angle = 120, length = 10 }, %)
|> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|> close(%)

example = extrude(5, exampleSketch)
|> fillet({
radius: 3,
tags: [getPreviousAdjacentEdge(referenceEdge)]
radius = 3,
tags = [getPreviousAdjacentEdge(referenceEdge)]
}, %)
```

Expand Down
8 changes: 4 additions & 4 deletions docs/kcl/helix.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ helix(data: HelixData, solid: Solid) -> Solid

```js
part001 = startSketchOn('XY')
|> circle({ center: [5, 5], radius: 10 }, %)
|> circle({ center = [5, 5], radius = 10 }, %)
|> extrude(10, %)
|> helix({
angleStart: 0,
ccw: true,
revolutions: 16
angleStart = 0,
ccw = true,
revolutions = 16
}, %)
```

Expand Down
6 changes: 3 additions & 3 deletions docs/kcl/hole.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ exampleSketch = startSketchOn('XY')
|> line([5, 0], %)
|> line([0, -5], %)
|> close(%)
|> hole(circle({ center: [1, 1], radius: .25 }, %), %)
|> hole(circle({ center: [1, 4], radius: .25 }, %), %)
|> hole(circle({ center = [1, 1], radius = .25 }, %), %)
|> hole(circle({ center = [1, 4], radius = .25 }, %), %)

example = extrude(1, exampleSketch)
```
Expand All @@ -54,7 +54,7 @@ fn squareHoleSketch = () => {
}

exampleSketch = startSketchOn('-XZ')
|> circle({ center: [0, 0], radius: 3 }, %)
|> circle({ center = [0, 0], radius = 3 }, %)
|> hole(squareHoleSketch(), %)
example = extrude(1, exampleSketch)
```
Expand Down
Loading

0 comments on commit dcfff56

Please sign in to comment.