Compare commits
5 Commits
achalmers/
...
v0.56.0
Author | SHA1 | Date | |
---|---|---|---|
525f213f1d | |||
58a81da039 | |||
0002295cdf | |||
c050739f41 | |||
ccd5b0272d |
@ -8,17 +8,17 @@ Draw a line segment relative to the current origin using the polar measure of so
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
angledLine(
|
angledLine(
|
||||||
sketch: Sketch,
|
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||||
angle: number,
|
angle: [number](/docs/kcl/types/number),
|
||||||
length?: number,
|
length?: [number](/docs/kcl/types/number),
|
||||||
lengthX?: number,
|
lengthX?: [number](/docs/kcl/types/number),
|
||||||
lengthY?: number,
|
lengthY?: [number](/docs/kcl/types/number),
|
||||||
endAbsoluteX?: number,
|
endAbsoluteX?: [number](/docs/kcl/types/number),
|
||||||
endAbsoluteY?: number,
|
endAbsoluteY?: [number](/docs/kcl/types/number),
|
||||||
tag?: TagDeclarator,
|
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||||
): Sketch
|
): [Sketch](/docs/kcl/types/Sketch)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ angledLine(
|
|||||||
| `lengthY` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
| `lengthY` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
| `endAbsoluteX` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
| `endAbsoluteX` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
| `endAbsoluteY` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
| `endAbsoluteY` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ angledLine(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> yLine(endAbsolute = 15)
|
|> yLine(endAbsolute = 15)
|
||||||
|
@ -8,14 +8,14 @@ Draw an angled line from the current origin, constructing a line segment such th
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
angledLineThatIntersects(
|
angledLineThatIntersects(
|
||||||
sketch: Sketch,
|
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||||
angle: number,
|
angle: [number](/docs/kcl/types/number),
|
||||||
intersectTag: TagIdentifier,
|
intersectTag: [TagIdentifier](/docs/kcl/types#tag-identifier),
|
||||||
offset?: number,
|
offset?: [number](/docs/kcl/types/number),
|
||||||
tag?: TagDeclarator,
|
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||||
): Sketch
|
): [Sketch](/docs/kcl/types/Sketch)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ angledLineThatIntersects(
|
|||||||
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes |
|
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes |
|
||||||
| `intersectTag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The tag of the line to intersect with | Yes |
|
| `intersectTag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The tag of the line to intersect with | Yes |
|
||||||
| `offset` | [`number`](/docs/kcl/types/number) | The offset from the intersecting line. Defaults to 0. | No |
|
| `offset` | [`number`](/docs/kcl/types/number) | The offset from the intersecting line. Defaults to 0. | No |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ angledLineThatIntersects(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(endAbsolute = [5, 10])
|
|> line(endAbsolute = [5, 10])
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,15 +8,15 @@ Check a value meets some expected conditions at runtime. Program terminates with
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
assert(
|
assert(
|
||||||
actual: number,
|
actual: [number](/docs/kcl/types/number),
|
||||||
isGreaterThan?: number,
|
isGreaterThan?: [number](/docs/kcl/types/number),
|
||||||
isLessThan?: number,
|
isLessThan?: [number](/docs/kcl/types/number),
|
||||||
isGreaterThanOrEqual?: number,
|
isGreaterThanOrEqual?: [number](/docs/kcl/types/number),
|
||||||
isLessThanOrEqual?: number,
|
isLessThanOrEqual?: [number](/docs/kcl/types/number),
|
||||||
isEqualTo?: number,
|
isEqualTo?: [number](/docs/kcl/types/number),
|
||||||
tolerance?: number,
|
tolerance?: [number](/docs/kcl/types/number),
|
||||||
error?: String,
|
error?: String,
|
||||||
): ()
|
): ()
|
||||||
```
|
```
|
||||||
@ -42,7 +42,7 @@ assert(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
n = 10
|
n = 10
|
||||||
assert(n, isEqualTo = 10)
|
assert(n, isEqualTo = 10)
|
||||||
assert(
|
assert(
|
||||||
|
@ -8,9 +8,9 @@ Asserts that a value is the boolean value true.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
assertIs(
|
assertIs(
|
||||||
actual: bool,
|
actual: [bool](/docs/kcl/types/bool),
|
||||||
error?: String,
|
error?: String,
|
||||||
): ()
|
): ()
|
||||||
```
|
```
|
||||||
@ -30,7 +30,7 @@ assertIs(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
kclIsFun = true
|
kclIsFun = true
|
||||||
assertIs(kclIsFun)
|
assertIs(kclIsFun)
|
||||||
```
|
```
|
||||||
|
@ -8,14 +8,14 @@ Draw a smooth, continuous, curved line segment from the current origin to the de
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
bezierCurve(
|
bezierCurve(
|
||||||
sketch: Sketch,
|
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||||
control1: [number],
|
control1: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
control2: [number],
|
control2: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
end: [number],
|
end: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
tag?: TagDeclarator,
|
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||||
): Sketch
|
): [Sketch](/docs/kcl/types/Sketch)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ bezierCurve(
|
|||||||
| `control1` | [`[number]`](/docs/kcl/types/number) | First control point for the cubic | Yes |
|
| `control1` | [`[number]`](/docs/kcl/types/number) | First control point for the cubic | Yes |
|
||||||
| `control2` | [`[number]`](/docs/kcl/types/number) | Second control point for the cubic | Yes |
|
| `control2` | [`[number]`](/docs/kcl/types/number) | Second control point for the cubic | Yes |
|
||||||
| `end` | [`[number]`](/docs/kcl/types/number) | How far away (along the X and Y axes) should this line go? | Yes |
|
| `end` | [`[number]`](/docs/kcl/types/number) | How far away (along the X and Y axes) should this line go? | Yes |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ bezierCurve(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [0, 10])
|
|> line(end = [0, 10])
|
||||||
|
@ -8,14 +8,14 @@ Construct a circle derived from 3 points.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
circleThreePoint(
|
circleThreePoint(
|
||||||
sketchSurfaceOrGroup: SketchOrSurface,
|
sketchSurfaceOrGroup: [[Sketch](/docs/kcl/types/Sketch)OrSurface](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)OrSurface),
|
||||||
p1: [number],
|
p1: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
p2: [number],
|
p2: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
p3: [number],
|
p3: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
tag?: TagDeclarator,
|
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||||
): Sketch
|
): [Sketch](/docs/kcl/types/Sketch)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ circleThreePoint(
|
|||||||
| `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes |
|
| `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes |
|
||||||
| `p2` | [`[number]`](/docs/kcl/types/number) | 2nd point to derive the circle. | Yes |
|
| `p2` | [`[number]`](/docs/kcl/types/number) | 2nd point to derive the circle. | Yes |
|
||||||
| `p3` | [`[number]`](/docs/kcl/types/number) | 3rd point to derive the circle. | Yes |
|
| `p3` | [`[number]`](/docs/kcl/types/number) | 3rd point to derive the circle. | Yes |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ circleThreePoint(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XY)
|
exampleSketch = startSketchOn(XY)
|
||||||
|> circleThreePoint(p1 = [10, 10], p2 = [20, 8], p3 = [15, 5])
|
|> circleThreePoint(p1 = [10, 10], p2 = [20, 8], p3 = [15, 5])
|
||||||
|> extrude(length = 5)
|
|> extrude(length = 5)
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@ Identifies the ending face of an extrusion. I.e., the new face created by an ext
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::END: string = 'end'
|
std::END: string = 'end'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ Identifies the starting face of an extrusion. I.e., the face which is extruded.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::START: string = 'start'
|
std::START: string = 'start'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::X
|
std::X
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::XY
|
std::XY
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::XZ
|
std::XZ
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::Y
|
std::Y
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::YZ
|
std::YZ
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::Z
|
std::Z
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,13 +8,13 @@ The value of Euler’s number `e`.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::math::E: number = 2.71828182845904523536028747135266250_
|
std::math::E: number = 2.71828182845904523536028747135266250_
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
|
@ -8,13 +8,13 @@ The value of `pi`, Archimedes’ constant (π).
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::math::PI: number(_?) = 3.14159265358979323846264338327950288_?
|
std::math::PI: number(_?) = 3.14159265358979323846264338327950288_?
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
circumference = 70
|
circumference = 70
|
||||||
|
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|
@ -8,13 +8,13 @@ The value of `tau`, the full circle constant (τ). Equal to 2π.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::math::TAU: number = 6.28318530717958647692528676655900577_
|
std::math::TAU: number = 6.28318530717958647692528676655900577_
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::turns::HALF_TURN: number(deg) = 180deg
|
std::turns::HALF_TURN: number(deg) = 180deg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::turns::QUARTER_TURN: number(deg) = 90deg
|
std::turns::QUARTER_TURN: number(deg) = 90deg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
std::turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::turns::ZERO: number = 0
|
std::turns::ZERO: number = 0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -8,8 +8,8 @@ Get the shared edge between two faces.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
getCommonEdge(faces: [TagIdentifier]): Uuid
|
getCommon[Edge](/docs/kcl/types/Edge)(faces: [[TagIdentifier](/docs/kcl/types#tag-identifier)]): Uuid
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ getCommonEdge(faces: [TagIdentifier]): Uuid
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
// Get an edge shared between two faces, created after a chamfer.
|
// Get an edge shared between two faces, created after a chamfer.
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ Get the next adjacent edge to the edge given.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
getNextAdjacentEdge(edge: TagIdentifier): Uuid
|
getNextAdjacent[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ getNextAdjacentEdge(edge: TagIdentifier): Uuid
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|
@ -8,8 +8,8 @@ Get the opposite edge to the edge given.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
getOppositeEdge(edge: TagIdentifier): Uuid
|
getOpposite[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ getOppositeEdge(edge: TagIdentifier): Uuid
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|
@ -8,8 +8,8 @@ Get the previous adjacent edge to the edge given.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
getPreviousAdjacentEdge(edge: TagIdentifier): Uuid
|
getPreviousAdjacent[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ getPreviousAdjacentEdge(edge: TagIdentifier): Uuid
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|
@ -93,30 +93,30 @@ layout: manual
|
|||||||
* [`xLine`](kcl/xLine)
|
* [`xLine`](kcl/xLine)
|
||||||
* [`yLine`](kcl/yLine)
|
* [`yLine`](kcl/yLine)
|
||||||
* **std::math**
|
* **std::math**
|
||||||
* [`math::E`](kcl/consts/std-math-E)
|
* [`E`](kcl/consts/std-math-E)
|
||||||
* [`math::PI`](kcl/consts/std-math-PI)
|
* [`PI`](kcl/consts/std-math-PI)
|
||||||
* [`math::TAU`](kcl/consts/std-math-TAU)
|
* [`TAU`](kcl/consts/std-math-TAU)
|
||||||
* [`math::abs`](kcl/std-math-abs)
|
* [`abs`](kcl/std-math-abs)
|
||||||
* [`math::acos`](kcl/std-math-acos)
|
* [`acos`](kcl/std-math-acos)
|
||||||
* [`math::asin`](kcl/std-math-asin)
|
* [`asin`](kcl/std-math-asin)
|
||||||
* [`math::atan`](kcl/std-math-atan)
|
* [`atan`](kcl/std-math-atan)
|
||||||
* [`math::atan2`](kcl/std-math-atan2)
|
* [`atan2`](kcl/std-math-atan2)
|
||||||
* [`math::ceil`](kcl/std-math-ceil)
|
* [`ceil`](kcl/std-math-ceil)
|
||||||
* [`math::cos`](kcl/std-math-cos)
|
* [`cos`](kcl/std-math-cos)
|
||||||
* [`math::floor`](kcl/std-math-floor)
|
* [`floor`](kcl/std-math-floor)
|
||||||
* [`math::ln`](kcl/std-math-ln)
|
* [`ln`](kcl/std-math-ln)
|
||||||
* [`math::log`](kcl/std-math-log)
|
* [`log`](kcl/std-math-log)
|
||||||
* [`math::log10`](kcl/std-math-log10)
|
* [`log10`](kcl/std-math-log10)
|
||||||
* [`math::log2`](kcl/std-math-log2)
|
* [`log2`](kcl/std-math-log2)
|
||||||
* [`math::max`](kcl/std-math-max)
|
* [`max`](kcl/std-math-max)
|
||||||
* [`math::min`](kcl/std-math-min)
|
* [`min`](kcl/std-math-min)
|
||||||
* [`math::polar`](kcl/std-math-polar)
|
* [`polar`](kcl/std-math-polar)
|
||||||
* [`math::pow`](kcl/std-math-pow)
|
* [`pow`](kcl/std-math-pow)
|
||||||
* [`math::rem`](kcl/std-math-rem)
|
* [`rem`](kcl/std-math-rem)
|
||||||
* [`math::round`](kcl/std-math-round)
|
* [`round`](kcl/std-math-round)
|
||||||
* [`math::sin`](kcl/std-math-sin)
|
* [`sin`](kcl/std-math-sin)
|
||||||
* [`math::sqrt`](kcl/std-math-sqrt)
|
* [`sqrt`](kcl/std-math-sqrt)
|
||||||
* [`math::tan`](kcl/std-math-tan)
|
* [`tan`](kcl/std-math-tan)
|
||||||
* **std::sketch**
|
* **std::sketch**
|
||||||
* [`circle`](kcl/std-sketch-circle)
|
* [`circle`](kcl/std-sketch-circle)
|
||||||
* [`mirror2d`](kcl/std-sketch-mirror2d)
|
* [`mirror2d`](kcl/std-sketch-mirror2d)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -8,15 +8,15 @@ Extend the current sketch with a new involute circular curve.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
involuteCircular(
|
involuteCircular(
|
||||||
sketch: Sketch,
|
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||||
startRadius: number,
|
startRadius: [number](/docs/kcl/types/number),
|
||||||
endRadius: number,
|
endRadius: [number](/docs/kcl/types/number),
|
||||||
angle: number,
|
angle: [number](/docs/kcl/types/number),
|
||||||
reverse?: bool,
|
reverse?: [bool](/docs/kcl/types/bool),
|
||||||
tag?: TagDeclarator,
|
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||||
): Sketch
|
): [Sketch](/docs/kcl/types/Sketch)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ involuteCircular(
|
|||||||
| `endRadius` | [`number`](/docs/kcl/types/number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes |
|
| `endRadius` | [`number`](/docs/kcl/types/number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes |
|
||||||
| `angle` | [`number`](/docs/kcl/types/number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes |
|
| `angle` | [`number`](/docs/kcl/types/number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes |
|
||||||
| `reverse` | [`bool`](/docs/kcl/types/bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. Defaults to false. | No |
|
| `reverse` | [`bool`](/docs/kcl/types/bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. Defaults to false. | No |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ involuteCircular(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
a = 10
|
a = 10
|
||||||
b = 14
|
b = 14
|
||||||
startSketchOn(XZ)
|
startSketchOn(XZ)
|
||||||
|
@ -8,8 +8,8 @@ Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
lastSegX(sketch: Sketch): number
|
lastSegX(sketch: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ lastSegX(sketch: Sketch): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|
@ -8,8 +8,8 @@ Extract the 'y' axis value of the last line segment in the provided 2-d sketch.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
lastSegY(sketch: Sketch): number
|
lastSegY(sketch: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ lastSegY(sketch: Sketch): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|
@ -8,11 +8,11 @@ Compute the angle of the given leg for x.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
legAngX(
|
legAngX(
|
||||||
hypotenuse: number,
|
hypotenuse: [number](/docs/kcl/types/number),
|
||||||
leg: number,
|
leg: [number](/docs/kcl/types/number),
|
||||||
): number
|
): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tags
|
### Tags
|
||||||
@ -34,7 +34,7 @@ legAngX(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
legAngX(hypotenuse = 5, leg = 3)
|
legAngX(hypotenuse = 5, leg = 3)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@ Compute the angle of the given leg for y.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
legAngY(
|
legAngY(
|
||||||
hypotenuse: number,
|
hypotenuse: [number](/docs/kcl/types/number),
|
||||||
leg: number,
|
leg: [number](/docs/kcl/types/number),
|
||||||
): number
|
): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tags
|
### Tags
|
||||||
@ -34,7 +34,7 @@ legAngY(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
legAngY(hypotenuse = 5, leg = 3)
|
legAngY(hypotenuse = 5, leg = 3)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@ Compute the length of the given leg.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
legLen(
|
legLen(
|
||||||
hypotenuse: number,
|
hypotenuse: [number](/docs/kcl/types/number),
|
||||||
leg: number,
|
leg: [number](/docs/kcl/types/number),
|
||||||
): number
|
): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tags
|
### Tags
|
||||||
@ -34,7 +34,7 @@ legLen(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
legLen(hypotenuse = 5, leg = 3)
|
legLen(hypotenuse = 5, leg = 3)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,13 +8,13 @@ Extend the current sketch with a new straight line.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
line(
|
line(
|
||||||
sketch: Sketch,
|
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||||
endAbsolute?: [number],
|
endAbsolute?: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
end?: [number],
|
end?: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
tag?: TagDeclarator,
|
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||||
): Sketch
|
): [Sketch](/docs/kcl/types/Sketch)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ line(
|
|||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
||||||
| `endAbsolute` | [`[number]`](/docs/kcl/types/number) | Which absolute point should this line go to? Incompatible with `end`. | No |
|
| `endAbsolute` | [`[number]`](/docs/kcl/types/number) | Which absolute point should this line go to? Incompatible with `end`. | No |
|
||||||
| `end` | [`[number]`](/docs/kcl/types/number) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
|
| `end` | [`[number]`](/docs/kcl/types/number) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ line(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
triangle = startSketchOn(XZ)
|
triangle = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
// The END argument means it ends at exactly [10, 0].
|
// The END argument means it ends at exactly [10, 0].
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,15 +8,15 @@ Repeat a 2-dimensional sketch some number of times along a partial or complete c
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
patternCircular2d(
|
patternCircular2d(
|
||||||
sketchSet: [Sketch],
|
sketchSet: [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)),
|
||||||
instances: integer,
|
instances: integer,
|
||||||
center: [number],
|
center: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
arcDegrees: number,
|
arcDegrees: [number](/docs/kcl/types/number),
|
||||||
rotateDuplicates: bool,
|
rotateDuplicates: [bool](/docs/kcl/types/bool),
|
||||||
useOriginal?: bool,
|
useOriginal?: [bool](/docs/kcl/types/bool),
|
||||||
): [Sketch]
|
): [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ patternCircular2d(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [.5, 25])
|
|> startProfile(at = [.5, 25])
|
||||||
|> line(end = [0, 5])
|
|> line(end = [0, 5])
|
||||||
|
@ -8,16 +8,16 @@ Repeat a 3-dimensional solid some number of times along a partial or complete ci
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
patternCircular3d(
|
patternCircular3d(
|
||||||
solids: [Solid],
|
solids: [[[Solid](/docs/kcl/types/Solid)]](/docs/kcl/types/[Solid](/docs/kcl/types/Solid)),
|
||||||
instances: integer,
|
instances: integer,
|
||||||
axis: [number],
|
axis: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
center: [number],
|
center: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
arcDegrees: number,
|
arcDegrees: [number](/docs/kcl/types/number),
|
||||||
rotateDuplicates: bool,
|
rotateDuplicates: [bool](/docs/kcl/types/bool),
|
||||||
useOriginal?: bool,
|
useOriginal?: [bool](/docs/kcl/types/bool),
|
||||||
): [Solid]
|
): [[[Solid](/docs/kcl/types/Solid)]](/docs/kcl/types/[Solid](/docs/kcl/types/Solid))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ patternCircular3d(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> circle(center = [0, 0], radius = 1)
|
|> circle(center = [0, 0], radius = 1)
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@ Repeat a 2-dimensional sketch along some dimension, with a dynamic amount of dis
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
patternLinear2d(
|
patternLinear2d(
|
||||||
sketches: [Sketch],
|
sketches: [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)),
|
||||||
instances: integer,
|
instances: integer,
|
||||||
distance: number,
|
distance: [number](/docs/kcl/types/number),
|
||||||
axis: [number],
|
axis: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||||
useOriginal?: bool,
|
useOriginal?: [bool](/docs/kcl/types/bool),
|
||||||
): [Sketch]
|
): [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ patternLinear2d(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> circle(center = [0, 0], radius = 1)
|
|> circle(center = [0, 0], radius = 1)
|
||||||
|> patternLinear2d(axis = [1, 0], instances = 7, distance = 4)
|
|> patternLinear2d(axis = [1, 0], instances = 7, distance = 4)
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,13 +8,13 @@ Just like patternTransform, but works on 2D sketches not 3D solids.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
patternTransform2d(
|
patternTransform2d(
|
||||||
sketches: [Sketch],
|
sketches: [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)),
|
||||||
instances: integer,
|
instances: integer,
|
||||||
transform: FunctionSource,
|
transform: FunctionSource,
|
||||||
useOriginal?: bool,
|
useOriginal?: [bool](/docs/kcl/types/bool),
|
||||||
): [Sketch]
|
): [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ patternTransform2d(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
// Each instance will be shifted along the X axis.
|
// Each instance will be shifted along the X axis.
|
||||||
fn transform(id) {
|
fn transform(id) {
|
||||||
return { translate = [4 * id, 0] }
|
return { translate = [4 * id, 0] }
|
||||||
|
File diff suppressed because one or more lines are too long
@ -8,8 +8,8 @@ Remove the last element from an array.
|
|||||||
|
|
||||||
Returns a new array with the last element removed.
|
Returns a new array with the last element removed.
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
pop(array: [KclValue]): KclValue
|
pop(array: [[[KclValue](/docs/kcl/types/KclValue)]](/docs/kcl/types/[KclValue](/docs/kcl/types/KclValue))): [KclValue](/docs/kcl/types/KclValue)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ pop(array: [KclValue]): KclValue
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
arr = [1, 2, 3, 4]
|
arr = [1, 2, 3, 4]
|
||||||
new_arr = pop(arr)
|
new_arr = pop(arr)
|
||||||
assert(
|
assert(
|
||||||
|
@ -8,8 +8,8 @@ Extract the provided 2-dimensional sketch's profile's origin value.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
profileStart(profile: Sketch): [number]
|
profileStart(profile: [Sketch](/docs/kcl/types/Sketch)): [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ profileStart(profile: Sketch): [number]
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XY)
|
sketch001 = startSketchOn(XY)
|
||||||
|> startProfile(at = [5, 2])
|
|> startProfile(at = [5, 2])
|
||||||
|> angledLine(angle = 120, length = 50, tag = $seg01)
|
|> angledLine(angle = 120, length = 50, tag = $seg01)
|
||||||
|
@ -8,8 +8,8 @@ Extract the provided 2-dimensional sketch's profile's origin's 'x' value.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
profileStartX(profile: Sketch): number
|
profileStartX(profile: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ profileStartX(profile: Sketch): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XY)
|
sketch001 = startSketchOn(XY)
|
||||||
|> startProfile(at = [5, 2])
|
|> startProfile(at = [5, 2])
|
||||||
|> angledLine(angle = -26.6, length = 50)
|
|> angledLine(angle = -26.6, length = 50)
|
||||||
|
@ -8,8 +8,8 @@ Extract the provided 2-dimensional sketch's profile's origin's 'y' value.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
profileStartY(profile: Sketch): number
|
profileStartY(profile: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ profileStartY(profile: Sketch): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XY)
|
sketch001 = startSketchOn(XY)
|
||||||
|> startProfile(at = [5, 2])
|
|> startProfile(at = [5, 2])
|
||||||
|> angledLine(angle = -60, length = 14)
|
|> angledLine(angle = -60, length = 14)
|
||||||
|
@ -8,11 +8,11 @@ Append an element to the end of an array.
|
|||||||
|
|
||||||
Returns a new array with the element appended.
|
Returns a new array with the element appended.
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
push(
|
push(
|
||||||
array: [KclValue],
|
array: [[[KclValue](/docs/kcl/types/KclValue)]](/docs/kcl/types/[KclValue](/docs/kcl/types/KclValue)),
|
||||||
item: KclValue,
|
item: [KclValue](/docs/kcl/types/KclValue),
|
||||||
): KclValue
|
): [KclValue](/docs/kcl/types/KclValue)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ push(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
arr = [1, 2, 3]
|
arr = [1, 2, 3]
|
||||||
new_arr = push(arr, item = 4)
|
new_arr = push(arr, item = 4)
|
||||||
assert(
|
assert(
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,8 +8,8 @@ Compute the angle (in degrees) of the provided line segment.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
segAng(tag: TagIdentifier): number
|
segAng(tag: [TagIdentifier](/docs/kcl/types#tag-identifier)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ segAng(tag: TagIdentifier): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ segAng(tag: TagIdentifier): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|
@ -8,8 +8,8 @@ Compute the ending point of the provided line segment.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
segEnd(tag: TagIdentifier): [number]
|
segEnd(tag: [TagIdentifier](/docs/kcl/types#tag-identifier)): [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ segEnd(tag: TagIdentifier): [number]
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ segEnd(tag: TagIdentifier): [number]
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
w = 15
|
w = 15
|
||||||
cube = startSketchOn(XY)
|
cube = startSketchOn(XY)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|
@ -8,8 +8,8 @@ Compute the ending point of the provided line segment along the 'x' axis.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
segEndX(tag: TagIdentifier): number
|
segEndX(tag: [TagIdentifier](/docs/kcl/types#tag-identifier)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ segEndX(tag: TagIdentifier): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ segEndX(tag: TagIdentifier): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [20, 0], tag = $thing)
|
|> line(end = [20, 0], tag = $thing)
|
||||||
|
@ -8,8 +8,8 @@ Compute the ending point of the provided line segment along the 'y' axis.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
segEndY(tag: TagIdentifier): number
|
segEndY(tag: [TagIdentifier](/docs/kcl/types#tag-identifier)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ segEndY(tag: TagIdentifier): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ segEndY(tag: TagIdentifier): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|
@ -8,8 +8,8 @@ Compute the length of the provided line segment.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
segLen(tag: TagIdentifier): number
|
segLen(tag: [TagIdentifier](/docs/kcl/types#tag-identifier)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ segLen(tag: TagIdentifier): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ segLen(tag: TagIdentifier): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(angle = 60, length = 10, tag = $thing)
|
|> angledLine(angle = 60, length = 10, tag = $thing)
|
||||||
|
@ -8,8 +8,8 @@ Compute the starting point of the provided line segment.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
segStart(tag: TagIdentifier): [number]
|
segStart(tag: [TagIdentifier](/docs/kcl/types#tag-identifier)): [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ segStart(tag: TagIdentifier): [number]
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ segStart(tag: TagIdentifier): [number]
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
w = 15
|
w = 15
|
||||||
cube = startSketchOn(XY)
|
cube = startSketchOn(XY)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|
@ -8,8 +8,8 @@ Compute the starting point of the provided line segment along the 'x' axis.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
segStartX(tag: TagIdentifier): number
|
segStartX(tag: [TagIdentifier](/docs/kcl/types#tag-identifier)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ segStartX(tag: TagIdentifier): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ segStartX(tag: TagIdentifier): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [20, 0], tag = $thing)
|
|> line(end = [20, 0], tag = $thing)
|
||||||
|
@ -8,8 +8,8 @@ Compute the starting point of the provided line segment along the 'y' axis.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
segStartY(tag: TagIdentifier): number
|
segStartY(tag: [TagIdentifier](/docs/kcl/types#tag-identifier)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ segStartY(tag: TagIdentifier): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ segStartY(tag: TagIdentifier): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,8 +8,8 @@ Compute the absolute value of a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
abs(@input: number): number
|
abs(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,14 +26,14 @@ abs(@input: number): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
myAngle = -120
|
myAngle = -120
|
||||||
|
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [8, 0])
|
|> line(end = [8, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = math::abs(myAngle),
|
angle = abs(myAngle),
|
||||||
length = 5,
|
length = 5,
|
||||||
)
|
)
|
||||||
|> line(end = [-5, 0])
|
|> line(end = [-5, 0])
|
||||||
|
@ -8,8 +8,8 @@ Compute the arccosine of a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
acos(@num: number(_)): number(rad)
|
acos(@num: [number](/docs/kcl/types/number)(_)): [number](/docs/kcl/types/number)(rad)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,11 +26,11 @@ acos(@num: number(_)): number(rad)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = math::acos(0.5),
|
angle = acos(0.5),
|
||||||
length = 10,
|
length = 10,
|
||||||
)
|
)
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|
@ -8,8 +8,8 @@ Compute the arcsine of a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
asin(@num: number(_)): number(rad)
|
asin(@num: [number](/docs/kcl/types/number)(_)): [number](/docs/kcl/types/number)(rad)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,11 +26,11 @@ asin(@num: number(_)): number(rad)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = math::asin(0.5),
|
angle = asin(0.5),
|
||||||
length = 20,
|
length = 20,
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|
@ -8,8 +8,8 @@ Compute the arctangent of a number.
|
|||||||
|
|
||||||
Consider using `atan2()` instead for the true inverse of tangent.
|
Consider using `atan2()` instead for the true inverse of tangent.
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
atan(@num: number(_)): number(rad)
|
atan(@num: [number](/docs/kcl/types/number)(_)): [number](/docs/kcl/types/number)(rad)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,11 +26,11 @@ atan(@num: number(_)): number(rad)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = math::atan(1.25),
|
angle = atan(1.25),
|
||||||
length = 20,
|
length = 20,
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|
@ -8,11 +8,11 @@ Compute the four quadrant arctangent of Y and X.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
atan2(
|
atan2(
|
||||||
y: number(Length),
|
y: [number](/docs/kcl/types/number)(Length),
|
||||||
x: number(Length),
|
x: [number](/docs/kcl/types/number)(Length),
|
||||||
): number(rad)
|
): [number](/docs/kcl/types/number)(rad)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -30,11 +30,11 @@ atan2(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = math::atan2(y = 1.25, x = 2),
|
angle = atan2(y = 1.25, x = 2),
|
||||||
length = 20,
|
length = 20,
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|
@ -8,8 +8,8 @@ Compute the smallest integer greater than or equal to a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
ceil(@input: number): number
|
ceil(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,11 +26,11 @@ ceil(@input: number): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(endAbsolute = [12, 10])
|
|> line(endAbsolute = [12, 10])
|
||||||
|> line(end = [math::ceil(7.02986), 0])
|
|> line(end = [ceil(7.02986), 0])
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ Compute the cosine of a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
cos(@num: number(Angle)): number(_)
|
cos(@num: [number](/docs/kcl/types/number)(Angle)): [number](/docs/kcl/types/number)(_)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,12 +26,12 @@ cos(@num: number(Angle)): number(_)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 30,
|
angle = 30,
|
||||||
length = 3 / math::cos(30deg),
|
length = 3 / cos(30deg),
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -8,8 +8,8 @@ Compute the largest integer less than or equal to a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
floor(@input: number): number
|
floor(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,11 +26,11 @@ floor(@input: number): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(endAbsolute = [12, 10])
|
|> line(endAbsolute = [12, 10])
|
||||||
|> line(end = [math::floor(7.02986), 0])
|
|> line(end = [floor(7.02986), 0])
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ Compute the natural logarithm of the number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
ln(@input: number): number
|
ln(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,10 +26,10 @@ ln(@input: number): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [math::ln(100), 15])
|
|> line(end = [ln(100), 15])
|
||||||
|> line(end = [5, -6])
|
|> line(end = [5, -6])
|
||||||
|> line(end = [-10, -10])
|
|> line(end = [-10, -10])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -7,14 +7,14 @@ layout: manual
|
|||||||
Compute the logarithm of the number with respect to an arbitrary base.
|
Compute the logarithm of the number with respect to an arbitrary base.
|
||||||
|
|
||||||
The result might not be correctly rounded owing to implementation
|
The result might not be correctly rounded owing to implementation
|
||||||
details; `math::log2` can produce more accurate results for base 2,
|
details; `log2` can produce more accurate results for base 2,
|
||||||
and `math::log10` can produce more accurate results for base 10.
|
and `log10` can produce more accurate results for base 10.
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
log(
|
log(
|
||||||
@input: number,
|
@input: [number](/docs/kcl/types/number),
|
||||||
base: number(_),
|
base: [number](/docs/kcl/types/number)(_),
|
||||||
): number
|
): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -32,10 +32,10 @@ log(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [math::log(100, base = 5), 0])
|
|> line(end = [log(100, base = 5), 0])
|
||||||
|> line(end = [5, 8])
|
|> line(end = [5, 8])
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -8,8 +8,8 @@ Compute the base 10 logarithm of the number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
log10(@input: number): number
|
log10(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,10 +26,10 @@ log10(@input: number): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [math::log10(100), 0])
|
|> line(end = [log10(100), 0])
|
||||||
|> line(end = [5, 8])
|
|> line(end = [5, 8])
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -8,8 +8,8 @@ Compute the base 2 logarithm of the number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
log2(@input: number): number
|
log2(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,10 +26,10 @@ log2(@input: number): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [math::log2(100), 0])
|
|> line(end = [log2(100), 0])
|
||||||
|> line(end = [5, 8])
|
|> line(end = [5, 8])
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -8,8 +8,8 @@ Compute the maximum of the given arguments.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
max(@input: [number; 1+]): number
|
max(@input: [[number](/docs/kcl/types/number); 1+]): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,12 +26,12 @@ max(@input: [number; 1+]): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 70,
|
angle = 70,
|
||||||
length = math::max([15, 31, 4, 13, 22])
|
length = max([15, 31, 4, 13, 22])
|
||||||
)
|
)
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -8,8 +8,8 @@ Compute the minimum of the given arguments.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
min(@input: [number; 1+]): number
|
min(@input: [[number](/docs/kcl/types/number); 1+]): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,12 +26,12 @@ min(@input: [number; 1+]): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 70,
|
angle = 70,
|
||||||
length = math::min([15, 31, 4, 13, 22])
|
length = min([15, 31, 4, 13, 22])
|
||||||
)
|
)
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -9,11 +9,11 @@ layout: manual
|
|||||||
Convert polar/sphere (azimuth, elevation, distance) coordinates to
|
Convert polar/sphere (azimuth, elevation, distance) coordinates to
|
||||||
cartesian (x/y/z grid) coordinates.
|
cartesian (x/y/z grid) coordinates.
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
polar(
|
polar(
|
||||||
angle: number(rad),
|
angle: [number](/docs/kcl/types/number)(rad),
|
||||||
length: number(Length),
|
length: [number](/docs/kcl/types/number)(Length),
|
||||||
): Point2d
|
): [Point2d](/docs/kcl/types/Point2d)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -31,10 +31,10 @@ polar(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = math::polar(angle = 30, length = 5), tag = $thing)
|
|> line(end = polar(angle = 30, length = 5), tag = $thing)
|
||||||
|> line(end = [0, 5])
|
|> line(end = [0, 5])
|
||||||
|> line(end = [segEndX(thing), 0])
|
|> line(end = [segEndX(thing), 0])
|
||||||
|> line(end = [-20, 10])
|
|> line(end = [-20, 10])
|
||||||
|
@ -8,11 +8,11 @@ Compute the number to a power.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
pow(
|
pow(
|
||||||
@input: number,
|
@input: [number](/docs/kcl/types/number),
|
||||||
exp: number(_),
|
exp: [number](/docs/kcl/types/number)(_),
|
||||||
): number
|
): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -30,12 +30,12 @@ pow(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = math::pow(5, exp = 2),
|
length = pow(5, exp = 2),
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -9,11 +9,11 @@ layout: manual
|
|||||||
Compute the remainder after dividing `num` by `div`.
|
Compute the remainder after dividing `num` by `div`.
|
||||||
If `num` is negative, the result will be too.
|
If `num` is negative, the result will be too.
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
rem(
|
rem(
|
||||||
@num: number,
|
@num: [number](/docs/kcl/types/number),
|
||||||
divisor: number,
|
divisor: [number](/docs/kcl/types/number),
|
||||||
): number
|
): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ rem(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
import rem from "std::math"
|
import rem from "std::math"
|
||||||
|
|
||||||
assert(rem( 7, divisor = 4), isEqualTo = 3, error = "remainder is 3")
|
assert(rem( 7, divisor = 4), isEqualTo = 3, error = "remainder is 3")
|
||||||
|
@ -8,8 +8,8 @@ Round a number to the nearest integer.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
round(@input: number): number
|
round(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,11 +26,11 @@ round(@input: number): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> line(endAbsolute = [12, 10])
|
|> line(endAbsolute = [12, 10])
|
||||||
|> line(end = [math::round(7.02986), 0])
|
|> line(end = [round(7.02986), 0])
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ Compute the sine of a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sin(@num: number(Angle)): number(_)
|
sin(@num: [number](/docs/kcl/types/number)(Angle)): [number](/docs/kcl/types/number)(_)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,12 +26,12 @@ sin(@num: number(Angle)): number(_)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 15 / math::sin(135deg),
|
length = 15 / sin(135deg),
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -8,8 +8,8 @@ Compute the square root of a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sqrt(@input: number): number
|
sqrt(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ sqrt(@input: number): number
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
|
@ -8,8 +8,8 @@ Compute the tangent of a number.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
tan(@num: number(Angle)): number(_)
|
tan(@num: [number](/docs/kcl/types/number)(Angle)): [number](/docs/kcl/types/number)(_)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,12 +26,12 @@ tan(@num: number(Angle)): number(_)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 50 * math::tan((1/2): number(rad)),
|
length = 50 * tan((1/2): number(rad)),
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,8 +8,8 @@ Convert a number to centimeters from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toCentimeters(@num: number(cm)): number(cm)
|
units::toCentimeters(@num: [number](/docs/kcl/types/number)(cm)): [number](/docs/kcl/types/number)(cm)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ Converts a number to degrees from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toDegrees(@num: number(deg)): number(deg)
|
units::toDegrees(@num: [number](/docs/kcl/types/number)(deg)): [number](/docs/kcl/types/number)(deg)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -26,12 +26,12 @@ toDegrees(@num: number(deg)): number(deg)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfile(at = [0, 0])
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 70 * math::cos(units::toDegrees((PI/4): number(rad))),
|
length = 70 * cos(units::toDegrees((PI/4): number(rad))),
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -8,8 +8,8 @@ Convert a number to feet from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toFeet(@num: number(ft)): number(ft)
|
units::toFeet(@num: [number](/docs/kcl/types/number)(ft)): [number](/docs/kcl/types/number)(ft)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ Convert a number to inches from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toInches(@num: number(in)): number(in)
|
units::toInches(@num: [number](/docs/kcl/types/number)(in)): [number](/docs/kcl/types/number)(in)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user