Skip to content

Commit

Permalink
Update KCL docs (#259)
Browse files Browse the repository at this point in the history
YOYO NEW KCL DOCS!!

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 0c3c652 commit 0940ef3
Show file tree
Hide file tree
Showing 113 changed files with 1,833 additions and 292 deletions.
6 changes: 3 additions & 3 deletions content/pages/docs/kcl/abs.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/acos.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/angleToMatchLengthX.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/angleToMatchLengthY.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/angledLine.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/angledLineOfXLength.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/angledLineOfYLength.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/angledLineThatIntersects.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/angledLineToX.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/angledLineToY.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/pages/docs/kcl/arc.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ arc(data: ArcData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
### Examples

```js
const exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> arc({
Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/asin.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/pages/docs/kcl/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ assert(data: bool, message: string) -> ()
### Examples

```js
const myVar = true
myVar = true
assert(myVar, "should always be true")
```

Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/assertEqual.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ assertEqual(left: number, right: number, epsilon: number, message: string) -> ()
### Examples

```js
let n = 1.0285
let o = 1.0286
n = 1.0285
o = 1.0286
assertEqual(n, o, 0.01, "n is within the given tolerance for o")
```

Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/atan.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/bezierCurve.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/ceil.md

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions content/pages/docs/kcl/chamfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ chamfer(data: ChamferData, solid: Solid, tag?: TagDeclarator) -> Solid

```js
// Chamfer a mounting plate.
const width = 20
const length = 10
const thickness = 1
const chamferLength = 2
width = 20
length = 10
thickness = 1
chamferLength = 2

const mountingPlateSketch = startSketchOn("XY")
mountingPlateSketch = startSketchOn("XY")
|> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %, $edge1)
|> lineTo([width / 2, length / 2], %, $edge2)
|> lineTo([-width / 2, length / 2], %, $edge3)
|> close(%, $edge4)

const mountingPlate = extrude(thickness, mountingPlateSketch)
mountingPlate = extrude(thickness, mountingPlateSketch)
|> chamfer({
length: chamferLength,
tags: [
Expand All @@ -59,7 +59,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
```js
// Sketch on the face of a chamfer.
fn cube = (pos, scale) => {
const sg = startSketchOn('XY')
sg = startSketchOn('XY')
|> startProfileAt(pos, %)
|> line([0, scale], %)
|> line([scale, 0], %)
Expand All @@ -68,15 +68,15 @@ fn cube = (pos, scale) => {
return sg
}

const part001 = cube([0, 0], 20)
part001 = cube([0, 0], 20)
|> close(%, $line1)
|> extrude(20, %)
|> chamfer({
length: 10,
tags: [getOppositeEdge(line1)]
}, %, $chamfer1) // We tag the chamfer to reference it later.

const sketch001 = startSketchOn(part001, chamfer1)
sketch001 = startSketchOn(part001, chamfer1)
|> startProfileAt([10, 10], %)
|> line([2, 0], %)
|> line([0, 2], %)
Expand Down
8 changes: 4 additions & 4 deletions content/pages/docs/kcl/circle.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/close.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/pages/docs/kcl/cm.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/cos.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/e.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions content/pages/docs/kcl/extrude.md

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions content/pages/docs/kcl/fillet.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/floor.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/pages/docs/kcl/ft.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/getNextAdjacentEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ getNextAdjacentEdge(tag: TagIdentifier) -> Uuid
### Examples

```js
const exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> angledLine({ angle: 60, length: 10 }, %)
Expand All @@ -36,7 +36,7 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|> close(%)

const example = extrude(5, exampleSketch)
example = extrude(5, exampleSketch)
|> fillet({
radius: 3,
tags: [getNextAdjacentEdge(referenceEdge)]
Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/getOppositeEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ getOppositeEdge(tag: TagIdentifier) -> Uuid
### Examples

```js
const exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> angledLine({ angle: 60, length: 10 }, %)
Expand All @@ -36,7 +36,7 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|> close(%)

const example = extrude(5, exampleSketch)
example = extrude(5, exampleSketch)
|> fillet({
radius: 3,
tags: [getOppositeEdge(referenceEdge)]
Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/getPreviousAdjacentEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ getPreviousAdjacentEdge(tag: TagIdentifier) -> Uuid
### Examples

```js
const exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> angledLine({ angle: 60, length: 10 }, %)
Expand All @@ -36,7 +36,7 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|> close(%)

const example = extrude(5, exampleSketch)
example = extrude(5, exampleSketch)
|> fillet({
radius: 3,
tags: [getPreviousAdjacentEdge(referenceEdge)]
Expand Down
2 changes: 1 addition & 1 deletion content/pages/docs/kcl/helix.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ helix(data: HelixData, solid: Solid) -> Solid
### Examples

```js
const part001 = startSketchOn('XY')
part001 = startSketchOn('XY')
|> circle({ center: [5, 5], radius: 10 }, %)
|> extrude(10, %)
|> helix({
Expand Down
10 changes: 5 additions & 5 deletions content/pages/docs/kcl/hole.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions content/pages/docs/kcl/hollow.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ hollow(thickness: number, solid: Solid) -> Solid

```js
// Hollow a basic sketch.
const firstSketch = startSketchOn('XY')
firstSketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line([24, 0], %)
|> line([0, -24], %)
Expand All @@ -43,7 +43,7 @@ const firstSketch = startSketchOn('XY')

```js
// Hollow a basic sketch.
const firstSketch = startSketchOn('-XZ')
firstSketch = startSketchOn('-XZ')
|> startProfileAt([-12, 12], %)
|> line([24, 0], %)
|> line([0, -24], %)
Expand All @@ -57,23 +57,23 @@ const firstSketch = startSketchOn('-XZ')

```js
// Hollow a sketch on face object.
let size = 100
const case = startSketchOn('-XZ')
size = 100
case = startSketchOn('-XZ')
|> startProfileAt([-size, -size], %)
|> line([2 * size, 0], %)
|> line([0, 2 * size], %)
|> tangentialArcTo([-size, size], %)
|> close(%)
|> extrude(65, %)

const thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, 'end')
|> circle({
center: [-size / 2, -size / 2],
radius: 25
}, %)
|> extrude(50, %)

const thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, 'end')
|> circle({
center: [size / 2, -size / 2],
radius: 25
Expand Down
10 changes: 5 additions & 5 deletions content/pages/docs/kcl/import.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/pages/docs/kcl/inch.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions content/pages/docs/kcl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ layout: manual
* [`log10`](kcl/log10)
* [`log2`](kcl/log2)
* [`m`](kcl/m)
* [`map`](kcl/map)
* [`max`](kcl/max)
* [`min`](kcl/min)
* [`mirror2d`](kcl/mirror2d)
Expand Down
2 changes: 1 addition & 1 deletion content/pages/docs/kcl/int.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int(num: number) -> i64
### Examples

```js
let n = int(ceil(5 / 2))
n = int(ceil(5 / 2))
assertEqual(n, 3, 0.0001, "5/2 = 2.5, rounded up makes 3")
// Draw n cylinders.
startSketchOn('XZ')
Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/lastSegX.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/lastSegY.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions content/pages/docs/kcl/line.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/lineTo.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/ln.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions content/pages/docs/kcl/loft.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ loft(sketches: [Sketch], data?: LoftData) -> Solid

```js
// Loft a square and a triangle.
const squareSketch = startSketchOn('XY')
squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)

const triangleSketch = startSketchOn(offsetPlane('XY', 75))
triangleSketch = startSketchOn(offsetPlane('XY', 75))
|> startProfileAt([0, 125], %)
|> line([-15, -30], %)
|> line([30, 0], %)
Expand All @@ -51,18 +51,18 @@ loft([squareSketch, triangleSketch])

```js
// Loft a square, a circle, and another circle.
const squareSketch = startSketchOn('XY')
squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)

const circleSketch0 = startSketchOn(offsetPlane('XY', 75))
circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|> circle({ center: [0, 100], radius: 50 }, %)

const circleSketch1 = startSketchOn(offsetPlane('XY', 150))
circleSketch1 = startSketchOn(offsetPlane('XY', 150))
|> circle({ center: [0, 100], radius: 20 }, %)

loft([
Expand All @@ -76,18 +76,18 @@ loft([

```js
// Loft a square, a circle, and another circle with options.
const squareSketch = startSketchOn('XY')
squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)

const circleSketch0 = startSketchOn(offsetPlane('XY', 75))
circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|> circle({ center: [0, 100], radius: 50 }, %)

const circleSketch1 = startSketchOn(offsetPlane('XY', 150))
circleSketch1 = startSketchOn(offsetPlane('XY', 150))
|> circle({ center: [0, 100], radius: 20 }, %)

loft([
Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/log.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/log10.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/log2.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/pages/docs/kcl/m.md

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions content/pages/docs/kcl/map.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/max.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/min.md

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions content/pages/docs/kcl/mirror2d.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/pages/docs/kcl/mm.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions content/pages/docs/kcl/offsetPlane.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ offsetPlane(std_plane: StandardPlane, offset: number) -> PlaneData

```js
// Loft a square and a circle on the `XY` plane using offset.
const squareSketch = startSketchOn('XY')
squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)

const circleSketch = startSketchOn(offsetPlane('XY', 150))
circleSketch = startSketchOn(offsetPlane('XY', 150))
|> circle({ center: [0, 100], radius: 50 }, %)

loft([squareSketch, circleSketch])
Expand All @@ -47,15 +47,15 @@ loft([squareSketch, circleSketch])

```js
// Loft a square and a circle on the `XZ` plane using offset.
const squareSketch = startSketchOn('XZ')
squareSketch = startSketchOn('XZ')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)

const circleSketch = startSketchOn(offsetPlane('XZ', 150))
circleSketch = startSketchOn(offsetPlane('XZ', 150))
|> circle({ center: [0, 100], radius: 50 }, %)

loft([squareSketch, circleSketch])
Expand All @@ -65,15 +65,15 @@ loft([squareSketch, circleSketch])

```js
// Loft a square and a circle on the `YZ` plane using offset.
const squareSketch = startSketchOn('YZ')
squareSketch = startSketchOn('YZ')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)

const circleSketch = startSketchOn(offsetPlane('YZ', 150))
circleSketch = startSketchOn(offsetPlane('YZ', 150))
|> circle({ center: [0, 100], radius: 50 }, %)

loft([squareSketch, circleSketch])
Expand All @@ -83,15 +83,15 @@ loft([squareSketch, circleSketch])

```js
// Loft a square and a circle on the `-XZ` plane using offset.
const squareSketch = startSketchOn('-XZ')
squareSketch = startSketchOn('-XZ')
|> startProfileAt([-100, 200], %)
|> line([200, 0], %)
|> line([0, -200], %)
|> line([-200, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)

const circleSketch = startSketchOn(offsetPlane('-XZ', -150))
circleSketch = startSketchOn(offsetPlane('-XZ', -150))
|> circle({ center: [0, 100], radius: 50 }, %)

loft([squareSketch, circleSketch])
Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/patternCircular2d.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/patternCircular3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ patternCircular3d(data: CircularPattern3dData, solid_set: SolidSet) -> [Solid]
### Examples

```js
const exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn('XZ')
|> circle({ center: [0, 0], radius: 1 }, %)

const example = extrude(-5, exampleSketch)
example = extrude(-5, exampleSketch)
|> patternCircular3d({
axis: [1, -1, 0],
center: [10, -20, 0],
Expand Down
4 changes: 2 additions & 2 deletions content/pages/docs/kcl/patternLinear2d.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/pages/docs/kcl/patternLinear3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ patternLinear3d(data: LinearPattern3dData, solid_set: SolidSet) -> [Solid]
### Examples

```js
const exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([0, 2], %)
|> line([3, 1], %)
|> line([0, -4], %)
|> close(%)

const example = extrude(1, exampleSketch)
example = extrude(1, exampleSketch)
|> patternLinear3d({
axis: [1, 0, 1],
repetitions: 6,
Expand Down
Loading

0 comments on commit 0940ef3

Please sign in to comment.