Compare commits
39 Commits
Author | SHA1 | Date | |
---|---|---|---|
525f213f1d | |||
58a81da039 | |||
0002295cdf | |||
c050739f41 | |||
ccd5b0272d | |||
f1fdf48834 | |||
bae875382c | |||
14ce66bcc1 | |||
644c561815 | |||
5f31f3a6b3 | |||
a0afe9dd0e | |||
9c29756a38 | |||
bf63b21d74 | |||
0ea0d1703e | |||
29b8a442c2 | |||
844f229b5a | |||
fa51b4bbbc | |||
1fa6e1eccc | |||
44b810ee0a | |||
a9998be176 | |||
5e200aebcc | |||
e0cd3efc64 | |||
77e3efde9a | |||
a173a82d59 | |||
4d2bc18c2f | |||
aca5fdb521 | |||
8867258e47 | |||
f6cb725268 | |||
1bd570ceb9 | |||
1c87298b44 | |||
3a23ec1bee | |||
d96a4d3337 | |||
94452cce88 | |||
2e754f2a11 | |||
719136937e | |||
e207552255 | |||
1835e49191 | |||
145c28bbd5 | |||
a58a3361b6 |
77
.github/workflows/cargo-test.yml
vendored
77
.github/workflows/cargo-test.yml
vendored
@ -13,11 +13,11 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
name: cargo test
|
||||
jobs:
|
||||
cargotest:
|
||||
name: cargo test
|
||||
build-test-artifacts:
|
||||
name: Build test artifacts
|
||||
runs-on:
|
||||
- runs-on=${{ github.run_id }}
|
||||
- runner=32cpu-linux-x64
|
||||
- runner=8cpu-linux-x64
|
||||
- extras=s3-cache
|
||||
steps:
|
||||
- uses: runs-on/action@v1
|
||||
@ -43,7 +43,6 @@ jobs:
|
||||
env:
|
||||
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||
OS_NAME: ${{ env.OS_NAME }}
|
||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
||||
- uses: taiki-e/install-action@nextest
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@just
|
||||
@ -121,21 +120,67 @@ jobs:
|
||||
# Configure nextest when it's run by insta (via just).
|
||||
NEXTEST_PROFILE: ci
|
||||
RUST_BACKTRACE: full
|
||||
- name: cargo test
|
||||
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
|
||||
- name: Build and archive tests
|
||||
run: |
|
||||
cd rust
|
||||
cargo nextest archive --workspace --features artifact-graph --archive-file nextest-archive.tar.zst
|
||||
- name: Upload archive to workflow
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: nextest-archive
|
||||
path: rust/nextest-archive.tar.zst
|
||||
|
||||
run-test-artifacts:
|
||||
name: cargo test (shard ${{ matrix.partitionIndex}})
|
||||
runs-on:
|
||||
- runs-on=${{ github.run_id }}
|
||||
- runner=32cpu-linux-x64
|
||||
- extras=s3-cache
|
||||
needs: build-test-artifacts
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
partitionIndex: [1, 2, 3, 4, 5, 6]
|
||||
partitionTotal: [6]
|
||||
steps:
|
||||
- uses: runs-on/action@v1
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- name: Start Vector
|
||||
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
|
||||
env:
|
||||
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||
OS_NAME: ${{ env.OS_NAME }}
|
||||
- uses: taiki-e/install-action@nextest
|
||||
- name: Download archive
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nextest-archive
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |-
|
||||
cp nextest-archive.tar.zst rust/nextest-archive.tar.zst
|
||||
ls -lah
|
||||
cd rust
|
||||
cargo llvm-cov nextest --workspace --features artifact-graph --lcov --output-path lcov.info --retries=2 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
||||
cargo nextest run\
|
||||
--retries=2 --no-fail-fast -P ci --archive-file nextest-archive.tar.zst \
|
||||
--partition count:${{ matrix.partitionIndex}}/${{ matrix.partitionTotal }} \
|
||||
2>&1 | tee /tmp/github-actions.log
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
- name: Upload to codecov.io
|
||||
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{secrets.CODECOV_TOKEN}}
|
||||
fail_ci_if_error: true
|
||||
flags: rust
|
||||
verbose: true
|
||||
files: lcov.info
|
||||
|
||||
|
2
.github/workflows/e2e-tests.yml
vendored
2
.github/workflows/e2e-tests.yml
vendored
@ -277,7 +277,7 @@ jobs:
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
OS_NAME: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}
|
||||
name: playwright:electron:${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}:${{ matrix.shardIndex }}:${{ matrix.shardTotal }}
|
||||
name: playwright:electron:${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }} (shard ${{ matrix.shardIndex }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
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,17 +8,17 @@ Draw a line segment relative to the current origin using the polar measure of so
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
angledLine(
|
||||
sketch: Sketch,
|
||||
angle: number,
|
||||
length?: number,
|
||||
lengthX?: number,
|
||||
lengthY?: number,
|
||||
endAbsoluteX?: number,
|
||||
endAbsoluteY?: number,
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||
angle: [number](/docs/kcl/types/number),
|
||||
length?: [number](/docs/kcl/types/number),
|
||||
lengthX?: [number](/docs/kcl/types/number),
|
||||
lengthY?: [number](/docs/kcl/types/number),
|
||||
endAbsoluteX?: [number](/docs/kcl/types/number),
|
||||
endAbsoluteY?: [number](/docs/kcl/types/number),
|
||||
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||
): [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 |
|
||||
| `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 |
|
||||
| [`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
|
||||
|
||||
@ -42,7 +42,7 @@ angledLine(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> yLine(endAbsolute = 15)
|
||||
|
@ -8,14 +8,14 @@ Draw an angled line from the current origin, constructing a line segment such th
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
angledLineThatIntersects(
|
||||
sketch: Sketch,
|
||||
angle: number,
|
||||
intersectTag: TagIdentifier,
|
||||
offset?: number,
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||
angle: [number](/docs/kcl/types/number),
|
||||
intersectTag: [TagIdentifier](/docs/kcl/types#tag-identifier),
|
||||
offset?: [number](/docs/kcl/types/number),
|
||||
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||
): [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 |
|
||||
| `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 |
|
||||
| [`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
|
||||
|
||||
@ -36,7 +36,7 @@ angledLineThatIntersects(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> 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
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(
|
||||
actual: number,
|
||||
isGreaterThan?: number,
|
||||
isLessThan?: number,
|
||||
isGreaterThanOrEqual?: number,
|
||||
isLessThanOrEqual?: number,
|
||||
isEqualTo?: number,
|
||||
tolerance?: number,
|
||||
actual: [number](/docs/kcl/types/number),
|
||||
isGreaterThan?: [number](/docs/kcl/types/number),
|
||||
isLessThan?: [number](/docs/kcl/types/number),
|
||||
isGreaterThanOrEqual?: [number](/docs/kcl/types/number),
|
||||
isLessThanOrEqual?: [number](/docs/kcl/types/number),
|
||||
isEqualTo?: [number](/docs/kcl/types/number),
|
||||
tolerance?: [number](/docs/kcl/types/number),
|
||||
error?: String,
|
||||
): ()
|
||||
```
|
||||
@ -42,7 +42,7 @@ assert(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
n = 10
|
||||
assert(n, isEqualTo = 10)
|
||||
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,9 +8,9 @@ Asserts that a value is the boolean value true.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
assertIs(
|
||||
actual: bool,
|
||||
actual: [bool](/docs/kcl/types/bool),
|
||||
error?: String,
|
||||
): ()
|
||||
```
|
||||
@ -30,7 +30,7 @@ assertIs(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
kclIsFun = true
|
||||
assertIs(kclIsFun)
|
||||
```
|
||||
|
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,14 +8,14 @@ Draw a smooth, continuous, curved line segment from the current origin to the de
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
bezierCurve(
|
||||
sketch: Sketch,
|
||||
control1: [number],
|
||||
control2: [number],
|
||||
end: [number],
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||
control1: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
control2: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
end: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||
): [Sketch](/docs/kcl/types/Sketch)
|
||||
```
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ bezierCurve(
|
||||
| `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 |
|
||||
| `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
|
||||
|
||||
@ -36,7 +36,7 @@ bezierCurve(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|
File diff suppressed because one or more lines are too long
@ -8,14 +8,14 @@ Construct a circle derived from 3 points.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
circleThreePoint(
|
||||
sketchSurfaceOrGroup: SketchOrSurface,
|
||||
p1: [number],
|
||||
p2: [number],
|
||||
p3: [number],
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
sketchSurfaceOrGroup: [[Sketch](/docs/kcl/types/Sketch)OrSurface](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)OrSurface),
|
||||
p1: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
p2: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
p3: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||
): [Sketch](/docs/kcl/types/Sketch)
|
||||
```
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ circleThreePoint(
|
||||
| `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 |
|
||||
| `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
|
||||
|
||||
@ -36,7 +36,7 @@ circleThreePoint(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XY)
|
||||
|> circleThreePoint(p1 = [10, 10], p2 = [20, 8], p3 = [15, 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'
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ Identifies the starting face of an extrusion. I.e., the face which is extruded.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::START: string = 'start'
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::X
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::XY
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::XZ
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::Y
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::YZ
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::Z
|
||||
```
|
||||
|
||||
|
@ -8,13 +8,13 @@ The value of Euler’s number `e`.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::math::E: number = 2.71828182845904523536028747135266250_
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(
|
||||
|
@ -8,17 +8,17 @@ The value of `pi`, Archimedes’ constant (π).
|
||||
|
||||
|
||||
|
||||
```js
|
||||
std::math::PI: number = 3.14159265358979323846264338327950288_
|
||||
```kcl
|
||||
std::math::PI: number(_?) = 3.14159265358979323846264338327950288_?
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
circumference = 70
|
||||
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = circumference / (2 * PI))
|
||||
|> circle(center = [0, 0], radius = (circumference / (2 * PI)): number(mm))
|
||||
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
```
|
||||
|
@ -8,13 +8,13 @@ The value of `tau`, the full circle constant (τ). Equal to 2π.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::math::TAU: number = 6.28318530717958647692528676655900577_
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::turns::HALF_TURN: number(deg) = 180deg
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::turns::QUARTER_TURN: number(deg) = 90deg
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
std::turns::ZERO: number = 0
|
||||
```
|
||||
|
||||
|
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 @@ Get the shared edge between two faces.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
getCommonEdge(faces: [TagIdentifier]): Uuid
|
||||
```kcl
|
||||
getCommon[Edge](/docs/kcl/types/Edge)(faces: [[TagIdentifier](/docs/kcl/types#tag-identifier)]): Uuid
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ getCommonEdge(faces: [TagIdentifier]): Uuid
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
// 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
|
||||
getNextAdjacentEdge(edge: TagIdentifier): Uuid
|
||||
```kcl
|
||||
getNextAdjacent[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ getNextAdjacentEdge(edge: TagIdentifier): Uuid
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|
@ -8,8 +8,8 @@ Get the opposite edge to the edge given.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
getOppositeEdge(edge: TagIdentifier): Uuid
|
||||
```kcl
|
||||
getOpposite[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ getOppositeEdge(edge: TagIdentifier): Uuid
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|
@ -8,8 +8,8 @@ Get the previous adjacent edge to the edge given.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
getPreviousAdjacentEdge(edge: TagIdentifier): Uuid
|
||||
```kcl
|
||||
getPreviousAdjacent[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ getPreviousAdjacentEdge(edge: TagIdentifier): Uuid
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|
@ -30,24 +30,17 @@ layout: manual
|
||||
* [`Y`](kcl/consts/std-Y)
|
||||
* [`YZ`](kcl/consts/std-YZ)
|
||||
* [`Z`](kcl/consts/std-Z)
|
||||
* [`abs`](kcl/abs)
|
||||
* [`acos`](kcl/acos)
|
||||
* [`angledLine`](kcl/angledLine)
|
||||
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
||||
* [`appearance`](kcl/appearance)
|
||||
* [`arc`](kcl/arc)
|
||||
* [`asin`](kcl/asin)
|
||||
* [`assert`](kcl/assert)
|
||||
* [`assertIs`](kcl/assertIs)
|
||||
* [`atan`](kcl/atan)
|
||||
* [`atan2`](kcl/atan2)
|
||||
* [`bezierCurve`](kcl/bezierCurve)
|
||||
* [`ceil`](kcl/ceil)
|
||||
* [`circleThreePoint`](kcl/circleThreePoint)
|
||||
* [`clone`](kcl/clone)
|
||||
* [`close`](kcl/close)
|
||||
* [`extrude`](kcl/extrude)
|
||||
* [`floor`](kcl/floor)
|
||||
* [`getCommonEdge`](kcl/getCommonEdge)
|
||||
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
||||
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
||||
@ -61,14 +54,8 @@ layout: manual
|
||||
* [`legAngY`](kcl/legAngY)
|
||||
* [`legLen`](kcl/legLen)
|
||||
* [`line`](kcl/line)
|
||||
* [`ln`](kcl/ln)
|
||||
* [`loft`](kcl/loft)
|
||||
* [`log`](kcl/log)
|
||||
* [`log10`](kcl/log10)
|
||||
* [`log2`](kcl/log2)
|
||||
* [`map`](kcl/map)
|
||||
* [`max`](kcl/max)
|
||||
* [`min`](kcl/min)
|
||||
* [`offsetPlane`](kcl/std-offsetPlane)
|
||||
* [`patternCircular2d`](kcl/patternCircular2d)
|
||||
* [`patternCircular3d`](kcl/patternCircular3d)
|
||||
@ -78,16 +65,13 @@ layout: manual
|
||||
* [`patternTransform2d`](kcl/patternTransform2d)
|
||||
* [`polygon`](kcl/polygon)
|
||||
* [`pop`](kcl/pop)
|
||||
* [`pow`](kcl/pow)
|
||||
* [`profileStart`](kcl/profileStart)
|
||||
* [`profileStartX`](kcl/profileStartX)
|
||||
* [`profileStartY`](kcl/profileStartY)
|
||||
* [`push`](kcl/push)
|
||||
* [`reduce`](kcl/reduce)
|
||||
* [`rem`](kcl/rem)
|
||||
* [`revolve`](kcl/std-revolve)
|
||||
* [`rotate`](kcl/rotate)
|
||||
* [`round`](kcl/round)
|
||||
* [`scale`](kcl/scale)
|
||||
* [`segAng`](kcl/segAng)
|
||||
* [`segEnd`](kcl/segEnd)
|
||||
@ -97,7 +81,6 @@ layout: manual
|
||||
* [`segStart`](kcl/segStart)
|
||||
* [`segStartX`](kcl/segStartX)
|
||||
* [`segStartY`](kcl/segStartY)
|
||||
* [`sqrt`](kcl/sqrt)
|
||||
* [`startProfile`](kcl/startProfile)
|
||||
* [`startSketchOn`](kcl/startSketchOn)
|
||||
* [`subtract`](kcl/subtract)
|
||||
@ -105,14 +88,6 @@ layout: manual
|
||||
* [`sweep`](kcl/sweep)
|
||||
* [`tangentToEnd`](kcl/tangentToEnd)
|
||||
* [`tangentialArc`](kcl/tangentialArc)
|
||||
* [`toCentimeters`](kcl/std-toCentimeters)
|
||||
* [`toDegrees`](kcl/std-toDegrees)
|
||||
* [`toFeet`](kcl/std-toFeet)
|
||||
* [`toInches`](kcl/std-toInches)
|
||||
* [`toMeters`](kcl/std-toMeters)
|
||||
* [`toMillimeters`](kcl/std-toMillimeters)
|
||||
* [`toRadians`](kcl/std-toRadians)
|
||||
* [`toYards`](kcl/std-toYards)
|
||||
* [`translate`](kcl/translate)
|
||||
* [`union`](kcl/union)
|
||||
* [`xLine`](kcl/xLine)
|
||||
@ -121,9 +96,26 @@ layout: manual
|
||||
* [`E`](kcl/consts/std-math-E)
|
||||
* [`PI`](kcl/consts/std-math-PI)
|
||||
* [`TAU`](kcl/consts/std-math-TAU)
|
||||
* [`abs`](kcl/std-math-abs)
|
||||
* [`acos`](kcl/std-math-acos)
|
||||
* [`asin`](kcl/std-math-asin)
|
||||
* [`atan`](kcl/std-math-atan)
|
||||
* [`atan2`](kcl/std-math-atan2)
|
||||
* [`ceil`](kcl/std-math-ceil)
|
||||
* [`cos`](kcl/std-math-cos)
|
||||
* [`floor`](kcl/std-math-floor)
|
||||
* [`ln`](kcl/std-math-ln)
|
||||
* [`log`](kcl/std-math-log)
|
||||
* [`log10`](kcl/std-math-log10)
|
||||
* [`log2`](kcl/std-math-log2)
|
||||
* [`max`](kcl/std-math-max)
|
||||
* [`min`](kcl/std-math-min)
|
||||
* [`polar`](kcl/std-math-polar)
|
||||
* [`pow`](kcl/std-math-pow)
|
||||
* [`rem`](kcl/std-math-rem)
|
||||
* [`round`](kcl/std-math-round)
|
||||
* [`sin`](kcl/std-math-sin)
|
||||
* [`sqrt`](kcl/std-math-sqrt)
|
||||
* [`tan`](kcl/std-math-tan)
|
||||
* **std::sketch**
|
||||
* [`circle`](kcl/std-sketch-circle)
|
||||
@ -149,3 +141,12 @@ layout: manual
|
||||
* [`Point3d`](kcl/types/Point3d)
|
||||
* [`Sketch`](kcl/types/Sketch)
|
||||
* [`Solid`](kcl/types/Solid)
|
||||
* **std::units**
|
||||
* [`units::toCentimeters`](kcl/std-units-toCentimeters)
|
||||
* [`units::toDegrees`](kcl/std-units-toDegrees)
|
||||
* [`units::toFeet`](kcl/std-units-toFeet)
|
||||
* [`units::toInches`](kcl/std-units-toInches)
|
||||
* [`units::toMeters`](kcl/std-units-toMeters)
|
||||
* [`units::toMillimeters`](kcl/std-units-toMillimeters)
|
||||
* [`units::toRadians`](kcl/std-units-toRadians)
|
||||
* [`units::toYards`](kcl/std-units-toYards)
|
||||
|
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(
|
||||
sketch: Sketch,
|
||||
startRadius: number,
|
||||
endRadius: number,
|
||||
angle: number,
|
||||
reverse?: bool,
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||
startRadius: [number](/docs/kcl/types/number),
|
||||
endRadius: [number](/docs/kcl/types/number),
|
||||
angle: [number](/docs/kcl/types/number),
|
||||
reverse?: [bool](/docs/kcl/types/bool),
|
||||
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||
): [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 |
|
||||
| `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 |
|
||||
| [`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
|
||||
|
||||
@ -38,7 +38,7 @@ involuteCircular(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
a = 10
|
||||
b = 14
|
||||
startSketchOn(XZ)
|
||||
|
@ -8,8 +8,8 @@ Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
lastSegX(sketch: Sketch): number
|
||||
```kcl
|
||||
lastSegX(sketch: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number)
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ lastSegX(sketch: Sketch): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 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
|
||||
lastSegY(sketch: Sketch): number
|
||||
```kcl
|
||||
lastSegY(sketch: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number)
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ lastSegY(sketch: Sketch): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [5, 0])
|
||||
|
@ -8,11 +8,11 @@ Compute the angle of the given leg for x.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
legAngX(
|
||||
hypotenuse: number,
|
||||
leg: number,
|
||||
): number
|
||||
hypotenuse: [number](/docs/kcl/types/number),
|
||||
leg: [number](/docs/kcl/types/number),
|
||||
): [number](/docs/kcl/types/number)
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -34,7 +34,7 @@ legAngX(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
legAngX(hypotenuse = 5, leg = 3)
|
||||
```
|
||||
|
||||
|
@ -8,11 +8,11 @@ Compute the angle of the given leg for y.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
legAngY(
|
||||
hypotenuse: number,
|
||||
leg: number,
|
||||
): number
|
||||
hypotenuse: [number](/docs/kcl/types/number),
|
||||
leg: [number](/docs/kcl/types/number),
|
||||
): [number](/docs/kcl/types/number)
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -34,7 +34,7 @@ legAngY(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
legAngY(hypotenuse = 5, leg = 3)
|
||||
```
|
||||
|
||||
|
@ -8,11 +8,11 @@ Compute the length of the given leg.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
legLen(
|
||||
hypotenuse: number,
|
||||
leg: number,
|
||||
): number
|
||||
hypotenuse: [number](/docs/kcl/types/number),
|
||||
leg: [number](/docs/kcl/types/number),
|
||||
): [number](/docs/kcl/types/number)
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -34,7 +34,7 @@ legLen(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
legLen(hypotenuse = 5, leg = 3)
|
||||
```
|
||||
|
||||
|
@ -8,13 +8,13 @@ Extend the current sketch with a new straight line.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
line(
|
||||
sketch: Sketch,
|
||||
endAbsolute?: [number],
|
||||
end?: [number],
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
sketch: [Sketch](/docs/kcl/types/Sketch),
|
||||
endAbsolute?: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
end?: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
||||
): [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 |
|
||||
| `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 |
|
||||
| [`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
|
||||
|
||||
@ -34,7 +34,7 @@ line(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
triangle = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 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
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,15 +8,15 @@ Repeat a 2-dimensional sketch some number of times along a partial or complete c
|
||||
|
||||
|
||||
|
||||
```js
|
||||
```kcl
|
||||
patternCircular2d(
|
||||
sketchSet: [Sketch],
|
||||
sketchSet: [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)),
|
||||
instances: integer,
|
||||
center: [number],
|
||||
arcDegrees: number,
|
||||
rotateDuplicates: bool,
|
||||
useOriginal?: bool,
|
||||
): [Sketch]
|
||||
center: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
arcDegrees: [number](/docs/kcl/types/number),
|
||||
rotateDuplicates: [bool](/docs/kcl/types/bool),
|
||||
useOriginal?: [bool](/docs/kcl/types/bool),
|
||||
): [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch))
|
||||
```
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ patternCircular2d(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [.5, 25])
|
||||
|> 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(
|
||||
solids: [Solid],
|
||||
solids: [[[Solid](/docs/kcl/types/Solid)]](/docs/kcl/types/[Solid](/docs/kcl/types/Solid)),
|
||||
instances: integer,
|
||||
axis: [number],
|
||||
center: [number],
|
||||
arcDegrees: number,
|
||||
rotateDuplicates: bool,
|
||||
useOriginal?: bool,
|
||||
): [Solid]
|
||||
axis: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
center: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
arcDegrees: [number](/docs/kcl/types/number),
|
||||
rotateDuplicates: [bool](/docs/kcl/types/bool),
|
||||
useOriginal?: [bool](/docs/kcl/types/bool),
|
||||
): [[[Solid](/docs/kcl/types/Solid)]](/docs/kcl/types/[Solid](/docs/kcl/types/Solid))
|
||||
```
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ patternCircular3d(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> 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(
|
||||
sketches: [Sketch],
|
||||
sketches: [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)),
|
||||
instances: integer,
|
||||
distance: number,
|
||||
axis: [number],
|
||||
useOriginal?: bool,
|
||||
): [Sketch]
|
||||
distance: [number](/docs/kcl/types/number),
|
||||
axis: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)),
|
||||
useOriginal?: [bool](/docs/kcl/types/bool),
|
||||
): [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch))
|
||||
```
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ patternLinear2d(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = 1)
|
||||
|> 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(
|
||||
sketches: [Sketch],
|
||||
sketches: [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)),
|
||||
instances: integer,
|
||||
transform: FunctionSource,
|
||||
useOriginal?: bool,
|
||||
): [Sketch]
|
||||
useOriginal?: [bool](/docs/kcl/types/bool),
|
||||
): [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch))
|
||||
```
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ patternTransform2d(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
// Each instance will be shifted along the X axis.
|
||||
fn transform(id) {
|
||||
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.
|
||||
|
||||
```js
|
||||
pop(array: [KclValue]): KclValue
|
||||
```kcl
|
||||
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
|
||||
|
||||
```js
|
||||
```kcl
|
||||
arr = [1, 2, 3, 4]
|
||||
new_arr = pop(arr)
|
||||
assert(
|
||||
|
File diff suppressed because one or more lines are too long
@ -8,8 +8,8 @@ Extract the provided 2-dimensional sketch's profile's origin value.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
profileStart(profile: Sketch): [number]
|
||||
```kcl
|
||||
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
|
||||
|
||||
```js
|
||||
```kcl
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5, 2])
|
||||
|> 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
|
||||
profileStartX(profile: Sketch): number
|
||||
```kcl
|
||||
profileStartX(profile: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number)
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ profileStartX(profile: Sketch): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5, 2])
|
||||
|> angledLine(angle = -26.6, length = 50)
|
||||
|
@ -8,8 +8,8 @@ Extract the provided 2-dimensional sketch's profile's origin's 'y' value.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
profileStartY(profile: Sketch): number
|
||||
```kcl
|
||||
profileStartY(profile: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number)
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ profileStartY(profile: Sketch): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5, 2])
|
||||
|> 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.
|
||||
|
||||
```js
|
||||
```kcl
|
||||
push(
|
||||
array: [KclValue],
|
||||
item: KclValue,
|
||||
): KclValue
|
||||
array: [[[KclValue](/docs/kcl/types/KclValue)]](/docs/kcl/types/[KclValue](/docs/kcl/types/KclValue)),
|
||||
item: [KclValue](/docs/kcl/types/KclValue),
|
||||
): [KclValue](/docs/kcl/types/KclValue)
|
||||
```
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ push(
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
arr = [1, 2, 3]
|
||||
new_arr = push(arr, item = 4)
|
||||
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
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
|
||||
segAng(tag: TagIdentifier): number
|
||||
```kcl
|
||||
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 |
|
||||
|----------|------|-------------|----------|
|
||||
| [`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
|
||||
|
||||
@ -26,7 +26,7 @@ segAng(tag: TagIdentifier): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|
@ -8,8 +8,8 @@ Compute the ending point of the provided line segment.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
segEnd(tag: TagIdentifier): [number]
|
||||
```kcl
|
||||
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 |
|
||||
|----------|------|-------------|----------|
|
||||
| [`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
|
||||
|
||||
@ -26,7 +26,7 @@ segEnd(tag: TagIdentifier): [number]
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
w = 15
|
||||
cube = startSketchOn(XY)
|
||||
|> startProfile(at = [0, 0])
|
||||
|
@ -8,8 +8,8 @@ Compute the ending point of the provided line segment along the 'x' axis.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
segEndX(tag: TagIdentifier): number
|
||||
```kcl
|
||||
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 |
|
||||
|----------|------|-------------|----------|
|
||||
| [`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
|
||||
|
||||
@ -26,7 +26,7 @@ segEndX(tag: TagIdentifier): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [20, 0], tag = $thing)
|
||||
|
@ -8,8 +8,8 @@ Compute the ending point of the provided line segment along the 'y' axis.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
segEndY(tag: TagIdentifier): number
|
||||
```kcl
|
||||
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 |
|
||||
|----------|------|-------------|----------|
|
||||
| [`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
|
||||
|
||||
@ -26,7 +26,7 @@ segEndY(tag: TagIdentifier): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [20, 0])
|
||||
|
@ -8,8 +8,8 @@ Compute the length of the provided line segment.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
segLen(tag: TagIdentifier): number
|
||||
```kcl
|
||||
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 |
|
||||
|----------|------|-------------|----------|
|
||||
| [`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
|
||||
|
||||
@ -26,7 +26,7 @@ segLen(tag: TagIdentifier): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 60, length = 10, tag = $thing)
|
||||
|
@ -8,8 +8,8 @@ Compute the starting point of the provided line segment.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
segStart(tag: TagIdentifier): [number]
|
||||
```kcl
|
||||
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 |
|
||||
|----------|------|-------------|----------|
|
||||
| [`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
|
||||
|
||||
@ -26,7 +26,7 @@ segStart(tag: TagIdentifier): [number]
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
w = 15
|
||||
cube = startSketchOn(XY)
|
||||
|> startProfile(at = [0, 0])
|
||||
|
@ -8,8 +8,8 @@ Compute the starting point of the provided line segment along the 'x' axis.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
segStartX(tag: TagIdentifier): number
|
||||
```kcl
|
||||
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 |
|
||||
|----------|------|-------------|----------|
|
||||
| [`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
|
||||
|
||||
@ -26,7 +26,7 @@ segStartX(tag: TagIdentifier): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [20, 0], tag = $thing)
|
||||
|
@ -8,8 +8,8 @@ Compute the starting point of the provided line segment along the 'y' axis.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
segStartY(tag: TagIdentifier): number
|
||||
```kcl
|
||||
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 |
|
||||
|----------|------|-------------|----------|
|
||||
| [`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
|
||||
|
||||
@ -26,7 +26,7 @@ segStartY(tag: TagIdentifier): number
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 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
File diff suppressed because one or more lines are too long
51
docs/kcl/std-math-abs.md
Normal file
51
docs/kcl/std-math-abs.md
Normal file
File diff suppressed because one or more lines are too long
45
docs/kcl/std-math-acos.md
Normal file
45
docs/kcl/std-math-acos.md
Normal file
File diff suppressed because one or more lines are too long
44
docs/kcl/std-math-asin.md
Normal file
44
docs/kcl/std-math-asin.md
Normal file
File diff suppressed because one or more lines are too long
43
docs/kcl/std-math-atan.md
Normal file
43
docs/kcl/std-math-atan.md
Normal file
@ -0,0 +1,43 @@
|
||||
---
|
||||
title: "std::math::atan"
|
||||
excerpt: "Compute the arctangent of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Compute the arctangent of a number.
|
||||
|
||||
Consider using `atan2()` instead for the true inverse of tangent.
|
||||
|
||||
```kcl
|
||||
atan(@num: [number](/docs/kcl/types/number)(_)): [number](/docs/kcl/types/number)(rad)
|
||||
```
|
||||
|
||||
|
||||
### Arguments
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(_)` | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(rad)`
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
```kcl
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(
|
||||
angle = atan(1.25),
|
||||
length = 20,
|
||||
)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
```
|
||||
|
||||
|
||||
|
48
docs/kcl/std-math-atan2.md
Normal file
48
docs/kcl/std-math-atan2.md
Normal file
File diff suppressed because one or more lines are too long
42
docs/kcl/std-math-ceil.md
Normal file
42
docs/kcl/std-math-ceil.md
Normal file
File diff suppressed because one or more lines are too long
@ -1,15 +1,15 @@
|
||||
---
|
||||
title: "std::math::cos"
|
||||
excerpt: "Compute the cosine of a number (in radians)."
|
||||
excerpt: "Compute the cosine of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Compute the cosine of a number (in radians).
|
||||
Compute the cosine of a number.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
cos(@num: number(Angle)): number(_)
|
||||
```kcl
|
||||
cos(@num: [number](/docs/kcl/types/number)(Angle)): [number](/docs/kcl/types/number)(_)
|
||||
```
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ cos(@num: number(Angle)): number(_)
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user