Skip to content

Commit

Permalink
Add default planes to std (#5433)
Browse files Browse the repository at this point in the history
* Type ascription

Signed-off-by: Nick Cameron <[email protected]>

* Support negation of planes

Signed-off-by: Nick Cameron <[email protected]>

* Add default planes to std

Signed-off-by: Nick Cameron <[email protected]>

* Don't double wrap docs files in const_

Signed-off-by: Nick Cameron <[email protected]>

---------

Signed-off-by: Nick Cameron <[email protected]>
  • Loading branch information
nrc authored Feb 27, 2025
1 parent 12edb63 commit 89bc93e
Show file tree
Hide file tree
Showing 50 changed files with 2,136 additions and 434 deletions.
2 changes: 1 addition & 1 deletion docs/kcl/angledLine.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angledLine(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
### Examples

```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> yLineTo(15, %)
|> angledLine({ angle = 30, length = 15 }, %)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/angledLineOfXLength.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angledLineOfXLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -
### Examples

```js
sketch001 = startSketchOn('XZ')
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLineOfXLength({ angle = 45, length = 10 }, %, $edge1)
|> angledLineOfXLength({ angle = -15, length = 20 }, %, $edge2)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/angledLineOfYLength.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angledLineOfYLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -
### Examples

```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [10, 0])
|> angledLineOfYLength({ angle = 45, length = 10 }, %)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/angledLineThatIntersects.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch: Sketch, tag
### Examples

```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [5, 10])
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/angledLineToX.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sk
### Examples

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

```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLineToY({ angle = 60, to = 20 }, %)
|> line(end = [-20, 0])
Expand Down
2 changes: 1 addition & 1 deletion 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
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [10, 0])
|> arc({
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/arcTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ arcTo(data: ArcToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
### Examples

```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> arcTo({ end = [10, 0], interior = [5, 5] }, %)
|> close()
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/bezierCurve.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bezierCurve(data: BezierData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
### Examples

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

Large diffs are not rendered by default.

32 changes: 0 additions & 32 deletions docs/kcl/const_E.md

This file was deleted.

28 changes: 0 additions & 28 deletions docs/kcl/const_PI.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/kcl/const_QUARTER_TURN.md

This file was deleted.

32 changes: 0 additions & 32 deletions docs/kcl/const_TAU.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/kcl/const_THREE_QUARTER_TURN.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/kcl/const_ZERO.md → docs/kcl/const_std-XY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "ZERO"
title: "std::XY"
excerpt: ""
layout: manual
---
Expand All @@ -9,7 +9,7 @@ layout: manual


```js
ZERO: number = 0
std::XY
```


4 changes: 2 additions & 2 deletions docs/kcl/const_HALF_TURN.md → docs/kcl/const_std-XZ.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "HALF_TURN"
title: "std::XZ"
excerpt: ""
layout: manual
---
Expand All @@ -9,7 +9,7 @@ layout: manual


```js
HALF_TURN: number(deg) = 180deg
std::XZ
```


15 changes: 15 additions & 0 deletions docs/kcl/const_std-YZ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "std::YZ"
excerpt: ""
layout: manual
---





```js
std::YZ
```


6 changes: 3 additions & 3 deletions docs/kcl/hole.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ hole(holeSketch: SketchSet, sketch: Sketch) -> Sketch
### Examples

```js
exampleSketch = startSketchOn('XY')
exampleSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
Expand All @@ -44,7 +44,7 @@ example = extrude(exampleSketch, length = 1)

```js
fn squareHoleSketch() {
squareSketch = startSketchOn('-XZ')
squareSketch = startSketchOn(-XZ)
|> startProfileAt([-1, -1], %)
|> line(end = [2, 0])
|> line(end = [0, 2])
Expand All @@ -53,7 +53,7 @@ fn squareHoleSketch() {
return squareSketch
}

exampleSketch = startSketchOn('-XZ')
exampleSketch = startSketchOn(-XZ)
|> circle({ center = [0, 0], radius = 3 }, %)
|> hole(squareHoleSketch(), %)
example = extrude(exampleSketch, length = 1)
Expand Down
3 changes: 3 additions & 0 deletions docs/kcl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ layout: manual
* [`HALF_TURN`](kcl/const_std-HALF_TURN)
* [`QUARTER_TURN`](kcl/const_std-QUARTER_TURN)
* [`THREE_QUARTER_TURN`](kcl/const_std-THREE_QUARTER_TURN)
* [`XY`](kcl/const_std-XY)
* [`XZ`](kcl/const_std-XZ)
* [`YZ`](kcl/const_std-YZ)
* [`ZERO`](kcl/const_std-ZERO)
* [`abs`](kcl/abs)
* [`acos`](kcl/acos)
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ line(sketch: Sketch, endAbsolute?: [number], end?: [number], tag?: TagDeclarator
### Examples

```js
triangle = startSketchOn("XZ")
triangle = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
// The 'end' argument means it ends at exactly [10, 0].
// This is an absolute measurement, it is NOT relative to
Expand All @@ -41,7 +41,7 @@ triangle = startSketchOn("XZ")
|> close()
|> extrude(length = 5)

box = startSketchOn("XZ")
box = startSketchOn(XZ)
|> startProfileAt([10, 10], %)
// The 'to' argument means move the pen this much.
// So, [10, 0] is a relative distance away from the current point.
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/profileStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ profileStart(sketch: Sketch) -> [number]
### Examples

```js
sketch001 = startSketchOn('XY')
sketch001 = startSketchOn(XY)
|> startProfileAt([5, 2], %)
|> angledLine({ angle = 120, length = 50 }, %, $seg01)
|> angledLine({
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/profileStartX.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ profileStartX(sketch: Sketch) -> number
### Examples

```js
sketch001 = startSketchOn('XY')
sketch001 = startSketchOn(XY)
|> startProfileAt([5, 2], %)
|> angledLine([-26.6, 50], %)
|> angledLine([90, 50], %)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/profileStartY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ profileStartY(sketch: Sketch) -> number
### Examples

```js
sketch001 = startSketchOn('XY')
sketch001 = startSketchOn(XY)
|> startProfileAt([5, 2], %)
|> angledLine({ angle = -60, length = 14 }, %)
|> angledLineToY({ angle = 30, to = profileStartY(%) }, %)
Expand Down
6 changes: 3 additions & 3 deletions docs/kcl/startProfileAt.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/kcl/startSketchOn.md

Large diffs are not rendered by default.

Loading

0 comments on commit 89bc93e

Please sign in to comment.