Compare commits

..

7 Commits

Author SHA1 Message Date
0e02e95c55 Merge branch 'main' into wip-multi-profile 2024-06-22 09:26:06 -07:00
a94f0191b5 fix tests
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-21 22:22:47 -07:00
99655d623e updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-21 21:59:10 -07:00
4d7cac6c1d add code mods for surfaces
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-21 21:57:51 -07:00
59ed422907 fmt
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-21 21:51:39 -07:00
3b30ac7d39 Merge branch 'main' into wip-multi-profile 2024-06-21 21:49:54 -07:00
41a6ddd769 updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

more

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-21 20:20:31 -07:00
240 changed files with 11846 additions and 116112 deletions

View File

@ -4,8 +4,7 @@
"project": "./tsconfig.json" "project": "./tsconfig.json"
}, },
"plugins": [ "plugins": [
"css-modules", "css-modules"
"suggest-no-throw",
], ],
"extends": [ "extends": [
"react-app", "react-app",
@ -18,7 +17,6 @@
"never" "never"
], ],
"react-hooks/exhaustive-deps": "off", "react-hooks/exhaustive-deps": "off",
"suggest-no-throw/suggest-no-throw": "warn",
}, },
"overrides": [ "overrides": [
{ {
@ -27,12 +25,6 @@
"@typescript-eslint/no-floating-promises": "warn", "@typescript-eslint/no-floating-promises": "warn",
"testing-library/prefer-screen-queries": "off" "testing-library/prefer-screen-queries": "off"
} }
},
{
"files": ["src/**/*.test.ts"],
"rules": {
"suggest-no-throw/suggest-no-throw": "off",
}
} }
] ]
} }

View File

@ -38,7 +38,5 @@ jobs:
- name: Benchmark kcl library - name: Benchmark kcl library
shell: bash shell: bash
run: |- run: |-
cd src/wasm-lib/kcl; cargo bench --all-features -- iai cd src/wasm-lib/kcl; cargo bench -- iai
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}

View File

@ -367,7 +367,7 @@ jobs:
export VITE_KC_API_BASE_URL export VITE_KC_API_BASE_URL
xvfb-run yarn test:e2e:tauri xvfb-run yarn test:e2e:tauri
env: env:
E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/app" E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/zoo-modeling-app"
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }} KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
- name: Run e2e tests (windows only) - name: Run e2e tests (windows only)
@ -376,7 +376,7 @@ jobs:
cargo install tauri-driver --force cargo install tauri-driver --force
yarn wdio run wdio.conf.ts yarn wdio run wdio.conf.ts
env: env:
E2E_APPLICATION: ".\\src-tauri\\target\\${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}\\app.exe" E2E_APPLICATION: ".\\src-tauri\\target\\${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}\\Zoo Modeling App.exe"
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }} KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
VITE_KC_API_BASE_URL: ${{ env.BUILD_RELEASE == 'true' && 'https://api.zoo.dev' || 'https://api.dev.zoo.dev' }} VITE_KC_API_BASE_URL: ${{ env.BUILD_RELEASE == 'true' && 'https://api.zoo.dev' || 'https://api.dev.zoo.dev' }}
E2E_TAURI_ENABLED: true E2E_TAURI_ENABLED: true

View File

@ -38,8 +38,6 @@ jobs:
runs-on: ubuntu-latest-8-cores runs-on: ubuntu-latest-8-cores
needs: check-rust-changes needs: check-rust-changes
steps: steps:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
@ -92,24 +90,26 @@ jobs:
- name: build web - name: build web
run: yarn build:local run: yarn build:local
- name: Run ubuntu/chrome snapshots - name: Run ubuntu/chrome snapshots
continue-on-error: true run: yarn playwright test --project="Google Chrome" --update-snapshots e2e/playwright/snapshot-tests.spec.ts
run: |
yarn playwright test --project="Google Chrome" --update-snapshots e2e/playwright/snapshot-tests.spec.ts
env: env:
CI: true CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }} snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
- name: Clean up test-results - uses: actions/upload-artifact@v3
if: always() if: always()
continue-on-error: true with:
run: rm -r test-results name: playwright-report
path: playwright-report/
retention-days: 30
- name: check for changes - name: check for changes
id: git-check id: git-check
run: | run: |
git add . git add .
if git status | grep -q "Changes to be committed" if git status | grep -q "Changes to be committed"
then echo "modified=true" >> $GITHUB_OUTPUT then
else echo "modified=false" >> $GITHUB_OUTPUT echo "::set-output name=modified::true"
else
echo "::set-output name=modified::false"
fi fi
- name: Commit changes, if any - name: Commit changes, if any
if: steps.git-check.outputs.modified == 'true' if: steps.git-check.outputs.modified == 'true'
@ -125,63 +125,23 @@ jobs:
git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true
git push git push
git push origin ${{ github.head_ref }} git push origin ${{ github.head_ref }}
# only upload artifacts if there's actually changes
- uses: actions/upload-artifact@v4
if: steps.git-check.outputs.modified == 'true'
with:
name: playwright-report-ubuntu-${{ github.sha }}
path: playwright-report/
retention-days: 30
# if have previous run results, use them
- uses: actions/download-artifact@v4
if: always()
continue-on-error: true
with:
name: test-results-ubuntu-${{ github.sha }}
path: test-results/
- name: Run ubuntu/chrome flow retry failures
id: retry
if: always()
run: |
if [[ -d "test-results" ]];
then if [[ $(ls -1 "test-results" | wc -l) != "0" ]];
then echo "retried=true" >> $GITHUB_OUTPUT;
else echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
fi;
else echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
fi;
yarn playwright test --project="Google Chrome" --last-failed e2e/playwright/flow-tests.spec.ts
env:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- name: Run ubuntu/chrome flow - name: Run ubuntu/chrome flow
if: steps.retry.outputs.retried == 'false'
run: yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts run: yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts
env: env:
CI: true CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3
if: always() if: always()
with: with:
name: test-results-ubuntu-${{ github.sha }} name: playwright-report-ubuntu
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-ubuntu-${{ github.sha }}
path: playwright-report/ path: playwright-report/
retention-days: 30 retention-days: 30
overwrite: true
playwright-macos: playwright-macos:
timeout-minutes: 60 timeout-minutes: 60
runs-on: macos-14-large runs-on: macos-14
needs: check-rust-changes needs: check-rust-changes
steps: steps:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
@ -234,48 +194,16 @@ jobs:
run: yarn build:wasm run: yarn build:wasm
- name: build web - name: build web
run: yarn build:local run: yarn build:local
# if have previous run results, use them
- uses: actions/download-artifact@v4
if: ${{ always() }}
continue-on-error: true
with:
name: test-results-macos-${{ github.sha }}
path: test-results/
- name: Run macos/safari flow retry failures
id: retry
if: always()
run: |
if [[ -d "test-results" ]];
then if [[ $(ls -1 "test-results" | wc -l) != "0" ]];
then echo "retried=true" >> $GITHUB_OUTPUT;
else echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
fi;
else echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
fi;
yarn playwright test --project="webkit" --last-failed e2e/playwright/flow-tests.spec.ts
env:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- name: Run macos/safari flow - name: Run macos/safari flow
if: steps.retry.outputs.retried == 'false'
# webkit doesn't work on Ubuntu because of the same reason tauri doesn't (webRTC issues) # webkit doesn't work on Ubuntu because of the same reason tauri doesn't (webRTC issues)
# TODO remove this and the matrix and run all tests on ubuntu when this is fixed # TODO remove this and the matrix and run all tests on ubuntu when this is fixed
run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts
env: env:
CI: true CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3
if: ${{ always() }} if: always()
with: with:
name: test-results-macos-${{ github.sha }} name: playwright-report-macos
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: playwright-report-macos-${{ github.sha }}
path: playwright-report/ path: playwright-report/
retention-days: 30 retention-days: 30
overwrite: true

View File

@ -1,17 +1,14 @@
.PHONY: dev .PHONY: dev
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs) WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs)
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
dev: node_modules public/wasm_lib_bg.wasm $(XSTATE_TYPEGENS) dev: node_modules public/wasm_lib_bg.wasm
yarn start yarn start
$(XSTATE_TYPEGENS): $(TS_SRC)
yarn xstate typegen 'src/**/*.ts?(x)'
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES) public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
yarn build:wasm-dev yarn build:wasm-dev
node_modules: package.json yarn.lock node_modules: package.json
package.json:
yarn install yarn install

View File

@ -89,6 +89,25 @@ enable third-party cookies. You can enable third-party cookies by clicking on
the eye with a slash through it in the URL bar, and clicking on "Enable the eye with a slash through it in the URL bar, and clicking on "Enable
Third-Party Cookies". Third-Party Cookies".
## Running tests
First, start the dev server following "Running a development build" above.
Then in another terminal tab, run:
```
yarn test
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro/) tests, in interactive mode by default.
For running the rust (not tauri rust though) only, you can
```bash
cd src/wasm-lib
cargo test
```
## Tauri ## Tauri
To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then
@ -176,9 +195,7 @@ $ cargo +nightly fuzz run parser
For more information on fuzzing you can check out For more information on fuzzing you can check out
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html). [this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
## Tests ### Playwright
### Playwright tests
For a portable way to run Playwright you'll need Docker. For a portable way to run Playwright you'll need Docker.
@ -267,37 +284,6 @@ Where `./store` should look like this
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use. However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
### Unit and component tests
If you already haven't, run the following:
```
yarn
yarn build:wasm
yarn start
```
and finally:
```
yarn test:nowatch
```
For individual testing:
```
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro/) tests, in interactive mode by default.
### Rust tests
```bash
cd src/wasm-lib
cargo test
```
#### Some notes on CI #### Some notes on CI
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend. The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.

View File

@ -17,13 +17,4 @@ once fixed in engine will just start working here with no language changes.
currently move or transform the imported objects at all, once we have assemblies currently move or transform the imported objects at all, once we have assemblies
this will work. this will work.
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet - **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet cases work currently.
cases work currently.
- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple
chamfer cases work currently.
Sketching on the chamfered face does not currently work.
- **Shell**: Shell is only working for `end` faces, not for `side` or `start`
faces. We are tracking the engine side bug on this.

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for x.
```js ```js
angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,8 +17,11 @@ angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: Sketc
```js ```js
const sketch001 = startSketchOn('XZ') const sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([2, 5], %, $seg01) |> line([2, 5], %, 'seg01')
|> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %) |> angledLineToX([
-angleToMatchLengthX('seg01', 7, %),
10
], %)
|> close(%) |> close(%)
const extrusion = extrude(5, sketch001) const extrusion = extrude(5, sketch001)
@ -28,12 +31,7 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `to`: `number` (REQUIRED) * `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
@ -73,181 +71,10 @@ const extrusion = extrude(5, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -274,12 +101,8 @@ const extrusion = extrude(5, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -287,12 +110,8 @@ const extrusion = extrude(5, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -304,12 +123,8 @@ const extrusion = extrude(5, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -317,12 +132,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -330,12 +141,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -345,12 +152,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -362,12 +165,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for y.
```js ```js
angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,9 +17,9 @@ angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: Sketc
```js ```js
const sketch001 = startSketchOn('XZ') const sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([1, 2], %, $seg01) |> line([1, 2], %, 'seg01')
|> angledLine({ |> angledLine({
angle: angleToMatchLengthY(seg01, 15, %), angle: angleToMatchLengthY('seg01', 15, %),
length: 5 length: 5
}, %) }, %)
|> yLineTo(0, %) |> yLineTo(0, %)
@ -32,12 +32,7 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `to`: `number` (REQUIRED) * `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
@ -77,181 +72,10 @@ const extrusion = extrude(5, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -278,12 +102,8 @@ const extrusion = extrude(5, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -291,12 +111,8 @@ const extrusion = extrude(5, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -308,12 +124,8 @@ const extrusion = extrude(5, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -321,12 +133,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,12 +142,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -349,12 +153,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -366,12 +166,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line.
```js ```js
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -78,181 +78,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -279,12 +108,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -292,12 +117,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -309,12 +130,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -322,12 +139,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -335,12 +148,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -350,12 +159,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -367,26 +172,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -428,181 +222,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -629,12 +252,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -642,12 +261,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -659,12 +274,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -672,12 +283,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -685,12 +292,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -700,12 +303,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -717,12 +316,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line of a given x length.
```js ```js
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -17,10 +17,10 @@ angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDe
```js ```js
const sketch001 = startSketchOn('XZ') const sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLineOfXLength({ angle: 45, length: 10 }, %, $edge1) |> angledLineOfXLength({ angle: 45, length: 10 }, %, "edge1")
|> angledLineOfXLength({ angle: -15, length: 20 }, %, $edge2) |> angledLineOfXLength({ angle: -15, length: 20 }, %, "edge2")
|> line([0, -5], %) |> line([0, -5], %)
|> close(%, $edge3) |> close(%, "edge3")
const extrusion = extrude(10, sketch001) const extrusion = extrude(10, sketch001)
``` ```
@ -77,181 +77,10 @@ const extrusion = extrude(10, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -278,12 +107,8 @@ const extrusion = extrude(10, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -291,12 +116,8 @@ const extrusion = extrude(10, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -308,12 +129,8 @@ const extrusion = extrude(10, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -321,12 +138,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,12 +147,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -349,12 +158,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -366,26 +171,15 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -427,181 +221,10 @@ const extrusion = extrude(10, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -628,12 +251,8 @@ const extrusion = extrude(10, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -641,12 +260,8 @@ const extrusion = extrude(10, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -658,12 +273,8 @@ const extrusion = extrude(10, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -671,12 +282,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -684,12 +291,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -699,12 +302,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -716,12 +315,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line of a given y length.
```js ```js
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -79,181 +79,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -280,12 +109,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -293,12 +118,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -310,12 +131,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -323,12 +140,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -336,12 +149,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -351,12 +160,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -368,26 +173,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -429,181 +223,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -630,12 +253,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -643,12 +262,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -660,12 +275,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -673,12 +284,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -686,12 +293,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -701,12 +304,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -718,12 +317,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line that intersects with a given line.
```js ```js
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -18,7 +18,7 @@ angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: Sketc
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> lineTo([5, 10], %) |> lineTo([5, 10], %)
|> lineTo([-10, 10], %, $lineToIntersect) |> lineTo([-10, 10], %, "lineToIntersect")
|> lineTo([0, 20], %) |> lineTo([0, 20], %)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: 80, angle: 80,
@ -40,9 +40,7 @@ const example = extrude(10, exampleSketch)
// The angle of the line. // The angle of the line.
angle: number, angle: number,
// The tag of the line to intersect with. // The tag of the line to intersect with.
intersectTag: { intersectTag: string,
value: string,
},
// The offset from the intersecting line. // The offset from the intersecting line.
offset: number, offset: number,
} }
@ -85,181 +83,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -286,12 +113,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -299,12 +122,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -316,12 +135,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -329,12 +144,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -342,12 +153,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -357,12 +164,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -374,26 +177,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -435,181 +227,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -636,12 +257,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -649,12 +266,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -666,12 +279,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -679,12 +288,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -692,12 +297,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -707,12 +308,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -724,12 +321,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line to a given x coordinate.
```js ```js
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -76,181 +76,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -277,12 +106,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -290,12 +115,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -307,12 +128,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -320,12 +137,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -333,12 +146,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -348,12 +157,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -365,26 +170,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -426,181 +220,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -627,12 +250,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -640,12 +259,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -657,12 +272,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -670,12 +281,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -683,12 +290,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -698,12 +301,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -715,12 +314,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line to a given y coordinate.
```js ```js
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -76,181 +76,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -277,12 +106,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -290,12 +115,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -307,12 +128,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -320,12 +137,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -333,12 +146,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -348,12 +157,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -365,26 +170,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -426,181 +220,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -627,12 +250,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -640,12 +259,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -657,12 +272,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -670,12 +281,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -683,12 +290,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -698,12 +301,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -715,12 +314,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
arc(data: ArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -87,181 +87,10 @@ const exampleSketch = startSketchOn('XZ')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -288,12 +117,8 @@ const exampleSketch = startSketchOn('XZ')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -301,12 +126,8 @@ const exampleSketch = startSketchOn('XZ')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -318,12 +139,8 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -331,12 +148,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -344,12 +157,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -359,12 +168,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -376,26 +181,15 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -437,181 +231,10 @@ const exampleSketch = startSketchOn('XZ')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -638,12 +261,8 @@ const exampleSketch = startSketchOn('XZ')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -651,12 +270,8 @@ const exampleSketch = startSketchOn('XZ')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -668,12 +283,8 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -681,12 +292,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -694,12 +301,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -709,12 +312,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -726,12 +325,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a bezier curve.
```js ```js
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -82,181 +82,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -283,12 +112,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -296,12 +121,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -313,12 +134,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -326,12 +143,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -339,12 +152,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -354,12 +163,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -371,26 +176,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -432,181 +226,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -633,12 +256,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -646,12 +265,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -663,12 +278,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -676,12 +287,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -689,12 +296,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -704,12 +307,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -721,12 +320,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Create chamfers on tagged paths.
```js ```js
chamfer(data: ChamferData, extrude_group: ExtrudeGroup, tag?: TagDeclarator) -> ExtrudeGroup chamfer(data: ChamferData, extrude_group: ExtrudeGroup) -> ExtrudeGroup
``` ```
### Examples ### Examples
@ -22,19 +22,19 @@ const chamferLength = 2
const mountingPlateSketch = startSketchOn("XY") const mountingPlateSketch = startSketchOn("XY")
|> startProfileAt([-width / 2, -length / 2], %) |> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %, $edge1) |> lineTo([width / 2, -length / 2], %, 'edge1')
|> lineTo([width / 2, length / 2], %, $edge2) |> lineTo([width / 2, length / 2], %, 'edge2')
|> lineTo([-width / 2, length / 2], %, $edge3) |> lineTo([-width / 2, length / 2], %, 'edge3')
|> close(%, $edge4) |> close(%, 'edge4')
const mountingPlate = extrude(thickness, mountingPlateSketch) const mountingPlate = extrude(thickness, mountingPlateSketch)
|> chamfer({ |> chamfer({
length: chamferLength, length: chamferLength,
tags: [ tags: [
getNextAdjacentEdge(edge1, %), getNextAdjacentEdge('edge1', %),
getNextAdjacentEdge(edge2, %), getNextAdjacentEdge('edge2', %),
getNextAdjacentEdge(edge3, %), getNextAdjacentEdge('edge3', %),
getNextAdjacentEdge(edge4, %) getNextAdjacentEdge('edge4', %)
] ]
}, %) }, %)
``` ```
@ -50,9 +50,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
length: number, length: number,
// The tags of the paths you want to chamfer. // The tags of the paths you want to chamfer.
tags: [uuid | tags: [uuid |
{ string],
value: string,
}],
} }
``` ```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
@ -60,28 +58,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -123,74 +99,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -217,12 +129,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -230,12 +138,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -247,12 +151,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -260,12 +160,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -273,12 +169,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -288,12 +180,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -305,12 +193,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -324,14 +208,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -339,26 +219,14 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -367,28 +235,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -430,74 +276,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -524,12 +306,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -537,12 +315,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -554,12 +328,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -567,12 +337,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -580,12 +346,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -595,12 +357,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -612,12 +370,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -631,14 +385,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -646,14 +396,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Sketch a circle.
```js ```js
circle(center: [number], radius: number, sketch_surface_or_group: SketchSurfaceOrGroup, tag?: TagDeclarator) -> SketchGroup circle(center: [number], radius: number, tag?: String, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup
``` ```
### Examples ### Examples
@ -41,6 +41,7 @@ const example = extrude(5, exampleSketch)
* `center`: `[number]` (REQUIRED) * `center`: `[number]` (REQUIRED)
* `radius`: `number` (REQUIRED) * `radius`: `number` (REQUIRED)
* `tag`: `String` (OPTIONAL)
* `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED) * `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED)
```js ```js
{ {
@ -75,181 +76,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -308,74 +138,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -402,12 +168,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -415,12 +177,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -432,12 +190,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -445,12 +199,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -458,12 +208,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -473,12 +219,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -490,26 +232,14 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -551,181 +281,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -752,12 +311,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -765,12 +320,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -782,12 +333,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -795,12 +342,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -808,12 +351,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -823,12 +362,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -840,12 +375,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Close the current sketch.
```js ```js
close(sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup close(sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -77,181 +77,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -278,12 +107,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -291,12 +116,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -308,12 +129,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -321,12 +138,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,12 +147,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -349,12 +158,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -366,26 +171,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -427,181 +221,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -628,12 +251,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -641,12 +260,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -658,12 +273,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -671,12 +282,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -684,12 +291,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -699,12 +302,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -716,12 +315,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -102,181 +102,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -303,12 +132,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -317,12 +142,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -334,12 +155,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -347,12 +164,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -360,12 +173,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -375,12 +184,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -392,12 +197,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -415,28 +216,6 @@ const example = extrude(10, exampleSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -478,74 +257,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -572,12 +287,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -585,12 +296,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -602,12 +309,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -615,12 +318,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -628,12 +327,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -643,12 +338,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -660,12 +351,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -680,14 +367,10 @@ const example = extrude(10, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -695,14 +378,10 @@ const example = extrude(10, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} | } |

View File

@ -22,19 +22,19 @@ const filletRadius = 2
const mountingPlateSketch = startSketchOn("XY") const mountingPlateSketch = startSketchOn("XY")
|> startProfileAt([-width / 2, -length / 2], %) |> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %, $edge1) |> lineTo([width / 2, -length / 2], %, 'edge1')
|> lineTo([width / 2, length / 2], %, $edge2) |> lineTo([width / 2, length / 2], %, 'edge2')
|> lineTo([-width / 2, length / 2], %, $edge3) |> lineTo([-width / 2, length / 2], %, 'edge3')
|> close(%, $edge4) |> close(%, 'edge4')
const mountingPlate = extrude(thickness, mountingPlateSketch) const mountingPlate = extrude(thickness, mountingPlateSketch)
|> fillet({ |> fillet({
radius: filletRadius, radius: filletRadius,
tags: [ tags: [
getNextAdjacentEdge(edge1, %), getNextAdjacentEdge('edge1', %),
getNextAdjacentEdge(edge2, %), getNextAdjacentEdge('edge2', %),
getNextAdjacentEdge(edge3, %), getNextAdjacentEdge('edge3', %),
getNextAdjacentEdge(edge4, %) getNextAdjacentEdge('edge4', %)
] ]
}, %) }, %)
``` ```
@ -50,9 +50,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
radius: number, radius: number,
// The tags of the paths you want to fillet. // The tags of the paths you want to fillet.
tags: [uuid | tags: [uuid |
{ string],
value: string,
}],
} }
``` ```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
@ -60,28 +58,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -123,74 +99,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -217,12 +129,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -230,12 +138,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -247,12 +151,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -260,12 +160,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -273,12 +169,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -288,12 +180,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -305,12 +193,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -324,14 +208,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -339,14 +219,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }
@ -359,28 +235,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -422,74 +276,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -516,12 +306,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -529,12 +315,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -546,12 +328,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -559,12 +337,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -572,12 +346,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -587,12 +357,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -604,12 +370,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -623,14 +385,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -638,14 +396,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Get an edge on a 3D solid.
```js ```js
getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -17,7 +17,7 @@ getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
```js ```js
const box = startSketchOn('XZ') const box = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 10], %, $revolveAxis) |> line([0, 10], %, 'revolveAxis')
|> line([10, 0], %) |> line([10, 0], %)
|> line([0, -10], %) |> line([0, -10], %)
|> close(%) |> close(%)
@ -30,7 +30,7 @@ const revolution = startSketchOn(box, "revolveAxis")
|> line([0, -10], %) |> line([0, -10], %)
|> close(%) |> close(%)
|> revolve({ |> revolve({
axis: getEdge(revolveAxis, box), axis: getEdge('revolveAxis', box),
angle: 90 angle: 90
}, %) }, %)
``` ```
@ -39,39 +39,12 @@ const revolution = startSketchOn(box, "revolveAxis")
### Arguments ### Arguments
* `tag`: `TagIdentifier` (REQUIRED) * `tag`: `String` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -113,74 +86,10 @@ const revolution = startSketchOn(box, "revolveAxis")
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -207,12 +116,8 @@ const revolution = startSketchOn(box, "revolveAxis")
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -220,12 +125,8 @@ const revolution = startSketchOn(box, "revolveAxis")
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -237,12 +138,8 @@ const revolution = startSketchOn(box, "revolveAxis")
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -250,12 +147,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -263,12 +156,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -278,12 +167,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -295,12 +180,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -314,14 +195,10 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -329,14 +206,10 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
```js ```js
getNextAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -21,13 +21,15 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 60, length: 10 }, %) |> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %) |> angledLine({ angle: 120, length: 10 }, %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge) |> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
|> fillet({ |> fillet({
radius: 3, radius: 3,
tags: [getNextAdjacentEdge(referenceEdge, %)] tags: [
getNextAdjacentEdge("referenceEdge", %)
]
}, %) }, %)
``` ```
@ -35,39 +37,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `TagIdentifier` (REQUIRED) * `tag`: `String` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -109,74 +84,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -203,12 +114,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -216,12 +123,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -233,12 +136,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -246,12 +145,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -259,12 +154,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -274,12 +165,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -291,12 +178,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -310,14 +193,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -325,14 +204,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
```js ```js
getOppositeEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -21,13 +21,13 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 60, length: 10 }, %) |> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %) |> angledLine({ angle: 120, length: 10 }, %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge) |> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
|> fillet({ |> fillet({
radius: 3, radius: 3,
tags: [getOppositeEdge(referenceEdge, %)] tags: [getOppositeEdge("referenceEdge", %)]
}, %) }, %)
``` ```
@ -35,39 +35,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `TagIdentifier` (REQUIRED) * `tag`: `String` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -109,74 +82,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -203,12 +112,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -216,12 +121,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -233,12 +134,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -246,12 +143,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -259,12 +152,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -274,12 +163,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -291,12 +176,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -310,14 +191,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -325,14 +202,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
```js ```js
getPreviousAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -21,14 +21,14 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 60, length: 10 }, %) |> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %) |> angledLine({ angle: 120, length: 10 }, %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge) |> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
|> fillet({ |> fillet({
radius: 3, radius: 3,
tags: [ tags: [
getPreviousAdjacentEdge(referenceEdge, %) getPreviousAdjacentEdge("referenceEdge", %)
] ]
}, %) }, %)
``` ```
@ -37,39 +37,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `TagIdentifier` (REQUIRED) * `tag`: `String` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -111,74 +84,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -205,12 +114,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -218,12 +123,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -235,12 +136,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -248,12 +145,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -261,12 +154,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -276,12 +165,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -293,12 +178,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -312,14 +193,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -327,14 +204,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -48,28 +48,6 @@ const part001 = startSketchOn('XY')
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -111,74 +89,10 @@ const part001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -205,12 +119,8 @@ const part001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -218,12 +128,8 @@ const part001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -235,12 +141,8 @@ const part001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -248,12 +150,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -261,12 +159,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -276,12 +170,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -293,12 +183,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -312,14 +198,10 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -327,14 +209,10 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }
@ -347,28 +225,6 @@ const part001 = startSketchOn('XY')
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -410,74 +266,10 @@ const part001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -504,12 +296,8 @@ const part001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -517,12 +305,8 @@ const part001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -534,12 +318,8 @@ const part001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -547,12 +327,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -560,12 +336,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -575,12 +347,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -592,12 +360,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -611,14 +375,10 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -626,14 +386,10 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -88,181 +88,10 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -289,12 +118,8 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -303,12 +128,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -320,12 +141,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -333,12 +150,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -346,12 +159,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -361,12 +170,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -378,12 +183,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -431,181 +232,10 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -632,12 +262,8 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -645,12 +271,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -662,12 +284,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -675,12 +293,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -688,12 +302,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -703,12 +313,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -720,12 +326,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -773,181 +375,10 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -974,12 +405,8 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -987,12 +414,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -1004,12 +427,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -1017,12 +436,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -1030,12 +445,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -1045,12 +456,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -1062,12 +469,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -55,7 +55,6 @@ layout: manual
* [`patternCircular3d`](kcl/patternCircular3d) * [`patternCircular3d`](kcl/patternCircular3d)
* [`patternLinear2d`](kcl/patternLinear2d) * [`patternLinear2d`](kcl/patternLinear2d)
* [`patternLinear3d`](kcl/patternLinear3d) * [`patternLinear3d`](kcl/patternLinear3d)
* [`patternTransform`](kcl/patternTransform)
* [`pi`](kcl/pi) * [`pi`](kcl/pi)
* [`pow`](kcl/pow) * [`pow`](kcl/pow)
* [`profileStart`](kcl/profileStart) * [`profileStart`](kcl/profileStart)

View File

@ -68,181 +68,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -269,12 +98,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -282,12 +107,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -299,12 +120,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -312,12 +129,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -325,12 +138,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -340,12 +149,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -357,12 +162,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -68,181 +68,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -269,12 +98,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -282,12 +107,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -299,12 +120,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -312,12 +129,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -325,12 +138,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -340,12 +149,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -357,12 +162,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line.
```js ```js
line(delta: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup line(delta: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -81,181 +81,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -282,12 +111,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -295,12 +120,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -312,12 +133,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -325,12 +142,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -338,12 +151,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -353,12 +162,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -370,26 +175,15 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -431,181 +225,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -632,12 +255,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -645,12 +264,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -662,12 +277,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -675,12 +286,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -688,12 +295,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -703,12 +306,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -720,12 +319,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line to a point.
```js ```js
lineTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup lineTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -68,181 +68,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -269,12 +98,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -282,12 +107,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -299,12 +120,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -312,12 +129,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -325,12 +138,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -340,12 +149,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -357,26 +162,15 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -418,181 +212,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -619,12 +242,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -632,12 +251,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -649,12 +264,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -662,12 +273,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -675,12 +282,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -690,12 +293,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -707,12 +306,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -86,181 +86,10 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -287,12 +116,8 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -301,12 +126,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -318,12 +139,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -331,12 +148,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -344,12 +157,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -359,12 +168,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -376,12 +181,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -52,28 +52,6 @@ const example = extrude(-5, exampleSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -115,74 +93,10 @@ const example = extrude(-5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -209,12 +123,8 @@ const example = extrude(-5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -222,12 +132,8 @@ const example = extrude(-5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -239,12 +145,8 @@ const example = extrude(-5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -252,12 +154,8 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -265,12 +163,8 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -280,12 +174,8 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -297,12 +187,8 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -317,14 +203,10 @@ const example = extrude(-5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -332,14 +214,10 @@ const example = extrude(-5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} | } |

View File

@ -79,181 +79,10 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -280,12 +109,8 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -294,12 +119,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -311,12 +132,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -324,12 +141,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -337,12 +150,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -352,12 +161,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -369,12 +174,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -50,28 +50,6 @@ const example = extrude(1, exampleSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -113,74 +91,10 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -207,12 +121,8 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -220,12 +130,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -237,12 +143,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -250,12 +152,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -263,12 +161,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -278,12 +172,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -295,12 +185,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -315,14 +201,10 @@ const example = extrude(1, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -330,14 +212,10 @@ const example = extrude(1, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} | } |

File diff suppressed because one or more lines are too long

View File

@ -17,9 +17,9 @@ profileStart(sketch_group: SketchGroup) -> [number]
```js ```js
const sketch001 = startSketchOn('XY') const sketch001 = startSketchOn('XY')
|> startProfileAt([5, 2], %) |> startProfileAt([5, 2], %)
|> angledLine({ angle: 120, length: 50 }, %, $seg01) |> angledLine({ angle: 120, length: 50 }, %, 'seg01')
|> angledLine({ |> angledLine({
angle: segAng(seg01, %) + 120, angle: segAng('seg01', %) + 120,
length: 50 length: 50
}, %) }, %)
|> lineTo(profileStart(%), %) |> lineTo(profileStart(%), %)
@ -69,181 +69,10 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -270,12 +99,8 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -283,12 +108,8 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -300,12 +121,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -313,12 +130,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -326,12 +139,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -341,12 +150,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -358,12 +163,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -64,181 +64,10 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -265,12 +94,8 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -278,12 +103,8 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -295,12 +116,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -308,12 +125,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -321,12 +134,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -336,12 +145,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -353,12 +158,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -63,181 +63,10 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -264,12 +93,8 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -277,12 +102,8 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -294,12 +115,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -307,12 +124,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -320,12 +133,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -335,12 +144,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -352,12 +157,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -99,7 +99,7 @@ const box = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 20], %) |> line([0, 20], %)
|> line([20, 0], %) |> line([20, 0], %)
|> line([0, -20], %, $revolveAxis) |> line([0, -20], %, 'revolveAxis')
|> close(%) |> close(%)
|> extrude(20, %) |> extrude(20, %)
@ -107,7 +107,7 @@ const sketch001 = startSketchOn(box, "END")
|> circle([10, 10], 4, %) |> circle([10, 10], 4, %)
|> revolve({ |> revolve({
angle: 90, angle: 90,
axis: getOppositeEdge(revolveAxis, box) axis: getOppositeEdge('revolveAxis', box)
}, %) }, %)
``` ```
@ -156,9 +156,7 @@ const part001 = revolve({
}, },
} | } |
uuid | uuid |
{ string,
value: string,
},
} }
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
@ -199,181 +197,10 @@ uuid |
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -400,12 +227,8 @@ uuid |
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -413,12 +236,8 @@ uuid |
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -430,12 +249,8 @@ uuid |
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -443,12 +258,8 @@ uuid |
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -456,12 +267,8 @@ uuid |
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -471,12 +278,8 @@ uuid |
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -488,12 +291,8 @@ uuid |
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -508,28 +307,6 @@ uuid |
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -571,74 +348,10 @@ uuid |
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -665,12 +378,8 @@ uuid |
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -678,12 +387,8 @@ uuid |
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -695,12 +400,8 @@ uuid |
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -708,12 +409,8 @@ uuid |
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -721,12 +418,8 @@ uuid |
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -736,12 +429,8 @@ uuid |
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -753,12 +442,8 @@ uuid |
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -772,14 +457,10 @@ uuid |
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -787,14 +468,10 @@ uuid |
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Returns the angle of the segment.
```js ```js
segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segAng(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -18,11 +18,11 @@ segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line([10, 0], %)
|> line([5, 10], %, $seg01) |> line([5, 10], %, 'seg01')
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine([segAng(seg01, %), 10], %) |> angledLine([segAng('seg01', %), 10], %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine([segAng(seg01, %), -15], %) |> angledLine([segAng('seg01', %), -15], %)
|> close(%) |> close(%)
const example = extrude(4, exampleSketch) const example = extrude(4, exampleSketch)
@ -32,12 +32,7 @@ const example = extrude(4, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
@ -76,181 +71,10 @@ const example = extrude(4, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -277,12 +101,8 @@ const example = extrude(4, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -290,12 +110,8 @@ const example = extrude(4, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -307,12 +123,8 @@ const example = extrude(4, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -320,12 +132,8 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -333,12 +141,8 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -348,12 +152,8 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -365,12 +165,8 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Returns the segment end of x.
```js ```js
segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segEndX(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,9 +17,9 @@ segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
```js ```js
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([20, 0], %, $thing) |> line([20, 0], %, "thing")
|> line([0, 5], %) |> line([0, 5], %)
|> line([segEndX(thing, %), 0], %) |> line([segEndX("thing", %), 0], %)
|> line([-20, 10], %) |> line([-20, 10], %)
|> close(%) |> close(%)
@ -30,12 +30,7 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
@ -74,181 +69,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -275,12 +99,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -288,12 +108,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -305,12 +121,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -318,12 +130,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -331,12 +139,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -346,12 +150,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -363,12 +163,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Returns the segment end of y.
```js ```js
segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segEndY(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -18,9 +18,9 @@ segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([20, 0], %) |> line([20, 0], %)
|> line([0, 3], %, $thing) |> line([0, 3], %, "thing")
|> line([-10, 0], %) |> line([-10, 0], %)
|> line([0, segEndY(thing, %)], %) |> line([0, segEndY("thing", %)], %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> close(%) |> close(%)
@ -31,12 +31,7 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
@ -75,181 +70,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -276,12 +100,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -289,12 +109,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -306,12 +122,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -319,12 +131,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -332,12 +140,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -347,12 +151,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -364,12 +164,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Returns the length of the segment.
```js ```js
segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segLen(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,9 +17,12 @@ segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
```js ```js
const exampleSketch = startSketchOn("XZ") const exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 60, length: 10 }, %, $thing) |> angledLine({ angle: 60, length: 10 }, %, "thing")
|> tangentialArc({ offset: -120, radius: 5 }, %) |> tangentialArc({ offset: -120, radius: 5 }, %)
|> angledLine({ angle: -60, length: segLen(thing, %) }, %) |> angledLine({
angle: -60,
length: segLen("thing", %)
}, %)
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
@ -29,12 +32,7 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
@ -73,181 +71,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -274,12 +101,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -287,12 +110,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -304,12 +123,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -317,12 +132,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -330,12 +141,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -345,12 +152,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -362,12 +165,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -36,9 +36,7 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The faces you want removed. // The faces you want removed.
faces: ["start" | "end" | faces: ["start" | "end" |
{ string],
value: string,
}],
// The thickness of the shell. // The thickness of the shell.
thickness: number, thickness: number,
} }
@ -48,28 +46,6 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -111,74 +87,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -205,12 +117,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -218,12 +126,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -235,12 +139,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -248,12 +148,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -261,12 +157,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -276,12 +168,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -293,12 +181,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -312,14 +196,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -327,14 +207,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }
@ -347,28 +223,6 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -410,74 +264,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -504,12 +294,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -517,12 +303,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -534,12 +316,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -547,12 +325,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -560,12 +334,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -575,12 +345,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -592,12 +358,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -611,14 +373,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -626,14 +384,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Start a profile at a given point.
```js ```js
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> SketchGroup startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -90,238 +90,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: ExtrudeGroup,
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -345,14 +117,7 @@ const example = extrude(5, exampleSketch)
}, },
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -394,181 +159,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -595,12 +189,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -608,12 +198,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -625,12 +211,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -638,12 +220,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -651,12 +229,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -666,12 +240,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -683,12 +253,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -94,181 +94,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -295,12 +124,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -308,12 +133,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -325,12 +146,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -338,12 +155,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -351,12 +164,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -366,12 +175,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -383,12 +188,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Start a sketch on a specific plane or face.
```js ```js
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface
``` ```
### Examples ### Examples
@ -49,7 +49,7 @@ const example003 = extrude(5, exampleSketch003)
const exampleSketch = startSketchOn("XY") const exampleSketch = startSketchOn("XY")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line([10, 0], %)
|> line([0, 10], %, $sketchingFace) |> line([0, 10], %, 'sketchingFace')
|> line([-10, 0], %) |> line([-10, 0], %)
|> close(%) |> close(%)
@ -60,7 +60,7 @@ const exampleSketch002 = startSketchOn(example, 'sketchingFace')
|> line([8, 0], %) |> line([8, 0], %)
|> line([0, 8], %) |> line([0, 8], %)
|> line([-8, 0], %) |> line([-8, 0], %)
|> close(%, $sketchingFace002) |> close(%, 'sketchingFace002')
const example002 = extrude(10, exampleSketch002) const example002 = extrude(10, exampleSketch002)
@ -163,28 +163,6 @@ const a1 = startSketchOn({
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
@ -226,10 +204,10 @@ const a1 = startSketchOn({
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: ExtrudeGroup,
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -256,12 +234,8 @@ const a1 = startSketchOn({
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -269,12 +243,8 @@ const a1 = startSketchOn({
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -286,12 +256,8 @@ const a1 = startSketchOn({
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -299,12 +265,8 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -312,12 +274,8 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -327,12 +285,8 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -344,12 +298,8 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -363,14 +313,10 @@ const a1 = startSketchOn({
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -378,24 +324,18 @@ const a1 = startSketchOn({
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }
``` ```
* `tag`: `FaceTag` - A tag for a face. (OPTIONAL) * `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
```js ```js
"start" | "end" | "start" | "end" |
{ string
value: string,
}
``` ```
### Returns ### Returns
@ -434,238 +374,10 @@ const a1 = startSketchOn({
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: ExtrudeGroup,
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -77,181 +77,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -278,12 +107,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -291,12 +116,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -308,12 +129,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -321,12 +138,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,12 +147,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -349,12 +158,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -366,26 +171,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -427,181 +221,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -628,12 +251,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -641,12 +260,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -658,12 +273,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -671,12 +282,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -684,12 +291,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -699,12 +302,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -716,12 +315,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -68,181 +68,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -269,12 +98,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -282,12 +107,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -299,12 +120,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -312,12 +129,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -325,12 +138,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -340,12 +149,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -357,26 +162,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -418,181 +212,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -619,12 +242,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -632,12 +251,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -649,12 +264,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -662,12 +273,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -675,12 +282,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -690,12 +293,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -707,12 +306,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line on the x-axis.
```js ```js
xLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup xLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -71,181 +71,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -272,12 +101,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -285,12 +110,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -302,12 +123,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -315,12 +132,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -328,12 +141,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -343,12 +152,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -360,26 +165,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -421,181 +215,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -622,12 +245,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -635,12 +254,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -652,12 +267,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -665,12 +276,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -678,12 +285,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -693,12 +296,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -710,12 +309,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line to a point on the x-axis.
```js ```js
xLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup xLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -71,181 +71,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -272,12 +101,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -285,12 +110,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -302,12 +123,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -315,12 +132,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -328,12 +141,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -343,12 +152,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -360,26 +165,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -421,181 +215,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -622,12 +245,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -635,12 +254,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -652,12 +267,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -665,12 +276,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -678,12 +285,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -693,12 +296,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -710,12 +309,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line on the y-axis.
```js ```js
yLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup yLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -69,181 +69,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -270,12 +99,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -283,12 +108,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -300,12 +121,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -313,12 +130,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -326,12 +139,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -341,12 +150,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -358,26 +163,15 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -419,181 +213,10 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -620,12 +243,8 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -633,12 +252,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -650,12 +265,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -663,12 +274,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -676,12 +283,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -691,12 +294,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -708,12 +307,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line to a point on the y-axis.
```js ```js
yLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup yLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -67,181 +67,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -268,12 +97,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -281,12 +106,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -298,12 +119,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -311,12 +128,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -324,12 +137,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -339,12 +148,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -356,26 +161,15 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -417,181 +211,10 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -618,12 +241,8 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -631,12 +250,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -648,12 +263,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -661,12 +272,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -674,12 +281,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -689,12 +292,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -706,12 +305,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -45,8 +45,8 @@ async function clearCommandLogs(page: Page) {
await page.getByTestId('clear-commands').click() await page.getByTestId('clear-commands').click()
} }
async function expectCmdLog(page: Page, locatorStr: string, timeout = 5000) { async function expectCmdLog(page: Page, locatorStr: string) {
await expect(page.locator(locatorStr).last()).toBeVisible({ timeout }) await expect(page.locator(locatorStr).last()).toBeVisible()
} }
async function waitForDefaultPlanesToBeVisible(page: Page) { async function waitForDefaultPlanesToBeVisible(page: Page) {
@ -114,45 +114,19 @@ export const wiggleMove = async (
dist: number, dist: number,
ang: number, ang: number,
amplitude: number, amplitude: number,
freq: number, freq: number
locator?: string
) => { ) => {
const tau = Math.PI * 2 const tau = Math.PI * 2
const deg = tau / 360 const deg = tau / 360
const step = dist / steps const step = dist / steps
for (let i = 0, j = 0; i < dist; i += step, j += 1) { for (let i = 0, j = 0; i < dist; i += step, j += 1) {
if (locator) {
const isElVis = await page.locator(locator).isVisible()
if (isElVis) return
}
const [x1, y1] = [0, Math.sin((tau / steps) * j * freq) * amplitude] const [x1, y1] = [0, Math.sin((tau / steps) * j * freq) * amplitude]
const [x2, y2] = [ const [x2, y2] = [
Math.cos(-ang * deg) * i - Math.sin(-ang * deg) * y1, Math.cos(-ang * deg) * i - Math.sin(-ang * deg) * y1,
Math.sin(-ang * deg) * i + Math.cos(-ang * deg) * y1, Math.sin(-ang * deg) * i + Math.cos(-ang * deg) * y1,
] ]
const [xr, yr] = [x2, y2] const [xr, yr] = [x2, y2]
await page.mouse.move(x + xr, y + yr, { steps: 5 }) await page.mouse.move(x + xr, y + yr, { steps: 2 })
}
}
export const circleMove = async (
page: any,
x: number,
y: number,
steps: number,
diameter: number,
locator?: string
) => {
const tau = Math.PI * 2
const step = tau / steps
for (let i = 0; i < tau; i += step) {
if (locator) {
const isElVis = await page.locator(locator).isVisible()
if (isElVis) return
}
const [x1, y1] = [Math.cos(i) * diameter, Math.sin(i) * diameter]
const [xr, yr] = [x1, y1]
await page.mouse.move(x + xr, y + yr, { steps: 5 })
} }
} }
@ -177,11 +151,11 @@ export const getMovementUtils = (opts: any) => {
// Make it easier to click around from center ("click [from] zero zero") // Make it easier to click around from center ("click [from] zero zero")
const click00 = (x: number, y: number) => const click00 = (x: number, y: number) =>
opts.page.mouse.click(opts.center.x + x, opts.center.y + y, { delay: 100 }) opts.page.mouse.click(opts.center.x + x, opts.center.y + y)
// Relative clicker, must keep state // Relative clicker, must keep state
let last = { x: 0, y: 0 } let last = { x: 0, y: 0 }
const click00r = async (x?: number, y?: number) => { const click00r = (x?: number, y?: number) => {
// reset relative coordinates when anything is undefined // reset relative coordinates when anything is undefined
if (x === undefined || y === undefined) { if (x === undefined || y === undefined) {
last.x = 0 last.x = 0
@ -189,19 +163,12 @@ export const getMovementUtils = (opts: any) => {
return return
} }
await circleMove( const ret = click00(last.x + x, last.y + y)
opts.page,
opts.center.x + last.x + x,
opts.center.y + last.y + y,
10,
10
)
await click00(last.x + x, last.y + y)
last.x += x last.x += x
last.y += y last.y += y
// Returns the new absolute coordinate if you need it. // Returns the new absolute coordinate if you need it.
return [last.x, last.y] return ret.then(() => [last.x, last.y])
} }
return { toSU, click00r } return { toSU, click00r }
@ -228,8 +195,7 @@ export async function getUtils(page: Page) {
await fillInput('z', xyz[2]) await fillInput('z', xyz[2])
}, },
clearCommandLogs: () => clearCommandLogs(page), clearCommandLogs: () => clearCommandLogs(page),
expectCmdLog: (locatorStr: string, timeout = 5000) => expectCmdLog: (locatorStr: string) => expectCmdLog(page, locatorStr),
expectCmdLog(page, locatorStr, timeout),
openKclCodePanel: () => openKclCodePanel(page), openKclCodePanel: () => openKclCodePanel(page),
closeKclCodePanel: () => closeKclCodePanel(page), closeKclCodePanel: () => closeKclCodePanel(page),
openDebugPanel: () => openDebugPanel(page), openDebugPanel: () => openDebugPanel(page),
@ -301,19 +267,11 @@ export async function getUtils(page: Page) {
(screenshot.width * coords.y * pixMultiplier + (screenshot.width * coords.y * pixMultiplier +
coords.x * pixMultiplier) * coords.x * pixMultiplier) *
4 // rbga is 4 channels 4 // rbga is 4 channels
const maxDiff = Math.max( return Math.max(
Math.abs(screenshot.data[index] - expected[0]), Math.abs(screenshot.data[index] - expected[0]),
Math.abs(screenshot.data[index + 1] - expected[1]), Math.abs(screenshot.data[index + 1] - expected[1]),
Math.abs(screenshot.data[index + 2] - expected[2]) Math.abs(screenshot.data[index + 2] - expected[2])
) )
if (maxDiff > 4) {
console.log(
`Expected: ${expected} Actual: [${screenshot.data[index]}, ${
screenshot.data[index + 1]
}, ${screenshot.data[index + 2]}]`
)
}
return maxDiff
}, },
doAndWaitForImageDiff: (fn: () => Promise<any>, diffCount = 200) => doAndWaitForImageDiff: (fn: () => Promise<any>, diffCount = 200) =>
new Promise(async (resolve) => { new Promise(async (resolve) => {

View File

@ -1,6 +1,6 @@
{ {
"name": "untitled-app", "name": "untitled-app",
"version": "0.22.6", "version": "0.22.5",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@codemirror/autocomplete": "^6.16.0", "@codemirror/autocomplete": "^6.16.0",
@ -37,7 +37,6 @@
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"debounce-promise": "^3.1.2", "debounce-promise": "^3.1.2",
"decamelize": "^6.0.0", "decamelize": "^6.0.0",
"eslint-plugin-suggest-no-throw": "^1.0.0",
"formik": "^2.4.6", "formik": "^2.4.6",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"html2canvas-pro": "^1.4.3", "html2canvas-pro": "^1.4.3",
@ -89,7 +88,7 @@
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e", "fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e",
"fetch:wasm": "./get-latest-wasm-bundle.sh", "fetch:wasm": "./get-latest-wasm-bundle.sh",
"build:wasm-dev": "(cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt", "build:wasm-dev": "(cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
"build:wasm": "(cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt", "build:wasm": "(cd src/wasm-lib && wasm-pack build --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
"build:wasm-clean": "yarn wasm-prep && yarn build:wasm", "build:wasm-clean": "yarn wasm-prep && yarn build:wasm",
"remove-importmeta": "sed -i 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\"; sed -i '' 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\" || echo \"sed for both mac and linux\"", "remove-importmeta": "sed -i 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\"; sed -i '' 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\" || echo \"sed for both mac and linux\"",
"wasm-prep": "rm -rf src/wasm-lib/pkg && mkdir src/wasm-lib/pkg && rm -rf src/wasm-lib/kcl/bindings", "wasm-prep": "rm -rf src/wasm-lib/pkg && mkdir src/wasm-lib/pkg && rm -rf src/wasm-lib/kcl/bindings",
@ -121,7 +120,7 @@
"@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.24.3", "@babel/preset-env": "^7.24.3",
"@iarna/toml": "^2.2.5", "@iarna/toml": "^2.2.5",
"@playwright/test": "^1.44.1", "@playwright/test": "^1.43.1",
"@tauri-apps/cli": "^2.0.0-beta.13", "@tauri-apps/cli": "^2.0.0-beta.13",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/debounce-promise": "^3.1.9", "@types/debounce-promise": "^3.1.9",

View File

@ -12,13 +12,13 @@ import { defineConfig, devices } from '@playwright/test'
export default defineConfig({ export default defineConfig({
testDir: './e2e/playwright', testDir: './e2e/playwright',
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: true, fullyParallel: false,
/* Fail the build on CI if you accidentally left test.only in the source code. */ /* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI, forbidOnly: !!process.env.CI,
/* Retry on CI only */ /* Retry on CI only */
retries: process.env.CI ? 3 : 0, retries: process.env.CI ? 3 : 0,
/* Different amount of parallelism on CI and local. */ /* Different amount of parallelism on CI and local. */
workers: process.env.CI ? 4 : 4, workers: process.env.CI ? 1 : 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html', reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

143
src-tauri/Cargo.lock generated
View File

@ -344,7 +344,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -379,7 +379,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -405,6 +405,12 @@ dependencies = [
"system-deps", "system-deps",
] ]
[[package]]
name = "atomic"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba"
[[package]] [[package]]
name = "atomic-waker" name = "atomic-waker"
version = "1.1.2" version = "1.1.2"
@ -419,7 +425,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -568,7 +574,7 @@ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
"syn_derive", "syn_derive",
] ]
@ -877,7 +883,7 @@ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1079,7 +1085,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1089,7 +1095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1113,7 +1119,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.10.0", "strsim 0.10.0",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1124,7 +1130,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [ dependencies = [
"darling_core", "darling_core",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1140,20 +1146,6 @@ dependencies = [
"parking_lot_core 0.9.9", "parking_lot_core 0.9.9",
] ]
[[package]]
name = "dashmap"
version = "6.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28"
dependencies = [
"cfg-if",
"crossbeam-utils",
"hashbrown 0.14.3",
"lock_api",
"once_cell",
"parking_lot_core 0.9.9",
]
[[package]] [[package]]
name = "data-encoding" name = "data-encoding"
version = "2.5.0" version = "2.5.0"
@ -1185,7 +1177,7 @@ checksum = "4078275de501a61ceb9e759d37bdd3d7210e654dbc167ac1a3678ef4435ed57b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
"synstructure", "synstructure",
] ]
@ -1222,7 +1214,7 @@ dependencies = [
"regex", "regex",
"serde", "serde",
"serde_tokenstream", "serde_tokenstream",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1233,7 +1225,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1295,7 +1287,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1327,7 +1319,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1425,7 +1417,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1576,7 +1568,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1692,7 +1684,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1968,7 +1960,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -1996,7 +1988,7 @@ dependencies = [
"inflections", "inflections",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -2071,7 +2063,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -2576,7 +2568,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-lib" name = "kcl-lib"
version = "0.1.67" version = "0.1.62"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"approx", "approx",
@ -2586,7 +2578,7 @@ dependencies = [
"bson", "bson",
"chrono", "chrono",
"clap", "clap",
"dashmap 6.0.1", "dashmap",
"databake", "databake",
"derive-docs", "derive-docs",
"form_urlencoded", "form_urlencoded",
@ -2633,9 +2625,9 @@ dependencies = [
[[package]] [[package]]
name = "kittycad" name = "kittycad"
version = "0.3.6" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af3de9bb4b1441f198689a9f64a8163a518377e30b348a784680e738985b95eb" checksum = "df75feef10313fa1cb15b7cecd0f579877312ba3d42bb5b8b4c1d4b1d0fcabf0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -2685,9 +2677,9 @@ dependencies = [
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.5.0" version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libappindicator" name = "libappindicator"
@ -3366,7 +3358,7 @@ dependencies = [
"regex", "regex",
"regex-syntax 0.8.3", "regex-syntax 0.8.3",
"structmeta", "structmeta",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -3508,7 +3500,7 @@ dependencies = [
"phf_shared 0.11.2", "phf_shared 0.11.2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -3576,7 +3568,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4421,7 +4413,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals", "serde_derive_internals",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4530,7 +4522,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4541,14 +4533,14 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.118" version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"itoa 1.0.11", "itoa 1.0.11",
@ -4574,7 +4566,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4595,7 +4587,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde", "serde",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4637,7 +4629,7 @@ dependencies = [
"darling", "darling",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4905,7 +4897,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"structmeta-derive", "structmeta-derive",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4916,7 +4908,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4938,7 +4930,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -4971,9 +4963,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.68" version = "2.0.67"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -4989,7 +4981,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -5006,7 +4998,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -5223,7 +5215,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"sha2", "sha2",
"syn 2.0.68", "syn 2.0.67",
"tauri-utils", "tauri-utils",
"thiserror", "thiserror",
"time", "time",
@ -5241,7 +5233,7 @@ dependencies = [
"heck 0.4.1", "heck 0.4.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
"tauri-codegen", "tauri-codegen",
"tauri-utils", "tauri-utils",
] ]
@ -5607,7 +5599,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -5696,7 +5688,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -5874,7 +5866,7 @@ dependencies = [
"async-trait", "async-trait",
"auto_impl", "auto_impl",
"bytes", "bytes",
"dashmap 5.5.3", "dashmap",
"futures", "futures",
"httparse", "httparse",
"lsp-types", "lsp-types",
@ -5896,7 +5888,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -5925,7 +5917,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -6049,7 +6041,7 @@ checksum = "cbdee324e50a7402416d9c25270d3df4241ed528af5d36dda18b6f219551c577"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
"termcolor", "termcolor",
] ]
@ -6224,10 +6216,11 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.9.1" version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0"
dependencies = [ dependencies = [
"atomic",
"getrandom 0.2.14", "getrandom 0.2.14",
"serde", "serde",
"wasm-bindgen", "wasm-bindgen",
@ -6260,7 +6253,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -6359,7 +6352,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6393,7 +6386,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6534,7 +6527,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -6640,7 +6633,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -6651,7 +6644,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]
@ -7093,7 +7086,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.67",
] ]
[[package]] [[package]]

View File

@ -74,5 +74,5 @@
} }
}, },
"productName": "Zoo Modeling App", "productName": "Zoo Modeling App",
"version": "0.22.6" "version": "0.22.5"
} }

View File

@ -25,7 +25,6 @@ import { LowerRightControls } from 'components/LowerRightControls'
import ModalContainer from 'react-modal-promise' import ModalContainer from 'react-modal-promise'
import useHotkeyWrapper from 'lib/hotkeyWrapper' import useHotkeyWrapper from 'lib/hotkeyWrapper'
import Gizmo from 'components/Gizmo' import Gizmo from 'components/Gizmo'
import { CoreDumpManager } from 'lib/coredump'
export function App() { export function App() {
useRefreshSettings(paths.FILE + 'SETTINGS') useRefreshSettings(paths.FILE + 'SETTINGS')
@ -56,11 +55,7 @@ export function App() {
setHtmlRef(ref) setHtmlRef(ref)
}, [ref]) }, [ref])
const { auth, settings } = useSettingsAuthContext() const { settings } = useSettingsAuthContext()
const token = auth?.context?.token
const coreDumpManager = new CoreDumpManager(engineCommandManager, ref, token)
const { const {
app: { onboardingStatus }, app: { onboardingStatus },
} = settings.context } = settings.context
@ -134,7 +129,7 @@ export function App() {
<ModelingSidebar paneOpacity={paneOpacity} /> <ModelingSidebar paneOpacity={paneOpacity} />
<Stream /> <Stream />
{/* <CamToggle /> */} {/* <CamToggle /> */}
<LowerRightControls coreDumpManager={coreDumpManager}> <LowerRightControls>
<Gizmo /> <Gizmo />
</LowerRightControls> </LowerRightControls>
</div> </div>

View File

@ -339,7 +339,7 @@ export function Toolbar({
bgClassName, bgClassName,
}} }}
> >
Constraints Constrain
</ActionButtonDropdown> </ActionButtonDropdown>
)} )}
{state.matches('idle') && ( {state.matches('idle') && (

View File

@ -44,7 +44,6 @@ import {
removeSingleConstraintInfo, removeSingleConstraintInfo,
} from 'lang/modifyAst' } from 'lang/modifyAst'
import { ActionButton } from 'components/ActionButton' import { ActionButton } from 'components/ActionButton'
import { err, trap } from 'lib/trap'
function useShouldHideScene(): { hideClient: boolean; hideServer: boolean } { function useShouldHideScene(): { hideClient: boolean; hideServer: boolean } {
const [isCamMoving, setIsCamMoving] = useState(false) const [isCamMoving, setIsCamMoving] = useState(false)
@ -185,14 +184,11 @@ const Overlay = ({
let xAlignment = overlay.angle < 0 ? '0%' : '-100%' let xAlignment = overlay.angle < 0 ? '0%' : '-100%'
let yAlignment = overlay.angle < -90 || overlay.angle >= 90 ? '0%' : '-100%' let yAlignment = overlay.angle < -90 || overlay.angle >= 90 ? '0%' : '-100%'
const _node1 = getNodeFromPath<CallExpression>( const callExpression = getNodeFromPath<CallExpression>(
kclManager.ast, kclManager.ast,
overlay.pathToNode, overlay.pathToNode,
'CallExpression' 'CallExpression'
) ).node
if (err(_node1)) return
const callExpression = _node1.node
const constraints = getConstraintInfo( const constraints = getConstraintInfo(
callExpression, callExpression,
codeManager.code, codeManager.code,
@ -223,7 +219,6 @@ const Overlay = ({
data-testid="segment-overlay" data-testid="segment-overlay"
data-path-to-node={pathToNodeString} data-path-to-node={pathToNodeString}
data-overlay-index={overlayIndex} data-overlay-index={overlayIndex}
data-overlay-visible={shouldShow}
data-overlay-angle={overlay.angle} data-overlay-angle={overlay.angle}
className="pointer-events-auto absolute w-0 h-0" className="pointer-events-auto absolute w-0 h-0"
style={{ style={{
@ -232,7 +227,6 @@ const Overlay = ({
></div> ></div>
{shouldShow && ( {shouldShow && (
<div <div
data-overlay-toolbar-index={overlayIndex}
className={`px-0 pointer-events-auto absolute flex gap-1`} className={`px-0 pointer-events-auto absolute flex gap-1`}
style={{ style={{
transform: `translate3d(calc(${ transform: `translate3d(calc(${
@ -358,7 +352,7 @@ export async function deleteSegment({
pathToNode: PathToNode pathToNode: PathToNode
sketchDetails: SketchDetails | null sketchDetails: SketchDetails | null
}) { }) {
let modifiedAst: Program | Error = kclManager.ast let modifiedAst: Program = kclManager.ast
const dependentRanges = findUsesOfTagInPipe(modifiedAst, pathToNode) const dependentRanges = findUsesOfTagInPipe(modifiedAst, pathToNode)
const shouldContinueSegDelete = dependentRanges.length const shouldContinueSegDelete = dependentRanges.length
@ -369,7 +363,6 @@ export async function deleteSegment({
: true : true
if (!shouldContinueSegDelete) return if (!shouldContinueSegDelete) return
modifiedAst = deleteSegmentFromPipeExpression( modifiedAst = deleteSegmentFromPipeExpression(
dependentRanges, dependentRanges,
modifiedAst, modifiedAst,
@ -377,12 +370,9 @@ export async function deleteSegment({
codeManager.code, codeManager.code,
pathToNode pathToNode
) )
if (err(modifiedAst)) return Promise.reject(modifiedAst)
const newCode = recast(modifiedAst) const newCode = recast(modifiedAst)
modifiedAst = parse(newCode) modifiedAst = parse(newCode)
if (err(modifiedAst)) return Promise.reject(modifiedAst)
const testExecute = await executeAst({ const testExecute = await executeAst({
ast: modifiedAst, ast: modifiedAst,
useFakeExecutor: true, useFakeExecutor: true,
@ -394,15 +384,13 @@ export async function deleteSegment({
} }
if (!sketchDetails) return if (!sketchDetails) return
await sceneEntitiesManager.updateAstAndRejigSketch( sceneEntitiesManager.updateAstAndRejigSketch(
pathToNode, sketchDetails.sketchPathToNode,
modifiedAst, modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
// Now 'Set sketchDetails' is called with the modified pathToNode
} }
const SegmentMenu = ({ const SegmentMenu = ({
@ -547,13 +535,10 @@ const ConstraintSymbol = ({
const implicitDesc = const implicitDesc =
varNameMap[_type as LineInputsType]?.implicitConstraintDesc varNameMap[_type as LineInputsType]?.implicitConstraintDesc
const _node = useMemo( const node = useMemo(
() => getNodeFromPath<Value>(kclManager.ast, pathToNode), () => getNodeFromPath<Value>(kclManager.ast, pathToNode).node,
[kclManager.ast, pathToNode] [kclManager.ast, pathToNode]
) )
if (err(_node)) return
const node = _node.node
const range: SourceRange = node ? [node.start, node.end] : [0, 0] const range: SourceRange = node ? [node.start, node.end] : [0, 0]
if (_type === 'intersectionTag') return null if (_type === 'intersectionTag') return null
@ -591,17 +576,12 @@ const ConstraintSymbol = ({
}) })
} else if (isConstrained) { } else if (isConstrained) {
try { try {
const parsed = parse(recast(kclManager.ast)) const shallowPath = getNodeFromPath<CallExpression>(
if (trap(parsed)) return Promise.reject(parsed) parse(recast(kclManager.ast)),
const _node1 = getNodeFromPath<CallExpression>(
parsed,
pathToNode, pathToNode,
'CallExpression', 'CallExpression',
true true
) ).shallowPath
if (trap(_node1)) return Promise.reject(_node1)
const shallowPath = _node1.shallowPath
const input = makeRemoveSingleConstraintInput( const input = makeRemoveSingleConstraintInput(
argPosition, argPosition,
shallowPath shallowPath

View File

@ -101,7 +101,6 @@ import {
updateRectangleSketch, updateRectangleSketch,
} from 'lib/rectangleTool' } from 'lib/rectangleTool'
import { getThemeColorForThreeJs } from 'lib/theme' import { getThemeColorForThreeJs } from 'lib/theme'
import { err, trap } from 'lib/trap'
type DraftSegment = 'line' | 'tangentialArcTo' type DraftSegment = 'line' | 'tangentialArcTo'
@ -319,14 +318,8 @@ export class SceneEntities {
}> { }> {
this.createIntersectionPlane() this.createIntersectionPlane()
const prepared = this.prepareTruncatedMemoryAndAst(
sketchPathToNode || [],
maybeModdedAst
)
if (err(prepared)) return Promise.reject(prepared)
const { truncatedAst, programMemoryOverride, variableDeclarationName } = const { truncatedAst, programMemoryOverride, variableDeclarationName } =
prepared this.prepareTruncatedMemoryAndAst(sketchPathToNode || [], maybeModdedAst)
const { programMemory } = await executeAst({ const { programMemory } = await executeAst({
ast: truncatedAst, ast: truncatedAst,
useFakeExecutor: true, useFakeExecutor: true,
@ -338,8 +331,6 @@ export class SceneEntities {
ast: maybeModdedAst, ast: maybeModdedAst,
programMemory, programMemory,
}) })
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (!Array.isArray(sketchGroup?.value)) if (!Array.isArray(sketchGroup?.value))
return { return {
truncatedAst, truncatedAst,
@ -415,14 +406,11 @@ export class SceneEntities {
) )
let seg let seg
const _node1 = getNodeFromPath<CallExpression>( const callExpName = getNodeFromPath<CallExpression>(
maybeModdedAst, maybeModdedAst,
segPathToNode, segPathToNode,
'CallExpression' 'CallExpression'
) )?.node?.callee?.name
if (err(_node1)) return
const callExpName = _node1.node?.callee?.name
if (segment.type === 'TangentialArcTo') { if (segment.type === 'TangentialArcTo') {
seg = tangentialArcToSegment({ seg = tangentialArcToSegment({
prevSegment: sketchGroup.value[index - 1], prevSegment: sketchGroup.value[index - 1],
@ -501,14 +489,12 @@ export class SceneEntities {
} }
updateAstAndRejigSketch = async ( updateAstAndRejigSketch = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
modifiedAst: Program | Error, modifiedAst: Program,
forward: [number, number, number], forward: [number, number, number],
up: [number, number, number], up: [number, number, number],
origin: [number, number, number] origin: [number, number, number]
) => { ) => {
if (err(modifiedAst)) return modifiedAst await kclManager.updateAst(modifiedAst, false)
const nextAst = await kclManager.updateAst(modifiedAst, false)
await this.tearDownSketch({ removeAxis: false }) await this.tearDownSketch({ removeAxis: false })
sceneInfra.resetMouseListeners() sceneInfra.resetMouseListeners()
await this.setupSketch({ await this.setupSketch({
@ -516,7 +502,7 @@ export class SceneEntities {
forward, forward,
up, up,
position: origin, position: origin,
maybeModdedAst: nextAst.newAst, maybeModdedAst: kclManager.ast,
}) })
this.setupSketchIdleCallbacks({ this.setupSketchIdleCallbacks({
forward, forward,
@ -524,7 +510,6 @@ export class SceneEntities {
position: origin, position: origin,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
return nextAst
} }
setUpDraftSegment = async ( setUpDraftSegment = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
@ -534,17 +519,14 @@ export class SceneEntities {
segmentName: 'line' | 'tangentialArcTo' = 'line', segmentName: 'line' | 'tangentialArcTo' = 'line',
shouldTearDown = true shouldTearDown = true
) => { ) => {
const _ast = kclManager.ast const _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>( const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.id?.name || ''
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName =
_node1.node?.declarations?.[0]?.id?.name || ''
const sg = kclManager.programMemory.root[ const sg = kclManager.programMemory.root[
variableDeclarationName variableDeclarationName
] as SketchGroup ] as SketchGroup
@ -560,9 +542,7 @@ export class SceneEntities {
fnName: segmentName, fnName: segmentName,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
if (trap(mod)) return Promise.reject(mod)
const modifiedAst = parse(recast(mod.modifiedAst)) const modifiedAst = parse(recast(mod.modifiedAst))
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
const draftExpressionsIndices = { start: index, end: index } const draftExpressionsIndices = { start: index, end: index }
@ -613,16 +593,14 @@ export class SceneEntities {
), ),
], ],
}) })
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
modifiedAst = addCloseToPipe({ modifiedAst = addCloseToPipe({
node: modifiedAst, node: modifiedAst,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else if (intersection2d) { } else if (intersection2d) {
const lastSegment = sketchGroup.value.slice(-1)[0] const lastSegment = sketchGroup.value.slice(-1)[0]
const tmp = addNewSketchLn({ modifiedAst = addNewSketchLn({
node: kclManager.ast, node: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
to: [intersection2d.x, intersection2d.y], to: [intersection2d.x, intersection2d.y],
@ -632,10 +610,7 @@ export class SceneEntities {
? 'tangentialArcTo' ? 'tangentialArcTo'
: 'line', : 'line',
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) }).modifiedAst
if (trap(tmp)) return Promise.reject(tmp)
modifiedAst = tmp.modifiedAst
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else { } else {
// return early as we didn't modify the ast // return early as we didn't modify the ast
return return
@ -692,16 +667,14 @@ export class SceneEntities {
sketchOrigin: [number, number, number], sketchOrigin: [number, number, number],
rectangleOrigin: [x: number, y: number] rectangleOrigin: [x: number, y: number]
) => { ) => {
let _ast = kclManager.ast let _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>( const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.id?.name || ''
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName =
_node1.node?.declarations?.[0]?.id?.name || ''
const tags: [string, string, string] = [ const tags: [string, string, string] = [
findUniqueName(_ast, 'rectangleSegmentA'), findUniqueName(_ast, 'rectangleSegmentA'),
@ -709,13 +682,11 @@ export class SceneEntities {
findUniqueName(_ast, 'rectangleSegmentC'), findUniqueName(_ast, 'rectangleSegmentC'),
] ]
const _node2 = getNodeFromPath<VariableDeclaration>( const startSketchOn = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations
if (trap(_node2)) return Promise.reject(_node2)
const startSketchOn = _node2.node?.declarations
const startSketchOnInit = startSketchOn?.[0]?.init const startSketchOnInit = startSketchOn?.[0]?.init
startSketchOn[0].init = createPipeExpression([ startSketchOn[0].init = createPipeExpression([
@ -723,9 +694,7 @@ export class SceneEntities {
...getRectangleCallExpressions(rectangleOrigin, tags), ...getRectangleCallExpressions(rectangleOrigin, tags),
]) ])
let result = parse(recast(_ast)) _ast = parse(recast(_ast))
if (trap(result)) return Promise.reject(result)
_ast = result
const { programMemoryOverride, truncatedAst } = await this.setupSketch({ const { programMemoryOverride, truncatedAst } = await this.setupSketch({
sketchPathToNode, sketchPathToNode,
@ -739,16 +708,14 @@ export class SceneEntities {
sceneInfra.setCallbacks({ sceneInfra.setCallbacks({
onMove: async (args) => { onMove: async (args) => {
// Update the width and height of the draft rectangle // Update the width and height of the draft rectangle
const pathToNodeTwo = sketchPathToNode const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode))
pathToNodeTwo[1][0] = 0 pathToNodeTwo[1][0] = 0
const _node = getNodeFromPath<VariableDeclaration>( const sketchInit = getNodeFromPath<VariableDeclaration>(
truncatedAst, truncatedAst,
pathToNodeTwo || [], pathToNodeTwo || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.init
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
const x = (args.intersectionPoint.twoD.x || 0) - rectangleOrigin[0] const x = (args.intersectionPoint.twoD.x || 0) - rectangleOrigin[0]
const y = (args.intersectionPoint.twoD.y || 0) - rectangleOrigin[1] const y = (args.intersectionPoint.twoD.y || 0) - rectangleOrigin[1]
@ -790,20 +757,16 @@ export class SceneEntities {
const x = roundOff((cornerPoint.x || 0) - rectangleOrigin[0]) const x = roundOff((cornerPoint.x || 0) - rectangleOrigin[0])
const y = roundOff((cornerPoint.y || 0) - rectangleOrigin[1]) const y = roundOff((cornerPoint.y || 0) - rectangleOrigin[1])
const _node = getNodeFromPath<VariableDeclaration>( const sketchInit = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.init
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
if (sketchInit.type === 'PipeExpression') { if (sketchInit.type === 'PipeExpression') {
updateRectangleSketch(sketchInit, x, y, tags[0]) updateRectangleSketch(sketchInit, x, y, tags[0])
let result = parse(recast(_ast)) _ast = parse(recast(_ast))
if (trap(result)) return Promise.reject(result)
_ast = result
// Update the primary AST and unequip the rectangle tool // Update the primary AST and unequip the rectangle tool
await kclManager.executeAstMock(_ast) await kclManager.executeAstMock(_ast)
@ -894,7 +857,6 @@ export class SceneEntities {
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (trap(sketchGroup)) return
const pipeIndex = pathToNode[pathToNodeIndex + 1][0] as number const pipeIndex = pathToNode[pathToNodeIndex + 1][0] as number
if (addingNewSegmentStatus === 'nothing') { if (addingNewSegmentStatus === 'nothing') {
@ -912,8 +874,6 @@ export class SceneEntities {
spliceBetween: true, spliceBetween: true,
}) })
addingNewSegmentStatus = 'pending' addingNewSegmentStatus = 'pending'
if (trap(mod)) return
await kclManager.executeAstMock(mod.modifiedAst) await kclManager.executeAstMock(mod.modifiedAst)
await this.tearDownSketch({ removeAxis: false }) await this.tearDownSketch({ removeAxis: false })
this.setupSketch({ this.setupSketch({
@ -1007,8 +967,10 @@ export class SceneEntities {
PROFILE_START, PROFILE_START,
]) ])
if (!group) return if (!group) return
const pathToNode: PathToNode = group.userData.pathToNode const pathToNode: PathToNode = JSON.parse(
const varDecIndex: number = pathToNode[1][0] as number JSON.stringify(group.userData.pathToNode)
)
const varDecIndex = JSON.parse(JSON.stringify(pathToNode[1][0]))
if (draftInfo) { if (draftInfo) {
pathToNode[1][0] = 0 pathToNode[1][0] = 0
} }
@ -1020,22 +982,17 @@ export class SceneEntities {
const to: [number, number] = [intersection2d.x, intersection2d.y] const to: [number, number] = [intersection2d.x, intersection2d.y]
let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast } let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast }
const _node = getNodeFromPath<CallExpression>( const node = getNodeFromPath<CallExpression>(
modifiedAst, modifiedAst,
pathToNode, pathToNode,
'CallExpression' 'CallExpression'
) ).node
if (trap(_node)) return
const node = _node.node
if (node.type !== 'CallExpression') return if (node.type !== 'CallExpression') return
let modded: let modded: {
| {
modifiedAst: Program modifiedAst: Program
pathToNode: PathToNode pathToNode: PathToNode
} }
| Error
if (group.name === PROFILE_START) { if (group.name === PROFILE_START) {
modded = updateStartProfileAtArgs({ modded = updateStartProfileAtArgs({
node: modifiedAst, node: modifiedAst,
@ -1053,18 +1010,14 @@ export class SceneEntities {
from from
) )
} }
if (trap(modded)) return
modifiedAst = modded.modifiedAst modifiedAst = modded.modifiedAst
const info = draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(pathToNode || [])
if (trap(info, { suppress: true })) return
const { truncatedAst, programMemoryOverride, variableDeclarationName } = const { truncatedAst, programMemoryOverride, variableDeclarationName } =
info draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(sketchPathToNode || [])
;(async () => { ;(async () => {
const code = recast(modifiedAst) const code = recast(modifiedAst)
if (trap(code)) return
if (!draftInfo) if (!draftInfo)
// don't want to mod the user's code yet as they have't committed to the change yet // don't want to mod the user's code yet as they have't committed to the change yet
// plus this would be the truncated ast being recast, it would be wrong // plus this would be the truncated ast being recast, it would be wrong
@ -1591,14 +1544,11 @@ export class SceneEntities {
]) ])
if (parent?.userData?.pathToNode) { if (parent?.userData?.pathToNode) {
const updatedAst = parse(recast(kclManager.ast)) const updatedAst = parse(recast(kclManager.ast))
if (trap(updatedAst)) return const node = getNodeFromPath<CallExpression>(
const _node = getNodeFromPath<CallExpression>(
updatedAst, updatedAst,
parent.userData.pathToNode, parent.userData.pathToNode,
'CallExpression' 'CallExpression'
) ).node
if (trap(_node, { suppress: true })) return
const node = _node.node
editorManager.setHighlightRange([node.start, node.end]) editorManager.setHighlightRange([node.start, node.end])
const yellow = 0xffff00 const yellow = 0xffff00
colorSegment(selected, yellow) colorSegment(selected, yellow)
@ -1713,23 +1663,20 @@ function prepareTruncatedMemoryAndAst(
ast: Program, ast: Program,
programMemory: ProgramMemory, programMemory: ProgramMemory,
draftSegment?: DraftSegment draftSegment?: DraftSegment
): ): {
| {
truncatedAst: Program truncatedAst: Program
programMemoryOverride: ProgramMemory programMemoryOverride: ProgramMemory
variableDeclarationName: string variableDeclarationName: string
} } {
| Error {
const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0 const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0
const _ast = ast const _ast = JSON.parse(JSON.stringify(ast))
const _node = getNodeFromPath<VariableDeclaration>( const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.id?.name || ''
if (err(_node)) return _node
const variableDeclarationName = _node.node?.declarations?.[0]?.id?.name || ''
const lastSeg = ( const lastSeg = (
programMemory.root[variableDeclarationName] as SketchGroup programMemory.root[variableDeclarationName] as SketchGroup
).value.slice(-1)[0] ).value.slice(-1)[0]
@ -1757,8 +1704,6 @@ function prepareTruncatedMemoryAndAst(
// update source ranges to section we just added. // update source ranges to section we just added.
// hacks like this wouldn't be needed if the AST put pathToNode info in memory/sketchGroup segments // hacks like this wouldn't be needed if the AST put pathToNode info in memory/sketchGroup segments
const updatedSrcRangeAst = parse(recast(_ast)) // get source ranges correct since unfortunately we still rely on them const updatedSrcRangeAst = parse(recast(_ast)) // get source ranges correct since unfortunately we still rely on them
if (err(updatedSrcRangeAst)) return updatedSrcRangeAst
const lastPipeItem = ( const lastPipeItem = (
(updatedSrcRangeAst.body[bodyIndex] as VariableDeclaration) (updatedSrcRangeAst.body[bodyIndex] as VariableDeclaration)
.declarations[0].init as PipeExpression .declarations[0].init as PipeExpression
@ -1780,36 +1725,9 @@ function prepareTruncatedMemoryAndAst(
} }
const truncatedAst: Program = { const truncatedAst: Program = {
..._ast, ..._ast,
body: [_ast.body[bodyIndex]], body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))],
} }
const programMemoryOverride = programMemoryInit() const programMemoryOverride: ProgramMemory = programMemoryInit()
if (err(programMemoryOverride)) return programMemoryOverride
// Grab all the TagDeclarators and TagIdentifiers from memory.
let start = _node.node.start
for (const key in programMemory.root) {
const value = programMemory.root[key]
if (!('__meta' in value)) {
continue
}
if (
value.__meta === undefined ||
value.__meta.length === 0 ||
value.__meta[0].sourceRange === undefined
) {
continue
}
if (value.__meta[0].sourceRange[0] >= start) {
// We only want things before our start point.
continue
}
if (value.type === 'TagIdentifier') {
programMemoryOverride.root[key] = value
}
}
for (let i = 0; i < bodyIndex; i++) { for (let i = 0; i < bodyIndex; i++) {
const node = _ast.body[i] const node = _ast.body[i]
if (node.type !== 'VariableDeclaration') { if (node.type !== 'VariableDeclaration') {
@ -1821,7 +1739,7 @@ function prepareTruncatedMemoryAndAst(
if (!memoryItem) { if (!memoryItem) {
continue continue
} }
programMemoryOverride.root[name] = memoryItem programMemoryOverride.root[name] = JSON.parse(JSON.stringify(memoryItem))
} }
return { return {
truncatedAst, truncatedAst,
@ -1850,14 +1768,12 @@ export function sketchGroupFromPathToNode({
pathToNode: PathToNode pathToNode: PathToNode
ast: Program ast: Program
programMemory: ProgramMemory programMemory: ProgramMemory
}): SketchGroup | Error { }): SketchGroup {
const _varDec = getNodeFromPath<VariableDeclarator>( const varDec = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
) ).node
if (err(_varDec)) return _varDec
const varDec = _varDec.node
const result = programMemory.root[varDec?.id?.name || ''] const result = programMemory.root[varDec?.id?.name || '']
if (result?.type === 'ExtrudeGroup') { if (result?.type === 'ExtrudeGroup') {
return result.sketchGroup return result.sketchGroup
@ -1892,15 +1808,13 @@ function colorSegment(object: any, color: number) {
export function getSketchQuaternion( export function getSketchQuaternion(
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
sketchNormalBackUp: [number, number, number] | null sketchNormalBackUp: [number, number, number] | null
): Quaternion | Error { ): Quaternion {
const sketchGroup = sketchGroupFromPathToNode({ const sketchGroup = sketchGroupFromPathToNode({
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(sketchGroup)) return sketchGroup
const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp
return getQuaternionFromZAxis(massageFormats(zAxis)) return getQuaternionFromZAxis(massageFormats(zAxis))
} }
export async function getSketchOrientationDetails( export async function getSketchOrientationDetails(
@ -1914,8 +1828,6 @@ export async function getSketchOrientationDetails(
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (sketchGroup.on.type === 'plane') { if (sketchGroup.on.type === 'plane') {
const zAxis = sketchGroup?.on.zAxis const zAxis = sketchGroup?.on.zAxis
return { return {
@ -1933,12 +1845,11 @@ export async function getSketchOrientationDetails(
}, },
} }
} }
if (sketchGroup.on.type === 'face') { if (sketchGroup.on.type === 'face') {
const faceInfo = await getFaceDetails(sketchGroup.on.id) const faceInfo = await getFaceDetails(sketchGroup.on.id)
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis) if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis)
return Promise.reject('face info') throw new Error('faceInfo')
const { z_axis, y_axis, origin } = faceInfo const { z_axis, y_axis, origin } = faceInfo
const quaternion = quaternionFromUpNForward( const quaternion = quaternionFromUpNForward(
new Vector3(y_axis.x, y_axis.y, y_axis.z), new Vector3(y_axis.x, y_axis.y, y_axis.z),
@ -1955,7 +1866,7 @@ export async function getSketchOrientationDetails(
}, },
} }
} }
return Promise.reject( throw new Error(
'sketchGroup.on.type not recognized, has a new type been added?' 'sketchGroup.on.type not recognized, has a new type been added?'
) )
} }
@ -1969,9 +1880,9 @@ export async function getSketchOrientationDetails(
* @param entityId - The ID of the entity for which orientation details are being fetched. * @param entityId - The ID of the entity for which orientation details are being fetched.
* @returns A promise that resolves with the orientation details of the face. * @returns A promise that resolves with the orientation details of the face.
*/ */
export async function getFaceDetails( async function getFaceDetails(
entityId: string entityId: string
): Promise<Models['GetSketchModePlane_type']> { ): Promise<Models['FaceIsPlanar_type']> {
// TODO mode engine connection to allow batching returns and batch the following // TODO mode engine connection to allow batching returns and batch the following
await engineCommandManager.sendSceneCommand({ await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
@ -1984,7 +1895,8 @@ export async function getFaceDetails(
entity_id: entityId, entity_id: entityId,
}, },
}) })
const faceInfo: Models['GetSketchModePlane_type'] = ( // TODO change typing to get_sketch_mode_plane once lib is updated
const faceInfo: Models['FaceIsPlanar_type'] = (
await engineCommandManager.sendSceneCommand({ await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd_id: uuidv4(), cmd_id: uuidv4(),

View File

@ -2,7 +2,6 @@ import { useModelingContext } from 'hooks/useModelingContext'
import { editorManager, kclManager } from 'lib/singletons' import { editorManager, kclManager } from 'lib/singletons'
import { getNodeFromPath, getNodePathFromSourceRange } from 'lang/queryAst' import { getNodeFromPath, getNodePathFromSourceRange } from 'lang/queryAst'
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { trap } from 'lib/trap'
export function AstExplorer() { export function AstExplorer() {
const { context } = useModelingContext() const { context } = useModelingContext()
@ -11,12 +10,9 @@ export function AstExplorer() {
kclManager.ast, kclManager.ast,
context.selectionRanges.codeBasedSelections?.[0]?.range context.selectionRanges.codeBasedSelections?.[0]?.range
) )
const node = getNodeFromPath(kclManager.ast, pathToNode).node
const [filterKeys, setFilterKeys] = useState<string[]>(['start', 'end']) const [filterKeys, setFilterKeys] = useState<string[]>(['start', 'end'])
const _node = getNodeFromPath(kclManager.ast, pathToNode)
if (trap(_node)) return
const node = _node
return ( return (
<div id="ast-explorer" className="relative"> <div id="ast-explorer" className="relative">
<div className=""> <div className="">

View File

@ -11,7 +11,6 @@ import { engineCommandManager, kclManager } from 'lib/singletons'
import { useKclContext } from 'lang/KclProvider' import { useKclContext } from 'lang/KclProvider'
import { useModelingContext } from 'hooks/useModelingContext' import { useModelingContext } from 'hooks/useModelingContext'
import { executeAst } from 'useStore' import { executeAst } from 'useStore'
import { trap } from 'lib/trap'
export const AvailableVars = ({ export const AvailableVars = ({
onVarClick, onVarClick,
@ -142,7 +141,6 @@ export function useCalc({
try { try {
const code = `const __result__ = ${value}` const code = `const __result__ = ${value}`
const ast = parse(code) const ast = parse(code)
if (trap(ast)) return
const _programMem: any = { root: {}, return: null } const _programMem: any = { root: {}, return: null }
availableVarInfo.variables.forEach(({ key, value }) => { availableVarInfo.variables.forEach(({ key, value }) => {
_programMem.root[key] = { type: 'userVal', value, __meta: [] } _programMem.root[key] = { type: 'userVal', value, __meta: [] }
@ -151,7 +149,9 @@ export function useCalc({
ast, ast,
engineCommandManager, engineCommandManager,
useFakeExecutor: true, useFakeExecutor: true,
programMemoryOverride: kclManager.programMemory, programMemoryOverride: JSON.parse(
JSON.stringify(kclManager.programMemory)
),
}).then(({ programMemory }) => { }).then(({ programMemory }) => {
const resultDeclaration = ast.body.find( const resultDeclaration = ast.body.find(
(a) => (a) =>

View File

@ -24,7 +24,7 @@ export const CommandBar = () => {
}, [pathname]) }, [pathname])
// Hook up keyboard shortcuts // Hook up keyboard shortcuts
useHotkeyWrapper(['mod+k', 'ctrl+c'], () => { useHotkeyWrapper(['mod+k', 'mod+/'], () => {
if (commandBarState.context.commands.length === 0) return if (commandBarState.context.commands.length === 0) return
if (commandBarState.matches('Closed')) { if (commandBarState.matches('Closed')) {
commandBarSend({ type: 'Open' }) commandBarSend({ type: 'Open' })

View File

@ -6,18 +6,8 @@ import { NetworkHealthIndicator } from 'components/NetworkHealthIndicator'
import { HelpMenu } from './HelpMenu' import { HelpMenu } from './HelpMenu'
import { Link, useLocation } from 'react-router-dom' import { Link, useLocation } from 'react-router-dom'
import { useAbsoluteFilePath } from 'hooks/useAbsoluteFilePath' import { useAbsoluteFilePath } from 'hooks/useAbsoluteFilePath'
import { coreDump } from 'lang/wasm'
import toast from 'react-hot-toast'
import { CoreDumpManager } from 'lib/coredump'
import openWindow from 'lib/openWindow'
export function LowerRightControls({ export function LowerRightControls(props: React.PropsWithChildren) {
children,
coreDumpManager,
}: {
children?: React.ReactNode
coreDumpManager?: CoreDumpManager
}) {
const location = useLocation() const location = useLocation()
const filePath = useAbsoluteFilePath() const filePath = useAbsoluteFilePath()
const linkOverrideClassName = const linkOverrideClassName =
@ -25,42 +15,9 @@ export function LowerRightControls({
const isPlayWright = window?.localStorage.getItem('playwright') === 'true' const isPlayWright = window?.localStorage.getItem('playwright') === 'true'
async function reportbug(event: { preventDefault: () => void }) {
event?.preventDefault()
if (!coreDumpManager) {
// open default reporting option
openWindow('https://github.com/KittyCAD/modeling-app/issues/new/choose')
} else {
toast
.promise(
coreDump(coreDumpManager, true),
{
loading: 'Preparing bug report...',
success: 'Bug report opened in new window',
error: 'Unable to export a core dump. Using default reporting.',
},
{
success: {
// Note: this extended duration is especially important for Playwright e2e testing
// default duration is 2000 - https://react-hot-toast.com/docs/toast#default-durations
duration: 6000,
},
}
)
.catch((err: Error) => {
if (err) {
openWindow(
'https://github.com/KittyCAD/modeling-app/issues/new/choose'
)
}
})
}
}
return ( return (
<section className="fixed bottom-2 right-2 flex flex-col items-end gap-3 pointer-events-none"> <section className="fixed bottom-2 right-2 flex flex-col items-end gap-3 pointer-events-none">
{children} {props.children}
<menu className="flex items-center justify-end gap-3 pointer-events-auto"> <menu className="flex items-center justify-end gap-3 pointer-events-auto">
<a <a
href={`https://github.com/KittyCAD/modeling-app/releases/tag/v${APP_VERSION}`} href={`https://github.com/KittyCAD/modeling-app/releases/tag/v${APP_VERSION}`}
@ -71,7 +28,6 @@ export function LowerRightControls({
v{isPlayWright ? '11.22.33' : APP_VERSION} v{isPlayWright ? '11.22.33' : APP_VERSION}
</a> </a>
<a <a
onClick={reportbug}
href="https://github.com/KittyCAD/modeling-app/issues/new/choose" href="https://github.com/KittyCAD/modeling-app/issues/new/choose"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"

View File

@ -1,12 +1,6 @@
import { LanguageServerClient } from 'editor/plugins/lsp' import { LanguageServerClient } from 'editor/plugins/lsp'
import type * as LSP from 'vscode-languageserver-protocol' import type * as LSP from 'vscode-languageserver-protocol'
import React, { import React, { createContext, useMemo, useEffect, useContext } from 'react'
createContext,
useMemo,
useEffect,
useContext,
useState,
} from 'react'
import { FromServer, IntoServer } from 'editor/plugins/lsp/codec' import { FromServer, IntoServer } from 'editor/plugins/lsp/codec'
import Client from '../editor/plugins/lsp/client' import Client from '../editor/plugins/lsp/client'
import { TEST, VITE_KC_API_BASE_URL } from 'env' import { TEST, VITE_KC_API_BASE_URL } from 'env'
@ -30,7 +24,6 @@ import { wasmUrl } from 'lang/wasm'
import { PROJECT_ENTRYPOINT } from 'lib/constants' import { PROJECT_ENTRYPOINT } from 'lib/constants'
import { useNetworkContext } from 'hooks/useNetworkContext' import { useNetworkContext } from 'hooks/useNetworkContext'
import { NetworkHealthState } from 'hooks/useNetworkStatus' import { NetworkHealthState } from 'hooks/useNetworkStatus'
import { err } from 'lib/trap'
function getWorkspaceFolders(): LSP.WorkspaceFolder[] { function getWorkspaceFolders(): LSP.WorkspaceFolder[] {
return [] return []
@ -83,8 +76,6 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
setIsCopilotLspServerReady: s.setIsCopilotLspServerReady, setIsCopilotLspServerReady: s.setIsCopilotLspServerReady,
isStreamReady: s.isStreamReady, isStreamReady: s.isStreamReady,
})) }))
const [isLspReady, setIsLspReady] = useState(false)
const [isCopilotReady, setIsCopilotReady] = useState(false)
const { const {
auth, auth,
@ -120,17 +111,14 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
eventData: initEvent, eventData: initEvent,
}) })
lspWorker.onmessage = function (e) { lspWorker.onmessage = function (e) {
if (err(fromServer)) return
fromServer.add(e.data) fromServer.add(e.data)
} }
const intoServer: IntoServer = new IntoServer(LspWorker.Kcl, lspWorker) const intoServer: IntoServer = new IntoServer(LspWorker.Kcl, lspWorker)
const fromServer: FromServer | Error = FromServer.create() const fromServer: FromServer = FromServer.create()
if (err(fromServer)) return { lspClient: null }
const client = new Client(fromServer, intoServer) const client = new Client(fromServer, intoServer)
setIsLspReady(true) setIsKclLspServerReady(true)
const lspClient = new LanguageServerClient({ client, name: LspWorker.Kcl }) const lspClient = new LanguageServerClient({ client, name: LspWorker.Kcl })
return { lspClient } return { lspClient }
@ -197,17 +185,14 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
eventData: initEvent, eventData: initEvent,
}) })
lspWorker.onmessage = function (e) { lspWorker.onmessage = function (e) {
if (err(fromServer)) return
fromServer.add(e.data) fromServer.add(e.data)
} }
const intoServer: IntoServer = new IntoServer(LspWorker.Copilot, lspWorker) const intoServer: IntoServer = new IntoServer(LspWorker.Copilot, lspWorker)
const fromServer: FromServer | Error = FromServer.create() const fromServer: FromServer = FromServer.create()
if (err(fromServer)) return { lspClient: null }
const client = new Client(fromServer, intoServer) const client = new Client(fromServer, intoServer)
setIsCopilotReady(true) setIsCopilotLspServerReady(true)
const lspClient = new LanguageServerClient({ const lspClient = new LanguageServerClient({
client, client,
@ -245,13 +230,6 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
lspClients.push(copilotLspClient) lspClients.push(copilotLspClient)
} }
useEffect(() => {
setIsKclLspServerReady(isLspReady)
}, [isLspReady])
useEffect(() => {
setIsCopilotLspServerReady(isCopilotReady)
}, [isCopilotReady])
const onProjectClose = ( const onProjectClose = (
file: FileEntry | null, file: FileEntry | null,
projectPath: string | null, projectPath: string | null,

View File

@ -23,13 +23,13 @@ import {
editorManager, editorManager,
sceneEntitiesManager, sceneEntitiesManager,
} from 'lib/singletons' } from 'lib/singletons'
import { useHotkeys } from 'react-hotkeys-hook'
import { applyConstraintHorzVertDistance } from './Toolbar/SetHorzVertDistance' import { applyConstraintHorzVertDistance } from './Toolbar/SetHorzVertDistance'
import { import {
angleBetweenInfo, angleBetweenInfo,
applyConstraintAngleBetween, applyConstraintAngleBetween,
} from './Toolbar/SetAngleBetween' } from './Toolbar/SetAngleBetween'
import { applyConstraintAngleLength } from './Toolbar/setAngleLength' import { applyConstraintAngleLength } from './Toolbar/setAngleLength'
import { pathMapToSelections } from 'lang/util'
import { useStore } from 'useStore' import { useStore } from 'useStore'
import { import {
Selections, Selections,
@ -37,7 +37,6 @@ import {
handleSelectionBatch, handleSelectionBatch,
isSelectionLastLine, isSelectionLastLine,
isSketchPipe, isSketchPipe,
updateSelections,
} from 'lib/selections' } from 'lib/selections'
import { applyConstraintIntersect } from './Toolbar/Intersect' import { applyConstraintIntersect } from './Toolbar/Intersect'
import { applyConstraintAbsDistance } from './Toolbar/SetAbsDistance' import { applyConstraintAbsDistance } from './Toolbar/SetAbsDistance'
@ -78,8 +77,6 @@ import { letEngineAnimateAndSyncCamAfter } from 'clientSideScene/CameraControls'
import { getVarNameModal } from 'hooks/useToolbarGuards' import { getVarNameModal } from 'hooks/useToolbarGuards'
import useHotkeyWrapper from 'lib/hotkeyWrapper' import useHotkeyWrapper from 'lib/hotkeyWrapper'
import { uuidv4 } from 'lib/utils' import { uuidv4 } from 'lib/utils'
import { err, trap } from 'lib/trap'
import { useCommandsContext } from 'hooks/useCommandsContext'
type MachineContext<T extends AnyStateMachine> = { type MachineContext<T extends AnyStateMachine> = {
state: StateFrom<T> state: StateFrom<T>
@ -126,6 +123,7 @@ export const ModelingMachineProvider = ({
token token
) )
useHotkeyWrapper(['meta + shift + .'], () => { useHotkeyWrapper(['meta + shift + .'], () => {
console.warn('CoreDump: Initializing core dump')
toast.promise( toast.promise(
coreDump(coreDumpManager, true), coreDump(coreDumpManager, true),
{ {
@ -142,7 +140,6 @@ export const ModelingMachineProvider = ({
} }
) )
}) })
const { commandBarState } = useCommandsContext()
// Settings machine setup // Settings machine setup
// const retrievedSettings = useRef( // const retrievedSettings = useRef(
@ -328,11 +325,6 @@ export const ModelingMachineProvider = ({
) )
updateSceneObjectColors() updateSceneObjectColors()
// side effect to stop code mirror from updating the same selections again
editorManager.lastSelection = selections.codeBasedSelections
.map(({ range }) => `${range[1]}->${range[1]}`)
.join('&')
return { return {
selectionRanges: selections, selectionRanges: selections,
} }
@ -467,22 +459,12 @@ export const ModelingMachineProvider = ({
return canExtrudeSelection(selectionRanges) return canExtrudeSelection(selectionRanges)
}, },
'has valid selection for deletion': ({ selectionRanges }) => { 'Sketch is empty': ({ sketchDetails }) =>
if (!commandBarState.matches('Closed')) return false getNodeFromPath<VariableDeclaration>(
if (selectionRanges.codeBasedSelections.length <= 0) return false
return true
},
'Sketch is empty': ({ sketchDetails }) => {
const node = getNodeFromPath<VariableDeclaration>(
kclManager.ast, kclManager.ast,
sketchDetails?.sketchPathToNode || [], sketchDetails?.sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.init.type !== 'PipeExpression',
// This should not be returning false, and it should be caught
// but we need to simulate old behavior to move on.
if (err(node)) return false
return node.node?.declarations?.[0]?.init.type !== 'PipeExpression'
},
'Selection is on face': ({ selectionRanges }, { data }) => { 'Selection is on face': ({ selectionRanges }, { data }) => {
if (data?.forceNewSketch) return false if (data?.forceNewSketch) return false
if (!isSingleCursorInPipe(selectionRanges, kclManager.ast)) if (!isSingleCursorInPipe(selectionRanges, kclManager.ast))
@ -513,7 +495,7 @@ export const ModelingMachineProvider = ({
services: { services: {
'AST-undo-startSketchOn': async ({ sketchDetails }) => { 'AST-undo-startSketchOn': async ({ sketchDetails }) => {
if (!sketchDetails) return if (!sketchDetails) return
const newAst: Program = kclManager.ast const newAst: Program = JSON.parse(JSON.stringify(kclManager.ast))
const varDecIndex = sketchDetails.sketchPathToNode[1][0] const varDecIndex = sketchDetails.sketchPathToNode[1][0]
// remove body item at varDecIndex // remove body item at varDecIndex
newAst.body = newAst.body.filter((_, i) => i !== varDecIndex) newAst.body = newAst.body.filter((_, i) => i !== varDecIndex)
@ -525,16 +507,14 @@ export const ModelingMachineProvider = ({
}, },
'animate-to-face': async (_, { data }) => { 'animate-to-face': async (_, { data }) => {
if (data.type === 'extrudeFace') { if (data.type === 'extrudeFace') {
const sketched = sketchOnExtrudedFace( const { modifiedAst, pathToNode: pathToNewSketchNode } =
sketchOnExtrudedFace(
kclManager.ast, kclManager.ast,
data.sketchPathToNode, data.sketchPathToNode,
data.extrudePathToNode, data.extrudePathToNode,
kclManager.programMemory, kclManager.programMemory,
data.cap data.cap
) )
if (trap(sketched)) return Promise.reject(sketched)
const { modifiedAst, pathToNode: pathToNewSketchNode } = sketched
await kclManager.executeAstMock(modifiedAst) await kclManager.executeAstMock(modifiedAst)
await letEngineAnimateAndSyncCamAfter( await letEngineAnimateAndSyncCamAfter(
@ -555,12 +535,10 @@ export const ModelingMachineProvider = ({
) )
await kclManager.updateAst(modifiedAst, false) await kclManager.updateAst(modifiedAst, false)
sceneInfra.camControls.syncDirection = 'clientToEngine' sceneInfra.camControls.syncDirection = 'clientToEngine'
await letEngineAnimateAndSyncCamAfter( await letEngineAnimateAndSyncCamAfter(
engineCommandManager, engineCommandManager,
data.planeId data.planeId
) )
return { return {
sketchPathToNode: pathToNode, sketchPathToNode: pathToNode,
zAxis: data.zAxis, zAxis: data.zAxis,
@ -598,29 +576,25 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
}) })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) if (!sketchDetails) throw new Error('No sketch details')
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch( await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection, selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -634,29 +608,25 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
}) })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) if (!sketchDetails) throw new Error('No sketch details')
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch( await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection, selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -664,11 +634,9 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
sketchDetails, sketchDetails,
}): Promise<SetSelections> => { }): Promise<SetSelections> => {
const info = angleBetweenInfo({ const { modifiedAst, pathToNodeMap } = await (angleBetweenInfo({
selectionRanges, selectionRanges,
}) }).enabled
if (err(info)) return Promise.reject(info)
const { modifiedAst, pathToNodeMap } = await (info.enabled
? applyConstraintAngleBetween({ ? applyConstraintAngleBetween({
selectionRanges, selectionRanges,
}) })
@ -677,31 +645,25 @@ export const ModelingMachineProvider = ({
angleOrLength: 'setAngle', angleOrLength: 'setAngle',
})) }))
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (err(_modifiedAst)) return Promise.reject(_modifiedAst) if (!sketchDetails) throw new Error('No sketch details')
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch( await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection, selection: pathMapToSelections(
_modifiedAst,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -712,29 +674,25 @@ export const ModelingMachineProvider = ({
const { modifiedAst, pathToNodeMap } = const { modifiedAst, pathToNodeMap } =
await applyConstraintAngleLength({ selectionRanges }) await applyConstraintAngleLength({ selectionRanges })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) if (!sketchDetails) throw new Error('No sketch details')
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch( await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection, selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -748,29 +706,25 @@ export const ModelingMachineProvider = ({
} }
) )
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) if (!sketchDetails) throw new Error('No sketch details')
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch( await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection, selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -784,29 +738,25 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
}) })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) if (!sketchDetails) throw new Error('No sketch details')
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch( await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection, selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -820,77 +770,48 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
}) })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) if (!sketchDetails) throw new Error('No sketch details')
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch( await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection, selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
'Get convert to variable info': async ( 'Get convert to variable info': async ({ sketchDetails }, { data }) => {
{ sketchDetails, selectionRanges }, if (!sketchDetails) return []
{ data }
): Promise<SetSelections> => {
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const { variableName } = await getVarNameModal({ const { variableName } = await getVarNameModal({
valueName: data.variableName || 'var', valueName: data.variableName || 'var',
}) })
let parsed = parse(recast(kclManager.ast))
if (trap(parsed)) return Promise.reject(parsed)
parsed = parsed as Program
const { modifiedAst: _modifiedAst, pathToReplacedNode } = const { modifiedAst: _modifiedAst, pathToReplacedNode } =
moveValueIntoNewVariablePath( moveValueIntoNewVariablePath(
parsed, parse(recast(kclManager.ast)),
kclManager.programMemory, kclManager.programMemory,
data.pathToNode, data.pathToNode,
variableName variableName
) )
parsed = parse(recast(_modifiedAst)) await sceneEntitiesManager.updateAstAndRejigSketch(
if (trap(parsed)) return Promise.reject(parsed)
parsed = parsed as Program
if (!pathToReplacedNode)
return Promise.reject(new Error('No path to replaced node'))
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
pathToReplacedNode || [], pathToReplacedNode || [],
parsed, parse(recast(_modifiedAst)),
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst) return pathToReplacedNode || sketchDetails.sketchPathToNode
const selection = updateSelections(
{ 0: pathToReplacedNode },
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
updatedPathToNode: pathToReplacedNode,
}
}, },
}, },
devTools: true, devTools: true,
@ -935,11 +856,6 @@ export const ModelingMachineProvider = ({
} }
}, [modelingSend]) }, [modelingSend])
// Allow using the delete key to delete solids
useHotkeys(['backspace', 'delete', 'del'], () => {
modelingSend({ type: 'Delete selection' })
})
useStateMachineCommands({ useStateMachineCommands({
machineId: 'modeling', machineId: 'modeling',
state: modelingState, state: modelingState,

View File

@ -43,23 +43,23 @@ describe('processMemory', () => {
theExtrude: [ theExtrude: [
{ {
type: 'extrudePlane', type: 'extrudePlane',
tag: null, name: '',
id: expect.any(String), id: expect.any(String),
faceId: expect.any(String), faceId: expect.any(String),
sourceRange: [170, 194], sourceRange: [170, 194],
}, },
{ {
type: 'extrudePlane', type: 'extrudePlane',
tag: null, name: '',
id: expect.any(String), id: expect.any(String),
faceId: expect.any(String), faceId: expect.any(String),
sourceRange: [202, 230], sourceRange: [202, 230],
}, },
], ],
theSketch: [ theSketch: [
{ type: 'ToPoint', to: [-3.35, 0.17], from: [0, 0], tag: null }, { type: 'ToPoint', to: [-3.35, 0.17], from: [0, 0], name: '' },
{ type: 'ToPoint', to: [0.98, 5.16], from: [-3.35, 0.17], tag: null }, { type: 'ToPoint', to: [0.98, 5.16], from: [-3.35, 0.17], name: '' },
{ type: 'ToPoint', to: [2.15, 4.32], from: [0.98, 5.16], tag: null }, { type: 'ToPoint', to: [2.15, 4.32], from: [0.98, 5.16], name: '' },
], ],
}) })
}) })

View File

@ -1,11 +1,10 @@
import toast from 'react-hot-toast'
import ReactJson from 'react-json-view' import ReactJson from 'react-json-view'
import { useMemo } from 'react' import { useMemo } from 'react'
import { ProgramMemory, Path, ExtrudeSurface } from 'lang/wasm' import { ProgramMemory, Path, ExtrudeSurface } from 'lang/wasm'
import { useKclContext } from 'lang/KclProvider' import { useKclContext } from 'lang/KclProvider'
import { useResolvedTheme } from 'hooks/useResolvedTheme' import { useResolvedTheme } from 'hooks/useResolvedTheme'
import { ActionButton } from 'components/ActionButton' import { ActionButton } from 'components/ActionButton'
import { trap } from 'lib/trap' import toast from 'react-hot-toast'
import Tooltip from 'components/Tooltip' import Tooltip from 'components/Tooltip'
import { useModelingContext } from 'hooks/useModelingContext' import { useModelingContext } from 'hooks/useModelingContext'
@ -14,12 +13,12 @@ export const MemoryPaneMenu = () => {
function copyProgramMemoryToClipboard() { function copyProgramMemoryToClipboard() {
if (globalThis && 'navigator' in globalThis) { if (globalThis && 'navigator' in globalThis) {
navigator.clipboard try {
.writeText(JSON.stringify(programMemory)) navigator.clipboard.writeText(JSON.stringify(programMemory))
.then(() => toast.success('Program memory copied to clipboard')) toast.success('Program memory copied to clipboard')
.catch((e) => } catch (e) {
trap(new Error('Failed to copy program memory to clipboard')) toast.error('Failed to copy program memory to clipboard')
) }
} }
} }

View File

@ -1,25 +1,7 @@
import { coreDump } from 'lang/wasm'
import { CoreDumpManager } from 'lib/coredump'
import { CustomIcon } from './CustomIcon' import { CustomIcon } from './CustomIcon'
import { engineCommandManager } from 'lib/singletons'
import React from 'react'
import toast from 'react-hot-toast'
import Tooltip from './Tooltip' import Tooltip from './Tooltip'
import { useStore } from 'useStore'
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
export const RefreshButton = ({ children }: React.PropsWithChildren) => {
const { auth } = useSettingsAuthContext()
const token = auth?.context?.token
const { htmlRef } = useStore((s) => ({
htmlRef: s.htmlRef,
}))
const coreDumpManager = new CoreDumpManager(
engineCommandManager,
htmlRef,
token
)
export function RefreshButton() {
async function refresh() { async function refresh() {
if (window && 'plausible' in window) { if (window && 'plausible' in window) {
const p = window.plausible as ( const p = window.plausible as (
@ -35,26 +17,8 @@ export const RefreshButton = ({ children }: React.PropsWithChildren) => {
}) })
} }
toast
.promise(
coreDump(coreDumpManager, true),
{
loading: 'Starting core dump...',
success: 'Core dump completed successfully',
error: 'Error while exporting core dump',
},
{
success: {
// Note: this extended duration is especially important for Playwright e2e testing
// default duration is 2000 - https://react-hot-toast.com/docs/toast#default-durations
duration: 6000,
},
}
)
.then(() => {
// Window may not be available in some environments // Window may not be available in some environments
window?.location.reload() window?.location.reload()
})
} }
return ( return (

View File

@ -83,7 +83,6 @@ export const Stream = ({ className = '' }: { className?: string }) => {
if (!videoRef.current) return if (!videoRef.current) return
if (state.matches('Sketch')) return if (state.matches('Sketch')) return
if (state.matches('Sketch no face')) return if (state.matches('Sketch no face')) return
const { x, y } = getNormalisedCoordinates({ const { x, y } = getNormalisedCoordinates({
clientX: e.clientX, clientX: e.clientX,
clientY: e.clientY, clientY: e.clientY,
@ -128,7 +127,6 @@ export const Stream = ({ className = '' }: { className?: string }) => {
return ( return (
<div <div
className="absolute inset-0 z-0" className="absolute inset-0 z-0"
id="stream"
data-testid="stream" data-testid="stream"
onMouseUp={handleMouseUp} onMouseUp={handleMouseUp}
onMouseDown={handleMouseDown} onMouseDown={handleMouseDown}

View File

@ -10,46 +10,28 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
export function equalAngleInfo({ export function equalAngleInfo({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}): }) {
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const _nodes = paths.map((pathToNode) => { const nodes = paths.map(
const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode) (pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node
if (err(tmp)) return tmp )
return tmp.node const varDecs = paths.map(
}) (pathToNode) =>
const _err1 = _nodes.find(err) getNodeFromPath<VariableDeclarator>(
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const _varDecs = paths.map((pathToNode) => {
const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
)?.node
) )
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -69,7 +51,6 @@ export function equalAngleInfo({
kclManager.ast, kclManager.ast,
'equalAngle' 'equalAngle'
) )
if (err(transforms)) return transforms
const enabled = const enabled =
!!secondaryVarDecs.length && !!secondaryVarDecs.length &&
@ -83,24 +64,16 @@ export function applyConstraintEqualAngle({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}): }): {
| {
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
} } {
| Error { const { transforms } = equalAngleInfo({ selectionRanges })
const info = equalAngleInfo({ selectionRanges }) const { modifiedAst, pathToNodeMap } = transformSecondarySketchLinesTagFirst({
if (err(info)) return info
const { transforms } = info
const transform = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos: transforms, transformInfos: transforms,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(transform)) return transform
const { modifiedAst, pathToNodeMap } = transform
return { modifiedAst, pathToNodeMap } return { modifiedAst, pathToNodeMap }
} }

View File

@ -10,46 +10,28 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
export function setEqualLengthInfo({ export function setEqualLengthInfo({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}): }) {
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const _nodes = paths.map((pathToNode) => { const nodes = paths.map(
const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode) (pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node
if (err(tmp)) return tmp )
return tmp.node const varDecs = paths.map(
}) (pathToNode) =>
const _err1 = _nodes.find(err) getNodeFromPath<VariableDeclarator>(
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const _varDecs = paths.map((pathToNode) => {
const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
)?.node
) )
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -69,7 +51,6 @@ export function setEqualLengthInfo({
kclManager.ast, kclManager.ast,
'equalLength' 'equalLength'
) )
if (err(transforms)) return transforms
const enabled = const enabled =
!!secondaryVarDecs.length && !!secondaryVarDecs.length &&
@ -84,24 +65,16 @@ export function applyConstraintEqualLength({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}): }): {
| {
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
} } {
| Error { const { transforms } = setEqualLengthInfo({ selectionRanges })
const info = setEqualLengthInfo({ selectionRanges }) const { modifiedAst, pathToNodeMap } = transformSecondarySketchLinesTagFirst({
if (err(info)) return info
const { transforms } = info
const transform = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos: transforms, transformInfos: transforms,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(transform)) return transform
const { modifiedAst, pathToNodeMap } = transform
return { modifiedAst, pathToNodeMap } return { modifiedAst, pathToNodeMap }
} }

View File

@ -9,32 +9,19 @@ import {
PathToNodeMap, PathToNodeMap,
getTransformInfos, getTransformInfos,
transformAstSketchLines, transformAstSketchLines,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
export function horzVertInfo( export function horzVertInfo(
selectionRanges: Selections, selectionRanges: Selections,
horOrVert: 'vertical' | 'horizontal' horOrVert: 'vertical' | 'horizontal'
): ) {
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const _nodes = paths.map((pathToNode) => { const nodes = paths.map(
const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode) (pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node
if (err(tmp)) return tmp )
return tmp.node
})
const _err1 = _nodes.find(err)
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const isAllTooltips = nodes.every( const isAllTooltips = nodes.every(
(node) => (node) =>
node?.type === 'CallExpression' && node?.type === 'CallExpression' &&
@ -46,8 +33,6 @@ export function horzVertInfo(
kclManager.ast, kclManager.ast,
horOrVert horOrVert
) )
if (err(theTransforms)) return theTransforms
const _enableHorz = isAllTooltips && theTransforms.every(Boolean) const _enableHorz = isAllTooltips && theTransforms.every(Boolean)
return { enabled: _enableHorz, transforms: theTransforms } return { enabled: _enableHorz, transforms: theTransforms }
} }
@ -57,16 +42,11 @@ export function applyConstraintHorzVert(
horOrVert: 'vertical' | 'horizontal', horOrVert: 'vertical' | 'horizontal',
ast: Program, ast: Program,
programMemory: ProgramMemory programMemory: ProgramMemory
): ): {
| {
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
} } {
| Error { const transformInfos = horzVertInfo(selectionRanges, horOrVert).transforms
const info = horzVertInfo(selectionRanges, horOrVert)
if (err(info)) return info
const transformInfos = info.transforms
return transformAstSketchLines({ return transformAstSketchLines({
ast, ast,
selectionRanges, selectionRanges,

View File

@ -11,13 +11,11 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal' import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal'
import { createVariableDeclaration } from '../../lang/modifyAst' import { createVariableDeclaration } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createInfoModal(GetInfoModal) const getModalInfo = createInfoModal(GetInfoModal)
@ -25,13 +23,7 @@ export function intersectInfo({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}): }) {
| {
transforms: TransformInfo[]
enabled: boolean
forcedSelectionRanges: Selections
}
| Error {
if (selectionRanges.codeBasedSelections.length < 2) { if (selectionRanges.codeBasedSelections.length < 2) {
return { return {
enabled: false, enabled: false,
@ -48,8 +40,6 @@ export function intersectInfo({
selectionRanges.codeBasedSelections[0], selectionRanges.codeBasedSelections[0],
selectionRanges.codeBasedSelections[1] selectionRanges.codeBasedSelections[1]
) )
if (err(previousSegment)) return previousSegment
const shouldUsePreviousSegment = const shouldUsePreviousSegment =
selectionRanges.codeBasedSelections?.[1]?.type !== 'line-end' && selectionRanges.codeBasedSelections?.[1]?.type !== 'line-end' &&
previousSegment && previousSegment &&
@ -71,28 +61,17 @@ export function intersectInfo({
const paths = _forcedSelectionRanges.codeBasedSelections.map(({ range }) => const paths = _forcedSelectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const _nodes = paths.map((pathToNode) => { const nodes = paths.map(
const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode) (pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node
if (err(tmp)) return tmp )
return tmp.node const varDecs = paths.map(
}) (pathToNode) =>
const _err1 = _nodes.find(err) getNodeFromPath<VariableDeclarator>(
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const _varDecs = paths.map((pathToNode) => {
const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
)?.node
) )
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -138,22 +117,16 @@ export async function applyConstraintIntersect({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const info = intersectInfo({ const { transforms, forcedSelectionRanges } = intersectInfo({
selectionRanges, selectionRanges,
}) })
if (err(info)) return Promise.reject(info) const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
const { transforms, forcedSelectionRanges } = info transformSecondarySketchLinesTagFirst({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
const transform1 = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast,
selectionRanges: forcedSelectionRanges, selectionRanges: forcedSelectionRanges,
transformInfos: transforms, transformInfos: transforms,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(transform1)) return Promise.reject(transform1)
const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
transform1
const { const {
segName, segName,
value, value,
@ -183,7 +156,8 @@ export async function applyConstraintIntersect({
sign, sign,
variableName variableName
) )
const transform2 = transformSecondarySketchLinesTagFirst({ const { modifiedAst: _modifiedAst, pathToNodeMap: _pathToNodeMap } =
transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges: forcedSelectionRanges, selectionRanges: forcedSelectionRanges,
transformInfos: transforms, transformInfos: transforms,
@ -191,10 +165,6 @@ export async function applyConstraintIntersect({
forceSegName: segName, forceSegName: segName,
forceValueUsedInTransform: finalValue, forceValueUsedInTransform: finalValue,
}) })
if (err(transform2)) return Promise.reject(transform2)
const { modifiedAst: _modifiedAst, pathToNodeMap: _pathToNodeMap } =
transform2
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(

View File

@ -9,10 +9,8 @@ import {
PathToNodeMap, PathToNodeMap,
getRemoveConstraintsTransforms, getRemoveConstraintsTransforms,
transformAstSketchLines, transformAstSketchLines,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
export function removeConstrainingValuesInfo({ export function removeConstrainingValuesInfo({
selectionRanges, selectionRanges,
@ -20,27 +18,15 @@ export function removeConstrainingValuesInfo({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
pathToNodes?: Array<PathToNode> pathToNodes?: Array<PathToNode>
}): }) {
| {
transforms: TransformInfo[]
enabled: boolean
updatedSelectionRanges: Selections
}
| Error {
const paths = const paths =
pathToNodes || pathToNodes ||
selectionRanges.codeBasedSelections.map(({ range }) => selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const _nodes = paths.map((pathToNode) => { const nodes = paths.map(
const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode) (pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node
if (err(tmp)) return tmp )
return tmp.node
})
const _err1 = _nodes.find(err)
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const updatedSelectionRanges = pathToNodes const updatedSelectionRanges = pathToNodes
? { ? {
otherSelections: [], otherSelections: [],
@ -58,15 +44,19 @@ export function removeConstrainingValuesInfo({
toolTips.includes(node.callee.name as any) toolTips.includes(node.callee.name as any)
) )
try {
const transforms = getRemoveConstraintsTransforms( const transforms = getRemoveConstraintsTransforms(
updatedSelectionRanges, updatedSelectionRanges,
kclManager.ast, kclManager.ast,
'removeConstrainingValues' 'removeConstrainingValues'
) )
if (err(transforms)) return transforms
const enabled = isAllTooltips && transforms.every(Boolean) const enabled = isAllTooltips && transforms.every(Boolean)
return { enabled, transforms, updatedSelectionRanges } return { enabled, transforms, updatedSelectionRanges }
} catch (e) {
console.error(e)
return { enabled: false, transforms: [], updatedSelectionRanges }
}
} }
export function applyRemoveConstrainingValues({ export function applyRemoveConstrainingValues({
@ -75,19 +65,14 @@ export function applyRemoveConstrainingValues({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
pathToNodes?: Array<PathToNode> pathToNodes?: Array<PathToNode>
}): }): {
| {
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
} } {
| Error { const { transforms, updatedSelectionRanges } = removeConstrainingValuesInfo({
const constraint = removeConstrainingValuesInfo({
selectionRanges, selectionRanges,
pathToNodes, pathToNodes,
}) })
if (err(constraint)) return constraint
const { transforms, updatedSelectionRanges } = constraint
return transformAstSketchLines({ return transformAstSketchLines({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges: updatedSelectionRanges, selectionRanges: updatedSelectionRanges,

View File

@ -9,7 +9,6 @@ import {
getTransformInfos, getTransformInfos,
transformAstSketchLines, transformAstSketchLines,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { import {
SetAngleLengthModal, SetAngleLengthModal,
@ -21,7 +20,6 @@ import {
} from '../../lang/modifyAst' } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal) const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal)
@ -33,12 +31,7 @@ export function absDistanceInfo({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
constraint: Constraint constraint: Constraint
}): }) {
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const disType = const disType =
constraint === 'xAbs' || constraint === 'yAbs' constraint === 'xAbs' || constraint === 'yAbs'
? constraint ? constraint
@ -48,19 +41,10 @@ export function absDistanceInfo({
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const _nodes = paths.map((pathToNode) => { const nodes = paths.map(
const tmp = getNodeFromPath<Value>( (pathToNode) =>
kclManager.ast, getNodeFromPath<Value>(kclManager.ast, pathToNode, 'CallExpression').node
pathToNode,
'CallExpression'
) )
if (err(tmp)) return tmp
return tmp.node
})
const _err1 = _nodes.find(err)
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const isAllTooltips = nodes.every( const isAllTooltips = nodes.every(
(node) => (node) =>
node?.type === 'CallExpression' && node?.type === 'CallExpression' &&
@ -68,7 +52,6 @@ export function absDistanceInfo({
) )
const transforms = getTransformInfos(selectionRanges, kclManager.ast, disType) const transforms = getTransformInfos(selectionRanges, kclManager.ast, disType)
if (err(transforms)) return transforms
const enableY = const enableY =
disType === 'yAbs' && disType === 'yAbs' &&
@ -98,23 +81,17 @@ export async function applyConstraintAbsDistance({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const info = absDistanceInfo({ const transformInfos = absDistanceInfo({
selectionRanges, selectionRanges,
constraint, constraint,
}) }).transforms
if (err(info)) return Promise.reject(info) const { valueUsedInTransform } = transformAstSketchLines({
const transformInfos = info.transforms ast: JSON.parse(JSON.stringify(kclManager.ast)),
const transform1 = transformAstSketchLines({
ast: kclManager.ast,
selectionRanges: selectionRanges, selectionRanges: selectionRanges,
transformInfos, transformInfos,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
referenceSegName: '', referenceSegName: '',
}) })
if (err(transform1)) return Promise.reject(transform1)
const { valueUsedInTransform } = transform1
let forceVal = valueUsedInTransform || 0 let forceVal = valueUsedInTransform || 0
const { valueNode, variableName, newVariableInsertIndex, sign } = const { valueNode, variableName, newVariableInsertIndex, sign } =
await getModalInfo({ await getModalInfo({
@ -127,17 +104,14 @@ export async function applyConstraintAbsDistance({
variableName variableName
) )
const transform2 = transformAstSketchLines({ const { modifiedAst: _modifiedAst, pathToNodeMap } = transformAstSketchLines({
ast: kclManager.ast, ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges: selectionRanges, selectionRanges: selectionRanges,
transformInfos, transformInfos,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
referenceSegName: '', referenceSegName: '',
forceValueUsedInTransform: finalValue, forceValueUsedInTransform: finalValue,
}) })
if (err(transform2)) return Promise.reject(transform2)
const { modifiedAst: _modifiedAst, pathToNodeMap } = transform2
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(
@ -160,23 +134,19 @@ export function applyConstraintAxisAlign({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
constraint: 'snapToYAxis' | 'snapToXAxis' constraint: 'snapToYAxis' | 'snapToXAxis'
}): }): {
| {
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
} } {
| Error { const transformInfos = absDistanceInfo({
const info = absDistanceInfo({
selectionRanges, selectionRanges,
constraint, constraint,
}) }).transforms
if (err(info)) return info
const transformInfos = info.transforms
let finalValue = createIdentifier('ZERO') let finalValue = createIdentifier('ZERO')
return transformAstSketchLines({ return transformAstSketchLines({
ast: kclManager.ast, ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges: selectionRanges, selectionRanges: selectionRanges,
transformInfos, transformInfos,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,

View File

@ -10,13 +10,11 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal' import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal'
import { createVariableDeclaration } from '../../lang/modifyAst' import { createVariableDeclaration } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createInfoModal(GetInfoModal) const getModalInfo = createInfoModal(GetInfoModal)
@ -24,38 +22,22 @@ export function angleBetweenInfo({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}): }) {
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const _nodes = paths.map((pathToNode) => { const nodes = paths.map(
const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode) (pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node
if (err(tmp)) return tmp )
return tmp.node const varDecs = paths.map(
}) (pathToNode) =>
const _err1 = _nodes.find(err) getNodeFromPath<VariableDeclarator>(
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const _varDecs = paths.map((pathToNode) => {
const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
)?.node
) )
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -95,20 +77,14 @@ export async function applyConstraintAngleBetween({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const info = angleBetweenInfo({ selectionRanges }) const transformInfos = angleBetweenInfo({ selectionRanges }).transforms
if (err(info)) return Promise.reject(info) const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
const transformInfos = info.transforms transformSecondarySketchLinesTagFirst({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
const transformed1 = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos, transformInfos,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(transformed1)) return Promise.reject(transformed1)
const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
transformed1
const { const {
segName, segName,
value, value,
@ -139,7 +115,8 @@ export async function applyConstraintAngleBetween({
variableName variableName
) )
// transform again but forcing certain values // transform again but forcing certain values
const transformed2 = transformSecondarySketchLinesTagFirst({ const { modifiedAst: _modifiedAst, pathToNodeMap: _pathToNodeMap } =
transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos, transformInfos,
@ -147,10 +124,6 @@ export async function applyConstraintAngleBetween({
forceSegName: segName, forceSegName: segName,
forceValueUsedInTransform: finalValue, forceValueUsedInTransform: finalValue,
}) })
if (err(transformed2)) return Promise.reject(transformed2)
const { modifiedAst: _modifiedAst, pathToNodeMap: _pathToNodeMap } =
transformed2
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(

View File

@ -9,14 +9,12 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal' import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal'
import { createLiteral, createVariableDeclaration } from '../../lang/modifyAst' import { createLiteral, createVariableDeclaration } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { Selections } from 'lib/selections' import { Selections } from 'lib/selections'
import { cleanErrs, err } from 'lib/trap'
const getModalInfo = createInfoModal(GetInfoModal) const getModalInfo = createInfoModal(GetInfoModal)
@ -26,38 +24,21 @@ export function horzVertDistanceInfo({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
constraint: 'setHorzDistance' | 'setVertDistance' constraint: 'setHorzDistance' | 'setVertDistance'
}): }) {
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const _nodes = paths.map((pathToNode) => { const nodes = paths.map(
const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode) (pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node
if (err(tmp)) return tmp )
return tmp.node const varDecs = paths.map(
}) (pathToNode) =>
const [hasErr, , nodesWErrs] = cleanErrs(_nodes) getNodeFromPath<VariableDeclarator>(
if (hasErr) return nodesWErrs[0]
const nodes = _nodes as Value[]
const _varDecs = paths.map((pathToNode) => {
const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
)?.node
) )
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -101,21 +82,17 @@ export async function applyConstraintHorzVertDistance({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const info = horzVertDistanceInfo({ const transformInfos = horzVertDistanceInfo({
selectionRanges, selectionRanges,
constraint, constraint,
}) }).transforms
if (err(info)) return Promise.reject(info) const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
const transformInfos = info.transforms transformSecondarySketchLinesTagFirst({
const transformed = transformSecondarySketchLinesTagFirst({ ast: JSON.parse(JSON.stringify(kclManager.ast)),
ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos, transformInfos,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(transformed)) return Promise.reject(transformed)
const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
transformed
const { const {
segName, segName,
value, value,
@ -143,7 +120,8 @@ export async function applyConstraintHorzVertDistance({
? createLiteral(0) ? createLiteral(0)
: removeDoubleNegatives(valueNode as BinaryPart, sign, variableName) : removeDoubleNegatives(valueNode as BinaryPart, sign, variableName)
// transform again but forcing certain values // transform again but forcing certain values
const transformed = transformSecondarySketchLinesTagFirst({ const { modifiedAst: _modifiedAst, pathToNodeMap } =
transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos, transformInfos,
@ -151,9 +129,6 @@ export async function applyConstraintHorzVertDistance({
forceSegName: segName, forceSegName: segName,
forceValueUsedInTransform: finalValue, forceValueUsedInTransform: finalValue,
}) })
if (err(transformed)) return Promise.reject(transformed)
const { modifiedAst: _modifiedAst, pathToNodeMap } = transformed
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(
@ -180,28 +155,22 @@ export function applyConstraintHorzVertAlign({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
constraint: 'setHorzDistance' | 'setVertDistance' constraint: 'setHorzDistance' | 'setVertDistance'
}): }): {
| {
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
} } {
| Error { const transformInfos = horzVertDistanceInfo({
const info = horzVertDistanceInfo({
selectionRanges, selectionRanges,
constraint, constraint,
}) }).transforms
if (err(info)) return info
const transformInfos = info.transforms
let finalValue = createLiteral(0) let finalValue = createLiteral(0)
const retval = transformSecondarySketchLinesTagFirst({ const { modifiedAst, pathToNodeMap } = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos, transformInfos,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
forceValueUsedInTransform: finalValue, forceValueUsedInTransform: finalValue,
}) })
if (err(retval)) return retval
const { modifiedAst, pathToNodeMap } = retval
return { return {
modifiedAst: modifiedAst, modifiedAst: modifiedAst,
pathToNodeMap, pathToNodeMap,

View File

@ -9,7 +9,6 @@ import {
PathToNodeMap, PathToNodeMap,
getTransformInfos, getTransformInfos,
transformAstSketchLines, transformAstSketchLines,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { import {
SetAngleLengthModal, SetAngleLengthModal,
@ -23,7 +22,6 @@ import {
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { normaliseAngle } from '../../lib/utils' import { normaliseAngle } from '../../lib/utils'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal) const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal)
@ -33,29 +31,19 @@ export function angleLengthInfo({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
angleOrLength?: 'setLength' | 'setAngle' angleOrLength?: 'setLength' | 'setAngle'
}): }) {
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map(
const nodes = paths.map((pathToNode) => (pathToNode) =>
getNodeFromPath<Value>(kclManager.ast, pathToNode, 'CallExpression') getNodeFromPath<Value>(kclManager.ast, pathToNode, 'CallExpression').node
) )
const _err1 = nodes.find(err) const isAllTooltips = nodes.every(
if (err(_err1)) return _err1 (node) =>
node?.type === 'CallExpression' &&
const isAllTooltips = nodes.every((meta) => { toolTips.includes(node.callee.name as any)
if (err(meta)) return false
return (
meta.node?.type === 'CallExpression' &&
toolTips.includes(meta.node.callee.name as any)
) )
})
const transforms = getTransformInfos( const transforms = getTransformInfos(
selectionRanges, selectionRanges,
@ -79,20 +67,15 @@ export async function applyConstraintAngleLength({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const angleLength = angleLengthInfo({ selectionRanges, angleOrLength }) const { transforms } = angleLengthInfo({ selectionRanges, angleOrLength })
if (err(angleLength)) return Promise.reject(angleLength) const { valueUsedInTransform } = transformAstSketchLines({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
const { transforms } = angleLength
const sketched = transformAstSketchLines({
ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos: transforms, transformInfos: transforms,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
referenceSegName: '', referenceSegName: '',
}) })
if (err(sketched)) return Promise.reject(sketched) try {
const { valueUsedInTransform } = sketched
const isReferencingYAxis = const isReferencingYAxis =
selectionRanges.otherSelections.length === 1 && selectionRanges.otherSelections.length === 1 &&
selectionRanges.otherSelections[0] === 'y-axis' selectionRanges.otherSelections[0] === 'y-axis'
@ -138,17 +121,15 @@ export async function applyConstraintAngleLength({
finalValue = createBinaryExpressionWithUnary([calcIdentifier, finalValue]) finalValue = createBinaryExpressionWithUnary([calcIdentifier, finalValue])
} }
const retval = transformAstSketchLines({ const { modifiedAst: _modifiedAst, pathToNodeMap } =
ast: kclManager.ast, transformAstSketchLines({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges, selectionRanges,
transformInfos: transforms, transformInfos: transforms,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
referenceSegName: '', referenceSegName: '',
forceValueUsedInTransform: finalValue, forceValueUsedInTransform: finalValue,
}) })
if (err(retval)) return Promise.reject(retval)
const { modifiedAst: _modifiedAst, pathToNodeMap } = retval
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(
@ -166,4 +147,8 @@ export async function applyConstraintAngleLength({
modifiedAst: _modifiedAst, modifiedAst: _modifiedAst,
pathToNodeMap, pathToNodeMap,
} }
} catch (e) {
console.log('error', e)
throw e
}
} }

Some files were not shown because too many files have changed in this diff Show More