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
169 changed files with 9776 additions and 106271 deletions

View File

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

View File

@ -95,13 +95,21 @@ jobs:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: check for changes
id: git-check
run: |
git add .
if git status | grep -q "Changes to be committed"
then echo "modified=true" >> $GITHUB_OUTPUT
else echo "modified=false" >> $GITHUB_OUTPUT
then
echo "::set-output name=modified::true"
else
echo "::set-output name=modified::false"
fi
- name: Commit changes, if any
if: steps.git-check.outputs.modified == 'true'
@ -117,53 +125,17 @@ jobs:
git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true
git push
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
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
path: test-results/
- name: Run ubuntu/chrome flow retry failures
id: retry
if: always()
run: |
ls -1 "test-results"
if [[ $(ls -1 "test-results" | wc -l) == "0" ]];
then echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
else echo "retried=true" >> $GITHUB_OUTPUT;
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
if: steps.retry.outputs.retried == 'false'
run: yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts
env:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
name: playwright-report-ubuntu
path: playwright-report/
retention-days: 30
overwrite: true
playwright-macos:
timeout-minutes: 60
@ -222,46 +194,16 @@ jobs:
run: yarn build:wasm
- name: build web
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
path: test-results/
- name: Run macos/safari flow retry failures
id: retry
continue-on-error: true
if: ${{ success() }}
run: |
if [ -d "test-results" ];
then echo "retried=true" >> $GITHUB_OUTPUT;
else echo "retried=false" >> $GITHUB_OUTPUT;
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
if: ${{ steps.retry.outputs.retried != 'true' }}
# 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
run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts
env:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v4
if: ${{ always() }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: playwright-report
name: playwright-report-macos
path: playwright-report/
retention-days: 30
overwrite: true

View File

@ -1,17 +1,14 @@
.PHONY: dev
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
$(XSTATE_TYPEGENS): $(TS_SRC)
yarn xstate typegen 'src/**/*.ts?(x)'
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
yarn build:wasm-dev
node_modules: package.json yarn.lock
node_modules: package.json
package.json:
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
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
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
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
## Tests
### Playwright tests
### Playwright
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.
### 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
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
this will work.
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
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.
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet cases work currently.

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for x.
```js
angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number
```
### Examples
@ -31,12 +31,7 @@ const extrusion = extrude(5, sketch001)
### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `segment_name`: `string` (REQUIRED)
* `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
@ -76,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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -277,12 +101,8 @@ const extrusion = extrude(5, sketch001)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -290,12 +110,8 @@ const extrusion = extrude(5, sketch001)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -307,12 +123,8 @@ const extrusion = extrude(5, sketch001)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -320,12 +132,8 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -333,12 +141,8 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -348,12 +152,8 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -365,12 +165,8 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for y.
```js
angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number
```
### Examples
@ -32,12 +32,7 @@ const extrusion = extrude(5, sketch001)
### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `segment_name`: `string` (REQUIRED)
* `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -278,12 +102,8 @@ const extrusion = extrude(5, sketch001)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -291,12 +111,8 @@ const extrusion = extrude(5, sketch001)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -308,12 +124,8 @@ const extrusion = extrude(5, sketch001)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -321,12 +133,8 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -334,12 +142,8 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -349,12 +153,8 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -366,12 +166,8 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line.
```js
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -279,12 +108,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -292,12 +117,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -309,12 +130,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -322,12 +139,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -335,12 +148,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -350,12 +159,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -367,26 +172,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -629,12 +252,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -642,12 +261,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -659,12 +274,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -672,12 +283,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -685,12 +292,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -700,12 +303,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -717,12 +316,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line of a given x length.
```js
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### Examples
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -278,12 +107,8 @@ const extrusion = extrude(10, sketch001)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -291,12 +116,8 @@ const extrusion = extrude(10, sketch001)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -308,12 +129,8 @@ const extrusion = extrude(10, sketch001)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -321,12 +138,8 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -334,12 +147,8 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -349,12 +158,8 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -366,26 +171,15 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -628,12 +251,8 @@ const extrusion = extrude(10, sketch001)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -641,12 +260,8 @@ const extrusion = extrude(10, sketch001)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -658,12 +273,8 @@ const extrusion = extrude(10, sketch001)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -671,12 +282,8 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -684,12 +291,8 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -699,12 +302,8 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -716,12 +315,8 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line of a given y length.
```js
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -280,12 +109,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -293,12 +118,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -310,12 +131,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -323,12 +140,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -336,12 +149,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -351,12 +160,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -368,26 +173,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -630,12 +253,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -643,12 +262,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -660,12 +275,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -673,12 +284,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -686,12 +293,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -701,12 +304,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -718,12 +317,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line that intersects with a given line.
```js
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### Examples
@ -40,9 +40,7 @@ const example = extrude(10, exampleSketch)
// The angle of the line.
angle: number,
// The tag of the line to intersect with.
intersectTag: {
value: string,
},
intersectTag: string,
// The offset from the intersecting line.
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -286,12 +113,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -299,12 +122,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -316,12 +135,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -329,12 +144,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -342,12 +153,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -357,12 +164,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -374,26 +177,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -636,12 +257,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -649,12 +266,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -666,12 +279,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -679,12 +288,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -692,12 +297,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -707,12 +308,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -724,12 +321,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line to a given x coordinate.
```js
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -277,12 +106,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -290,12 +115,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -307,12 +128,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -320,12 +137,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -333,12 +146,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -348,12 +157,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -365,26 +170,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -627,12 +250,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -640,12 +259,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -657,12 +272,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -670,12 +281,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -683,12 +290,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -698,12 +301,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -715,12 +314,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line to a given y coordinate.
```js
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -277,12 +106,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -290,12 +115,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -307,12 +128,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -320,12 +137,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -333,12 +146,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -348,12 +157,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -365,26 +170,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -627,12 +250,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -640,12 +259,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -657,12 +272,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -670,12 +281,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -683,12 +290,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -698,12 +301,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -715,12 +314,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw an arc.
```js
arc(data: ArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -288,12 +117,8 @@ const exampleSketch = startSketchOn('XZ')
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -301,12 +126,8 @@ const exampleSketch = startSketchOn('XZ')
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -318,12 +139,8 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -331,12 +148,8 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -344,12 +157,8 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -359,12 +168,8 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -376,26 +181,15 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -638,12 +261,8 @@ const exampleSketch = startSketchOn('XZ')
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -651,12 +270,8 @@ const exampleSketch = startSketchOn('XZ')
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -668,12 +283,8 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -681,12 +292,8 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -694,12 +301,8 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -709,12 +312,8 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -726,12 +325,8 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw a bezier curve.
```js
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -283,12 +112,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -296,12 +121,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -313,12 +134,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -326,12 +143,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -339,12 +152,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -354,12 +163,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -371,26 +176,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -633,12 +256,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -646,12 +265,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -663,12 +278,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -676,12 +287,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -689,12 +296,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -704,12 +307,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -721,12 +320,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Create chamfers on tagged paths.
```js
chamfer(data: ChamferData, extrude_group: ExtrudeGroup, tag?: TagDeclarator) -> ExtrudeGroup
chamfer(data: ChamferData, extrude_group: ExtrudeGroup) -> ExtrudeGroup
```
### Examples
@ -50,9 +50,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
length: number,
// The tags of the paths you want to chamfer.
tags: [uuid |
{
value: string,
}],
string],
}
```
* `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
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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -217,12 +129,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -230,12 +138,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -247,12 +151,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -260,12 +160,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -273,12 +169,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -288,12 +180,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -305,12 +193,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -324,14 +208,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -339,26 +219,14 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
@ -367,28 +235,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -524,12 +306,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -537,12 +315,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -554,12 +328,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -567,12 +337,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -580,12 +346,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -595,12 +357,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -612,12 +370,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -631,14 +385,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -646,14 +396,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}

View File

@ -9,7 +9,7 @@ Sketch a circle.
```js
circle(center: [number], radius: number, tag?: TagDeclarator, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup
circle(center: [number], radius: number, tag?: String, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup
```
### Examples
@ -41,14 +41,7 @@ const example = extrude(5, exampleSketch)
* `center`: `[number]` (REQUIRED)
* `radius`: `number` (REQUIRED)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
* `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED)
```js
{
@ -83,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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -316,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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -410,12 +168,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -423,12 +177,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -440,12 +190,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -453,12 +199,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -466,12 +208,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -481,12 +219,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -498,12 +232,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -752,12 +311,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -765,12 +320,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -782,12 +333,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -795,12 +342,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -808,12 +351,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -823,12 +362,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -840,12 +375,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Close the current sketch.
```js
close(sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
close(sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -278,12 +107,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -291,12 +116,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -308,12 +129,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -321,12 +138,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -334,12 +147,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -349,12 +158,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -366,26 +171,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -628,12 +251,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -641,12 +260,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -658,12 +273,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -671,12 +282,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -684,12 +291,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -699,12 +302,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -716,12 +315,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -303,12 +132,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -317,12 +142,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -334,12 +155,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -347,12 +164,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -360,12 +173,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -375,12 +184,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -392,12 +197,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -415,28 +216,6 @@ const example = extrude(10, exampleSketch)
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -572,12 +287,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -585,12 +296,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -602,12 +309,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -615,12 +318,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -628,12 +327,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -643,12 +338,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -660,12 +351,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -680,14 +367,10 @@ const example = extrude(10, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -695,14 +378,10 @@ const example = extrude(10, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
} |

View File

@ -50,9 +50,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
radius: number,
// The tags of the paths you want to fillet.
tags: [uuid |
{
value: string,
}],
string],
}
```
* `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
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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -217,12 +129,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -230,12 +138,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -247,12 +151,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -260,12 +160,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -273,12 +169,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -288,12 +180,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -305,12 +193,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -324,14 +208,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -339,14 +219,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}
@ -359,28 +235,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -516,12 +306,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -529,12 +315,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -546,12 +328,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -559,12 +337,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -572,12 +346,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -587,12 +357,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -604,12 +370,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -623,14 +385,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -638,14 +396,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}

View File

@ -9,7 +9,7 @@ Get an edge on a 3D solid.
```js
getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
```
### Examples
@ -39,39 +39,12 @@ const revolution = startSketchOn(box, "revolveAxis")
### Arguments
* `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `tag`: `String` (REQUIRED)
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -207,12 +116,8 @@ const revolution = startSketchOn(box, "revolveAxis")
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -220,12 +125,8 @@ const revolution = startSketchOn(box, "revolveAxis")
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -237,12 +138,8 @@ const revolution = startSketchOn(box, "revolveAxis")
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -250,12 +147,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -263,12 +156,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -278,12 +167,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -295,12 +180,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -314,14 +195,10 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -329,14 +206,10 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}

View File

@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
```js
getNextAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
```
### Examples
@ -37,39 +37,12 @@ const example = extrude(5, exampleSketch)
### Arguments
* `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `tag`: `String` (REQUIRED)
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -205,12 +114,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -218,12 +123,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -235,12 +136,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -248,12 +145,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -261,12 +154,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -276,12 +165,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -293,12 +178,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -312,14 +193,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -327,14 +204,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}

View File

@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
```js
getOppositeEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
```
### Examples
@ -35,39 +35,12 @@ const example = extrude(5, exampleSketch)
### Arguments
* `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `tag`: `String` (REQUIRED)
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -203,12 +112,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -216,12 +121,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -233,12 +134,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -246,12 +143,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -259,12 +152,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -274,12 +163,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -291,12 +176,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -310,14 +191,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -325,14 +202,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}

View File

@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
```js
getPreviousAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
```
### Examples
@ -37,39 +37,12 @@ const example = extrude(5, exampleSketch)
### Arguments
* `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `tag`: `String` (REQUIRED)
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -205,12 +114,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -218,12 +123,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -235,12 +136,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -248,12 +145,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -261,12 +154,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -276,12 +165,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -293,12 +178,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -312,14 +193,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -327,14 +204,10 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}

View File

@ -48,28 +48,6 @@ const part001 = startSketchOn('XY')
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -205,12 +119,8 @@ const part001 = startSketchOn('XY')
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -218,12 +128,8 @@ const part001 = startSketchOn('XY')
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -235,12 +141,8 @@ const part001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -248,12 +150,8 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -261,12 +159,8 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -276,12 +170,8 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -293,12 +183,8 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -312,14 +198,10 @@ const part001 = startSketchOn('XY')
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -327,14 +209,10 @@ const part001 = startSketchOn('XY')
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}
@ -347,28 +225,6 @@ const part001 = startSketchOn('XY')
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -504,12 +296,8 @@ const part001 = startSketchOn('XY')
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -517,12 +305,8 @@ const part001 = startSketchOn('XY')
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -534,12 +318,8 @@ const part001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -547,12 +327,8 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -560,12 +336,8 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -575,12 +347,8 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -592,12 +360,8 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -611,14 +375,10 @@ const part001 = startSketchOn('XY')
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -626,14 +386,10 @@ const part001 = startSketchOn('XY')
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -289,12 +118,8 @@ const example = extrude(1, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -303,12 +128,8 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -320,12 +141,8 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -333,12 +150,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -346,12 +159,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -361,12 +170,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -378,12 +183,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -632,12 +262,8 @@ const example = extrude(1, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -645,12 +271,8 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -662,12 +284,8 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -675,12 +293,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -688,12 +302,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -703,12 +313,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -720,12 +326,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -974,12 +405,8 @@ const example = extrude(1, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -987,12 +414,8 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -1004,12 +427,8 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -1017,12 +436,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -1030,12 +445,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -1045,12 +456,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -1062,12 +469,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -269,12 +98,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -282,12 +107,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -299,12 +120,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -312,12 +129,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -325,12 +138,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -340,12 +149,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -357,12 +162,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -269,12 +98,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -282,12 +107,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -299,12 +120,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -312,12 +129,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -325,12 +138,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -340,12 +149,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -357,12 +162,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line.
```js
line(delta: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
line(delta: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -282,12 +111,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -295,12 +120,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -312,12 +133,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -325,12 +142,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -338,12 +151,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -353,12 +162,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -370,26 +175,15 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -632,12 +255,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -645,12 +264,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -662,12 +277,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -675,12 +286,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -688,12 +295,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -703,12 +306,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -720,12 +319,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line to a point.
```js
lineTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
lineTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -269,12 +98,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -282,12 +107,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -299,12 +120,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -312,12 +129,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -325,12 +138,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -340,12 +149,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -357,26 +162,15 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -619,12 +242,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -632,12 +251,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -649,12 +264,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -662,12 +273,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -675,12 +282,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -690,12 +293,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -707,12 +306,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -287,12 +116,8 @@ const example = extrude(1, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -301,12 +126,8 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -318,12 +139,8 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -331,12 +148,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -344,12 +157,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -359,12 +168,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -376,12 +181,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -52,28 +52,6 @@ const example = extrude(-5, exampleSketch)
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -209,12 +123,8 @@ const example = extrude(-5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -222,12 +132,8 @@ const example = extrude(-5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -239,12 +145,8 @@ const example = extrude(-5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -252,12 +154,8 @@ const example = extrude(-5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -265,12 +163,8 @@ const example = extrude(-5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -280,12 +174,8 @@ const example = extrude(-5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -297,12 +187,8 @@ const example = extrude(-5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -317,14 +203,10 @@ const example = extrude(-5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -332,14 +214,10 @@ const example = extrude(-5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -280,12 +109,8 @@ const example = extrude(1, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -294,12 +119,8 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -311,12 +132,8 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -324,12 +141,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -337,12 +150,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -352,12 +161,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -369,12 +174,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -50,28 +50,6 @@ const example = extrude(1, exampleSketch)
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -207,12 +121,8 @@ const example = extrude(1, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -220,12 +130,8 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -237,12 +143,8 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -250,12 +152,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -263,12 +161,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -278,12 +172,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -295,12 +185,8 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -315,14 +201,10 @@ const example = extrude(1, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -330,14 +212,10 @@ const example = extrude(1, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
} |

View File

@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -270,12 +99,8 @@ const sketch001 = startSketchOn('XY')
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -283,12 +108,8 @@ const sketch001 = startSketchOn('XY')
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -300,12 +121,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -313,12 +130,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -326,12 +139,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -341,12 +150,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -358,12 +163,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -265,12 +94,8 @@ const sketch001 = startSketchOn('XY')
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -278,12 +103,8 @@ const sketch001 = startSketchOn('XY')
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -295,12 +116,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -308,12 +125,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -321,12 +134,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -336,12 +145,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -353,12 +158,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -264,12 +93,8 @@ const sketch001 = startSketchOn('XY')
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -277,12 +102,8 @@ const sketch001 = startSketchOn('XY')
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -294,12 +115,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -307,12 +124,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -320,12 +133,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -335,12 +144,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -352,12 +157,8 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -156,9 +156,7 @@ const part001 = revolve({
},
} |
uuid |
{
value: string,
},
string,
}
```
* `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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -400,12 +227,8 @@ uuid |
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -413,12 +236,8 @@ uuid |
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -430,12 +249,8 @@ uuid |
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -443,12 +258,8 @@ uuid |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -456,12 +267,8 @@ uuid |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -471,12 +278,8 @@ uuid |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -488,12 +291,8 @@ uuid |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -508,28 +307,6 @@ uuid |
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -665,12 +378,8 @@ uuid |
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -678,12 +387,8 @@ uuid |
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -695,12 +400,8 @@ uuid |
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -708,12 +409,8 @@ uuid |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -721,12 +418,8 @@ uuid |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -736,12 +429,8 @@ uuid |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -753,12 +442,8 @@ uuid |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -772,14 +457,10 @@ uuid |
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -787,14 +468,10 @@ uuid |
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}

View File

@ -9,7 +9,7 @@ Returns the angle of the segment.
```js
segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
segAng(segment_name: string, sketch_group: SketchGroup) -> number
```
### Examples
@ -32,12 +32,7 @@ const example = extrude(4, exampleSketch)
### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `segment_name`: `string` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -277,12 +101,8 @@ const example = extrude(4, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -290,12 +110,8 @@ const example = extrude(4, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -307,12 +123,8 @@ const example = extrude(4, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -320,12 +132,8 @@ const example = extrude(4, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -333,12 +141,8 @@ const example = extrude(4, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -348,12 +152,8 @@ const example = extrude(4, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -365,12 +165,8 @@ const example = extrude(4, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Returns the segment end of x.
```js
segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
segEndX(segment_name: string, sketch_group: SketchGroup) -> number
```
### Examples
@ -30,12 +30,7 @@ const example = extrude(5, exampleSketch)
### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `segment_name`: `string` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -275,12 +99,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -288,12 +108,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -305,12 +121,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -318,12 +130,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -331,12 +139,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -346,12 +150,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -363,12 +163,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Returns the segment end of y.
```js
segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
segEndY(segment_name: string, sketch_group: SketchGroup) -> number
```
### Examples
@ -31,12 +31,7 @@ const example = extrude(5, exampleSketch)
### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `segment_name`: `string` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -276,12 +100,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -289,12 +109,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -306,12 +122,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -319,12 +131,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -332,12 +140,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -347,12 +151,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -364,12 +164,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Returns the length of the segment.
```js
segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
segLen(segment_name: string, sketch_group: SketchGroup) -> number
```
### Examples
@ -32,12 +32,7 @@ const example = extrude(5, exampleSketch)
### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `segment_name`: `string` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
@ -76,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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -277,12 +101,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -290,12 +110,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -307,12 +123,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -320,12 +132,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -333,12 +141,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -348,12 +152,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -365,12 +165,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -36,9 +36,7 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The faces you want removed.
faces: ["start" | "end" |
{
value: string,
}],
string],
// The thickness of the shell.
thickness: number,
}
@ -48,28 +46,6 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -205,12 +117,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -218,12 +126,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -235,12 +139,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -248,12 +148,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -261,12 +157,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -276,12 +168,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -293,12 +181,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -312,14 +196,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -327,14 +207,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}
@ -347,28 +223,6 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// 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.
@ -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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -504,12 +294,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -517,12 +303,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -534,12 +316,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -547,12 +325,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -560,12 +334,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -575,12 +345,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -592,12 +358,8 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -611,14 +373,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -626,14 +384,10 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}

View File

@ -9,7 +9,7 @@ Start a profile at a given point.
```js
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> SketchGroup
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -345,14 +117,7 @@ const example = extrude(5, exampleSketch)
},
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -595,12 +189,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -608,12 +198,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -625,12 +211,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -638,12 +220,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -651,12 +229,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -666,12 +240,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -683,12 +253,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -295,12 +124,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -308,12 +133,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -325,12 +146,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -338,12 +155,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -351,12 +164,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -366,12 +175,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -383,12 +188,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Start a sketch on a specific plane or face.
```js
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface
startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface
```
### Examples
@ -163,28 +163,6 @@ const a1 = startSketchOn({
{
// 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.
@ -226,10 +204,10 @@ const a1 = startSketchOn({
},
} |
{
// The extrude group the face is on.
extrudeGroup: ExtrudeGroup,
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -256,12 +234,8 @@ const a1 = startSketchOn({
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -269,12 +243,8 @@ const a1 = startSketchOn({
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -286,12 +256,8 @@ const a1 = startSketchOn({
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -299,12 +265,8 @@ const a1 = startSketchOn({
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -312,12 +274,8 @@ const a1 = startSketchOn({
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -327,12 +285,8 @@ const a1 = startSketchOn({
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -344,12 +298,8 @@ const a1 = startSketchOn({
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
@ -363,14 +313,10 @@ const a1 = startSketchOn({
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -378,24 +324,18 @@ const a1 = startSketchOn({
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
}
```
* `tag`: `FaceTag` - A tag for a face. (OPTIONAL)
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
```js
"start" | "end" |
{
value: string,
}
string
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ Draw an arc.
```js
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -278,12 +107,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -291,12 +116,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -308,12 +129,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -321,12 +138,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -334,12 +147,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -349,12 +158,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -366,26 +171,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -628,12 +251,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -641,12 +260,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -658,12 +273,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -671,12 +282,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -684,12 +291,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -699,12 +302,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -716,12 +315,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw an arc.
```js
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -269,12 +98,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -282,12 +107,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -299,12 +120,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -312,12 +129,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -325,12 +138,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -340,12 +149,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -357,26 +162,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -619,12 +242,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -632,12 +251,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -649,12 +264,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -662,12 +273,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -675,12 +282,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -690,12 +293,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -707,12 +306,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line on the x-axis.
```js
xLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
xLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -272,12 +101,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -285,12 +110,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -302,12 +123,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -315,12 +132,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -328,12 +141,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -343,12 +152,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -360,26 +165,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -622,12 +245,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -635,12 +254,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -652,12 +267,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -665,12 +276,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -678,12 +285,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -693,12 +296,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -710,12 +309,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line to a point on the x-axis.
```js
xLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
xLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -272,12 +101,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -285,12 +110,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -302,12 +123,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -315,12 +132,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -328,12 +141,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -343,12 +152,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -360,26 +165,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -622,12 +245,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -635,12 +254,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -652,12 +267,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -665,12 +276,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -678,12 +285,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -693,12 +296,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -710,12 +309,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line on the y-axis.
```js
yLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
yLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -270,12 +99,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -283,12 +108,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -300,12 +121,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -313,12 +130,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -326,12 +139,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -341,12 +150,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -358,26 +163,15 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -620,12 +243,8 @@ const example = extrude(10, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -633,12 +252,8 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -650,12 +265,8 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -663,12 +274,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -676,12 +283,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -691,12 +294,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -708,12 +307,8 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line to a point on the y-axis.
```js
yLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
yLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -268,12 +97,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -281,12 +106,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -298,12 +119,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -311,12 +128,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -324,12 +137,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -339,12 +148,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -356,26 +161,15 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",
}],
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `tag`: `String` (OPTIONAL)
### 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -618,12 +241,8 @@ const example = extrude(5, exampleSketch)
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
},
@ -631,12 +250,8 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "ToPoint",
@ -648,12 +263,8 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -661,12 +272,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "TangentialArc",
@ -674,12 +281,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Horizontal",
@ -689,12 +292,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -706,12 +305,8 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The name of the path.
name: string,
// The to point.
to: [number, number],
type: "Base",

View File

@ -184,7 +184,7 @@ async function doBasicSketch(page: Page, openPanes: string[]) {
await expect(page.locator('.cm-cursor')).toHaveCount(2)
}
await page.getByRole('button', { name: 'Constraints' }).click()
await page.getByRole('button', { name: 'Constrain' }).click()
await page.getByRole('button', { name: 'Equal Length' }).click()
// Open the code pane.
@ -566,56 +566,6 @@ test('if you click the format button it formats your code', async ({
|> close(%)`)
})
test('hover over functions shows function description', async ({ page }) => {
const u = await getUtils(page)
await page.addInitScript(async () => {
localStorage.setItem(
'persistCode',
`const sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %)
|> line([20, 0], %)
|> line([0, 20], %)
|> line([-20, 0], %)
|> close(%)`
)
})
await page.setViewportSize({ width: 1000, height: 500 })
const lspStartPromise = page.waitForEvent('console', async (message) => {
// it would be better to wait for a message that the kcl lsp has started by looking for the message message.text().includes('[lsp] [window/logMessage]')
// but that doesn't seem to make it to the console for macos/safari :(
if (message.text().includes('start kcl lsp')) {
await new Promise((resolve) => setTimeout(resolve, 200))
return true
}
return false
})
await page.goto('/')
await u.waitForAuthSkipAppStart()
await lspStartPromise
// check no error to begin with
await expect(page.locator('.cm-lint-marker-error')).not.toBeVisible()
await u.openDebugPanel()
await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel()
// focus the editor
await u.codeLocator.click()
// Hover over the startSketchOn function
await page.getByText('startSketchOn').hover()
await expect(page.locator('.hover-tooltip')).toBeVisible()
await expect(
page.getByText('Start a sketch on a specific plane or face')
).toBeVisible()
// Hover over the line function
await page.getByText('line').first().hover()
await expect(page.locator('.hover-tooltip')).toBeVisible()
await expect(page.getByText('Draw a line')).toBeVisible()
})
test('if you use the format keyboard binding it formats your code', async ({
page,
}) => {
@ -630,7 +580,6 @@ test('if you use the format keyboard binding it formats your code', async ({
|> line([-20, 0], %)
|> close(%)`
)
localStorage.setItem('disableAxis', 'true')
})
await page.setViewportSize({ width: 1000, height: 500 })
const lspStartPromise = page.waitForEvent('console', async (message) => {
@ -786,7 +735,7 @@ test('if you write invalid kcl you get inlined errors', async ({ page }) => {
// error text on hover
await page.hover('.cm-lint-marker-error')
await expect(page.getByText('syntax: Unexpected token')).toBeVisible()
await expect(page.getByText("found unknown token '$'")).toBeVisible()
// select the line that's causing the error and delete it
await page.getByText('$ error').click()
@ -813,7 +762,7 @@ test('if you write invalid kcl you get inlined errors', async ({ page }) => {
await page.locator('.cm-lintRange.cm-lintRange-error').hover()
await expect(page.locator('.cm-diagnosticText')).toBeVisible()
await expect(page.getByText('Cannot redefine `topAng`')).toBeVisible()
await expect(page.getByText('Cannot redefine topAng')).toBeVisible()
const secondTopAng = await page.getByText('topAng').first()
await secondTopAng?.dblclick()
@ -1762,7 +1711,7 @@ test.describe('Testing selections', () => {
// click a segment hold shift and click an axis, see that a relevant constraint is enabled
await topHorzSegmentClick()
await page.keyboard.down('Shift')
const constrainButton = page.getByRole('button', { name: 'Constraints' })
const constrainButton = page.getByRole('button', { name: 'Constrain' })
const absYButton = page.getByRole('button', { name: 'ABS Y' })
await constrainButton.click()
await expect(absYButton).toBeDisabled()
@ -2115,29 +2064,19 @@ test.describe('Command bar tests', () => {
await page.setViewportSize({ width: 1200, height: 500 })
await page.goto('/', { waitUntil: 'domcontentloaded' })
await expect(
page.getByRole('button', { name: 'Start Sketch' })
).not.toBeDisabled()
let cmdSearchBar = page.getByPlaceholder('Search commands')
// First try opening the command bar and closing it
await page
.getByRole('button', { name: 'Commands', exact: false })
.or(page.getByRole('button', { name: '⌘K' }))
.click()
let cmdSearchBar = await page.getByPlaceholder('Search commands')
await expect(cmdSearchBar).toBeVisible()
await page.keyboard.press('Escape')
cmdSearchBar = await page.getByPlaceholder('Search commands')
await expect(cmdSearchBar).not.toBeVisible()
// Now try the same, but with the keyboard shortcut, check focus
if (process.platform !== 'linux') {
await page.keyboard.press('Meta+K')
} else {
await page.locator('html').press('Control+C')
}
cmdSearchBar = await page.getByPlaceholder('Search commands')
await page.keyboard.press('Meta+K')
await expect(cmdSearchBar).toBeVisible()
await expect(cmdSearchBar).toBeFocused()
@ -2176,21 +2115,13 @@ test.describe('Command bar tests', () => {
await page.setViewportSize({ width: 1200, height: 500 })
await page.goto('/', { waitUntil: 'domcontentloaded' })
await expect(
page.getByRole('button', { name: 'Start Sketch' })
).not.toBeDisabled()
let cmdSearchBar = page.getByPlaceholder('Search commands')
// Put the cursor in the code editor
await page.locator('.cm-content').click()
// Now try the same, but with the keyboard shortcut, check focus
if (process.platform !== 'linux') {
await page.keyboard.press('Meta+K')
} else {
await page.locator('.cm-content').press('Control+C')
}
let cmdSearchBar = page.getByPlaceholder('Search commands')
await page.keyboard.press('Meta+K')
await expect(cmdSearchBar).toBeVisible()
await expect(cmdSearchBar).toBeFocused()
@ -2253,11 +2184,7 @@ test.describe('Command bar tests', () => {
await page.getByRole('button', { name: 'Extrude' }).isEnabled()
let cmdSearchBar = page.getByPlaceholder('Search commands')
if (process.platform !== 'linux') {
await page.keyboard.press('Meta+K')
} else {
await page.locator('html').press('Control+C')
}
await page.keyboard.press('Meta+K')
await expect(cmdSearchBar).toBeVisible()
// Search for extrude command and choose it
@ -2912,7 +2839,7 @@ test('Can edit a sketch that has been extruded in the same pipe', async ({
const startPX = [665, 458]
const dragPX = 80
const dragPX = 30
await page.getByText('startProfileAt([4.61, -14.01], %)').click()
await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeVisible()
@ -2920,14 +2847,16 @@ test('Can edit a sketch that has been extruded in the same pipe', async ({
await page.waitForTimeout(400)
let prevContent = await page.locator('.cm-content').innerText()
const step5 = { steps: 5 }
await expect(page.getByTestId('segment-overlay')).toHaveCount(2)
// drag startProfieAt handle
await page.dragAndDrop('#stream', '#stream', {
sourcePosition: { x: startPX[0], y: startPX[1] },
targetPosition: { x: startPX[0] + dragPX, y: startPX[1] - dragPX },
})
await page.waitForTimeout(100)
await page.mouse.move(startPX[0], startPX[1])
await page.mouse.down()
await page.mouse.move(startPX[0] + dragPX, startPX[1] - dragPX, step5)
await page.mouse.up()
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
prevContent = await page.locator('.cm-content').innerText()
@ -2935,23 +2864,20 @@ test('Can edit a sketch that has been extruded in the same pipe', async ({
await page.waitForTimeout(100)
const lineEnd = await u.getBoundingBox('[data-overlay-index="0"]')
await page.mouse.move(lineEnd.x - 5, lineEnd.y)
await page.mouse.down()
await page.mouse.move(lineEnd.x + dragPX, lineEnd.y - dragPX, step5)
await page.mouse.up()
await page.waitForTimeout(100)
await page.dragAndDrop('#stream', '#stream', {
sourcePosition: { x: lineEnd.x - 5, y: lineEnd.y },
targetPosition: { x: lineEnd.x + dragPX, y: lineEnd.y - dragPX },
})
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
prevContent = await page.locator('.cm-content').innerText()
// drag tangentialArcTo handle
const tangentEnd = await u.getBoundingBox('[data-overlay-index="1"]')
await page.dragAndDrop('#stream', '#stream', {
sourcePosition: { x: tangentEnd.x, y: tangentEnd.y - 5 },
targetPosition: {
x: tangentEnd.x + dragPX,
y: tangentEnd.y - dragPX,
},
})
await page.mouse.move(tangentEnd.x, tangentEnd.y - 5)
await page.mouse.down()
await page.mouse.move(tangentEnd.x + dragPX, tangentEnd.y - dragPX, step5)
await page.mouse.up()
await page.waitForTimeout(100)
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
@ -3337,7 +3263,7 @@ test('Can code mod a line length', async ({ page }) => {
await page.mouse.click(834, 244)
await page.keyboard.up('Shift')
await page.getByRole('button', { name: 'Constraints', exact: true }).click()
await page.getByRole('button', { name: 'Constrain', exact: true }).click()
await page.getByRole('button', { name: 'length', exact: true }).click()
await page.getByText('Add constraining value').click()
@ -3428,18 +3354,20 @@ const part002 = startSketchOn('XZ')
const line3 = await u.getSegmentBodyCoords(`[data-overlay-index="${2}"]`)
// await page.mouse.click(line1.x, line1.y)
// await page.keyboard.down('Shift')
await page.mouse.click(line3.x, line3.y)
await page.waitForTimeout(100) // this wait is needed for webkit - not sure why
// await page.keyboard.up('Shift')
await page
.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
.click()
await page
.getByRole('button', { name: 'remove constraints', exact: true })
.click()
await page.getByText('line([39.13, 68.63], %)').click()
const activeLinesContent = await page.locator('.cm-activeLine').all()
await expect(activeLinesContent).toHaveLength(1)
await expect(activeLinesContent[0]).toHaveText('|> line([39.13, 68.63], %)')
@ -3498,7 +3426,7 @@ const part002 = startSketchOn('XZ')
await page.keyboard.up('Shift')
await page
.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
.click()
await page
@ -3517,17 +3445,15 @@ const part002 = startSketchOn('XZ')
.getByRole('button', { name: 'Add constraining value' })
.click()
// Wait for the codemod to take effect
await expect(page.locator('.cm-content')).toContainText(`angle: -57,`)
await expect(page.locator('.cm-content')).toContainText(
`offset: ${offset},`
)
const activeLinesContent = await page.locator('.cm-activeLine').all()
await expect(activeLinesContent[0]).toHaveText(
`|> line([74.36, 130.4], %, 'seg01')`
)
await expect(activeLinesContent[1]).toHaveText(`}, %)`)
await expect(page.locator('.cm-content')).toContainText(`angle: -57,`)
await expect(page.locator('.cm-content')).toContainText(
`offset: ${offset},`
)
// checking the count of the overlays is a good proxy check that the client sketch scene is in a good state
await expect(page.getByTestId('segment-overlay')).toHaveCount(4)
@ -3597,7 +3523,7 @@ const part002 = startSketchOn('XZ')
await page.keyboard.up('Shift')
await page
.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
.click()
await page
@ -3708,7 +3634,7 @@ const part002 = startSketchOn('XZ')
await page.keyboard.up('Shift')
await page
.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
.click()
await page
@ -3816,7 +3742,7 @@ const part002 = startSketchOn('XZ')
await page.keyboard.up('Shift')
await page
.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
.click()
await page.getByTestId('angle').click()
@ -3917,7 +3843,7 @@ const part002 = startSketchOn('XZ')
await page.mouse.click(line3.x, line3.y)
await page
.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
.click()
await page.getByTestId(constraint).click()
@ -4002,13 +3928,8 @@ const part002 = startSketchOn('XZ')
await page.mouse.click(line3.x, line3.y)
await page.mouse.click(line4.x, line4.y)
await page.keyboard.up('Shift')
// check actives lines
const activeLinesContent = await page.locator('.cm-activeLine').all()
await expect(activeLinesContent).toHaveLength(codeAfter.length)
const constraintMenuButton = page.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
const constraintButton = page
.getByRole('button', {
@ -4018,8 +3939,11 @@ const part002 = startSketchOn('XZ')
// apply the constraint
await constraintMenuButton.click()
await constraintButton.click({ delay: 200 })
await constraintButton.click()
// check actives lines
const activeLinesContent = await page.locator('.cm-activeLine').all()
await expect(activeLinesContent).toHaveLength(codeAfter.length)
// check there are still 3 cursors (they should stay on the same lines as before constraint was applied)
await expect(page.locator('.cm-cursor')).toHaveCount(codeAfter.length)
@ -4091,7 +4015,7 @@ const part002 = startSketchOn('XZ')
await page.mouse.click(line3.x - 3, line3.y + 20)
await page.keyboard.up('Shift')
const constraintMenuButton = page.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
const constraintButton = page.getByRole('button', {
name: constraintName,
@ -4168,7 +4092,7 @@ const part002 = startSketchOn('XZ')
await page.mouse.click(axisClick.x, axisClick.y)
await page.keyboard.up('Shift')
const constraintMenuButton = page.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
const constraintButton = page.getByRole('button', {
name: constraintName,
@ -4223,7 +4147,7 @@ const part002 = startSketchOn('XZ')
await page
.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
.click()
await page.getByRole('button', { name: 'horizontal', exact: true }).click()
@ -4246,7 +4170,7 @@ const part002 = startSketchOn('XZ')
await page
.getByRole('button', {
name: 'Constraints',
name: 'Constrain',
})
.click()
await page.getByRole('button', { name: 'length', exact: true }).click()
@ -4283,7 +4207,6 @@ test.describe('Testing segment overlays', () => {
expectFinal,
ang = 45,
steps = 10,
locator,
}: {
hoverPos: { x: number; y: number }
constraintType:
@ -4296,7 +4219,6 @@ test.describe('Testing segment overlays', () => {
expectFinal: string
ang?: number
steps?: number
locator?: string
}) => {
await expect(page.getByText('Added variable')).not.toBeVisible()
@ -4307,7 +4229,7 @@ test.describe('Testing segment overlays', () => {
x = hoverPos.x + Math.cos(ang * deg) * 32
y = hoverPos.y - Math.sin(ang * deg) * 32
await page.mouse.move(x, y)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5, locator)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5)
await expect(page.locator('.cm-content')).toContainText(
expectBeforeUnconstrained
@ -4330,7 +4252,7 @@ test.describe('Testing segment overlays', () => {
x = hoverPos.x + Math.cos(ang * deg) * 32
y = hoverPos.y - Math.sin(ang * deg) * 32
await page.mouse.move(x, y)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5, locator)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5)
const unconstrainedLocator = page.locator(
`[data-constraint-type="${constraintType}"][data-is-constrained="false"]`
@ -4364,7 +4286,6 @@ test.describe('Testing segment overlays', () => {
expectFinal,
ang = 45,
steps = 5,
locator,
}: {
hoverPos: { x: number; y: number }
constraintType:
@ -4377,7 +4298,6 @@ test.describe('Testing segment overlays', () => {
expectFinal: string
ang?: number
steps?: number
locator?: string
}) => {
await page.mouse.move(0, 0)
await page.waitForTimeout(1000)
@ -4386,7 +4306,7 @@ test.describe('Testing segment overlays', () => {
x = hoverPos.x + Math.cos(ang * deg) * 32
y = hoverPos.y - Math.sin(ang * deg) * 32
await page.mouse.move(x, y)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5, locator)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5)
await expect(page.getByText('Added variable')).not.toBeVisible()
await expect(page.locator('.cm-content')).toContainText(
@ -4412,7 +4332,7 @@ test.describe('Testing segment overlays', () => {
x = hoverPos.x + Math.cos(ang * deg) * 32
y = hoverPos.y - Math.sin(ang * deg) * 32
await page.mouse.move(x, y)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5, locator)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5)
const constrainedLocator = page.locator(
`[data-constraint-type="${constraintType}"][data-is-constrained="true"]`
@ -4508,7 +4428,6 @@ test.describe('Testing segment overlays', () => {
expectAfterUnconstrained: '|> line([0.5, -14], %)',
expectFinal: '|> line([0.5, yRel001], %)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="0"]',
})
console.log('line2')
await clickUnconstrained({
@ -4518,7 +4437,6 @@ test.describe('Testing segment overlays', () => {
expectAfterUnconstrained: 'line([xRel001, yRel001], %)',
expectFinal: '|> line([0.5, yRel001], %)',
ang: ang + 180,
locator: '[data-overlay-index="0"]',
})
const angledLine = await u.getBoundingBox(`[data-overlay-index="1"]`)
@ -4532,7 +4450,6 @@ test.describe('Testing segment overlays', () => {
expectAfterUnconstrained: 'angledLine({ angle: 3, length: 32 + 0 }, %)',
expectFinal: 'angledLine({ angle: angle001, length: 32 + 0 }, %)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="1"]',
})
console.log('angledLine2')
await clickConstrained({
@ -4544,10 +4461,10 @@ test.describe('Testing segment overlays', () => {
'angledLine({ angle: angle001, length: 32 }, %)',
expectFinal: 'angledLine({ angle: angle001, length: len001 }, %)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="1"]',
})
await page.mouse.move(700, 250)
await page.mouse.wheel(0, 25)
await page.waitForTimeout(100)
let lineTo = await u.getBoundingBox(`[data-overlay-index="2"]`)
@ -4561,7 +4478,6 @@ test.describe('Testing segment overlays', () => {
expectFinal: 'lineTo([5 + 33, yAbs001], %)',
steps: 8,
ang: ang + 180,
locator: '[data-overlay-toolbar-index="2"]',
})
console.log('lineTo2')
await clickConstrained({
@ -4572,7 +4488,6 @@ test.describe('Testing segment overlays', () => {
expectFinal: 'lineTo([xAbs001, yAbs001], %)',
steps: 8,
ang: ang + 180,
locator: '[data-overlay-toolbar-index="2"]',
})
const xLineTo = await u.getBoundingBox(`[data-overlay-index="3"]`)
@ -4586,7 +4501,6 @@ test.describe('Testing segment overlays', () => {
expectFinal: 'xLineTo(xAbs002, %)',
ang: ang + 180,
steps: 8,
locator: '[data-overlay-toolbar-index="3"]',
})
})
test('for segments [yLineTo, xLine]', async ({ page }) => {
@ -4633,6 +4547,7 @@ const part001 = startSketchOn('XZ')
const clickUnconstrained = _clickUnconstrained(page)
await page.mouse.move(700, 250)
await page.mouse.wheel(0, 25)
await page.waitForTimeout(100)
let ang = 0
@ -4647,7 +4562,6 @@ const part001 = startSketchOn('XZ')
expectAfterUnconstrained: "yLineTo(yAbs002, %, 'a')",
expectFinal: "yLineTo(-10.77, %, 'a')",
ang: ang + 180,
locator: '[data-overlay-toolbar-index="4"]',
})
const xLine = await u.getBoundingBox(`[data-overlay-index="5"]`)
@ -4661,7 +4575,6 @@ const part001 = startSketchOn('XZ')
expectFinal: 'xLine(26.04, %)',
steps: 10,
ang: ang + 180,
locator: '[data-overlay-toolbar-index="5"]',
})
})
test('for segments [yLine, angledLineOfXLength, angledLineOfYLength]', async ({
@ -4691,7 +4604,6 @@ const part001 = startSketchOn('XZ')
|> tangentialArcTo([3.14 + 13, 3.14], %)
`
)
localStorage.setItem('disableAxis', 'true')
})
const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 })
@ -4720,13 +4632,12 @@ const part001 = startSketchOn('XZ')
ang = await u.getAngle(`[data-overlay-index="6"]`)
console.log('yline1')
await clickConstrained({
hoverPos: { x: yLine.x, y: yLine.y },
hoverPos: { x: yLine.x, y: yLine.y + 20 },
constraintType: 'yRelative',
expectBeforeUnconstrained: 'yLine(21.14 + 0, %)',
expectAfterUnconstrained: 'yLine(21.14, %)',
expectFinal: 'yLine(yRel001, %)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="6"]',
})
const angledLineOfXLength = await u.getBoundingBox(
@ -4735,7 +4646,7 @@ const part001 = startSketchOn('XZ')
ang = await u.getAngle(`[data-overlay-index="7"]`)
console.log('angledLineOfXLength1')
await clickConstrained({
hoverPos: { x: angledLineOfXLength.x, y: angledLineOfXLength.y },
hoverPos: { x: angledLineOfXLength.x + 20, y: angledLineOfXLength.y },
constraintType: 'angle',
expectBeforeUnconstrained:
'angledLineOfXLength({ angle: 181 + 0, length: 23.14 }, %)',
@ -4744,11 +4655,10 @@ const part001 = startSketchOn('XZ')
expectFinal:
'angledLineOfXLength({ angle: angle001, length: 23.14 }, %)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="7"]',
})
console.log('angledLineOfXLength2')
await clickUnconstrained({
hoverPos: { x: angledLineOfXLength.x, y: angledLineOfXLength.y },
hoverPos: { x: angledLineOfXLength.x + 25, y: angledLineOfXLength.y },
constraintType: 'xRelative',
expectBeforeUnconstrained:
'angledLineOfXLength({ angle: angle001, length: 23.14 }, %)',
@ -4758,7 +4668,6 @@ const part001 = startSketchOn('XZ')
'angledLineOfXLength({ angle: angle001, length: 23.14 }, %)',
steps: 7,
ang: ang + 180,
locator: '[data-overlay-toolbar-index="7"]',
})
const angledLineOfYLength = await u.getBoundingBox(
@ -4767,7 +4676,7 @@ const part001 = startSketchOn('XZ')
ang = await u.getAngle(`[data-overlay-index="8"]`)
console.log('angledLineOfYLength1')
await clickUnconstrained({
hoverPos: { x: angledLineOfYLength.x, y: angledLineOfYLength.y },
hoverPos: { x: angledLineOfYLength.x, y: angledLineOfYLength.y - 20 },
constraintType: 'angle',
expectBeforeUnconstrained:
'angledLineOfYLength({ angle: -91, length: 19 + 0 }, %)',
@ -4776,11 +4685,10 @@ const part001 = startSketchOn('XZ')
expectFinal: 'angledLineOfYLength({ angle: -91, length: 19 + 0 }, %)',
ang: ang + 180,
steps: 6,
locator: '[data-overlay-toolbar-index="8"]',
})
console.log('angledLineOfYLength2')
await clickConstrained({
hoverPos: { x: angledLineOfYLength.x, y: angledLineOfYLength.y },
hoverPos: { x: angledLineOfYLength.x, y: angledLineOfYLength.y - 20 },
constraintType: 'yRelative',
expectBeforeUnconstrained:
'angledLineOfYLength({ angle: -91, length: 19 + 0 }, %)',
@ -4789,7 +4697,6 @@ const part001 = startSketchOn('XZ')
expectFinal: 'angledLineOfYLength({ angle: -91, length: yRel002 }, %)',
ang: ang + 180,
steps: 7,
locator: '[data-overlay-toolbar-index="8"]',
})
})
test('for segments [angledLineToX, angledLineToY, angledLineThatIntersects]', async ({
@ -4819,7 +4726,6 @@ const part001 = startSketchOn('XZ')
|> tangentialArcTo([3.14 + 13, 1.14], %)
`
)
localStorage.setItem('disableAxis', 'true')
})
const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 })
@ -4853,11 +4759,10 @@ const part001 = startSketchOn('XZ')
expectAfterUnconstrained: 'angledLineToX({ angle: 3, to: 26 }, %)',
expectFinal: 'angledLineToX({ angle: angle001, to: 26 }, %)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="9"]',
})
console.log('angledLineToX2')
await clickUnconstrained({
hoverPos: { x: angledLineToX.x, y: angledLineToX.y },
hoverPos: { x: angledLineToX.x - 20, y: angledLineToX.y },
constraintType: 'xAbsolute',
expectBeforeUnconstrained:
'angledLineToX({ angle: angle001, to: 26 }, %)',
@ -4865,7 +4770,6 @@ const part001 = startSketchOn('XZ')
'angledLineToX({ angle: angle001, to: xAbs001 }, %)',
expectFinal: 'angledLineToX({ angle: angle001, to: 26 }, %)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="9"]',
})
const angledLineToY = await u.getBoundingBox(`[data-overlay-index="10"]`)
@ -4881,18 +4785,16 @@ const part001 = startSketchOn('XZ')
expectFinal: 'angledLineToY({ angle: 89, to: 9.14 + 0 }, %)',
steps: process.platform === 'darwin' ? 8 : 9,
ang: ang + 180,
locator: '[data-overlay-toolbar-index="10"]',
})
console.log('angledLineToY2')
await clickConstrained({
hoverPos: { x: angledLineToY.x, y: angledLineToY.y },
hoverPos: { x: angledLineToY.x, y: angledLineToY.y + 20 },
constraintType: 'yAbsolute',
expectBeforeUnconstrained:
'angledLineToY({ angle: 89, to: 9.14 + 0 }, %)',
expectAfterUnconstrained: 'angledLineToY({ angle: 89, to: 9.14 }, %)',
expectFinal: 'angledLineToY({ angle: 89, to: yAbs001 }, %)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="10"]',
})
const angledLineThatIntersects = await u.getBoundingBox(
@ -4902,7 +4804,7 @@ const part001 = startSketchOn('XZ')
console.log('angledLineThatIntersects')
await clickUnconstrained({
hoverPos: {
x: angledLineThatIntersects.x,
x: angledLineThatIntersects.x + 20,
y: angledLineThatIntersects.y,
},
constraintType: 'angle',
@ -4922,12 +4824,11 @@ const part001 = startSketchOn('XZ')
intersectTag: 'a'
}, %)`,
ang: ang + 180,
locator: '[data-overlay-toolbar-index="11"]',
})
console.log('angledLineThatIntersects2')
await clickUnconstrained({
hoverPos: {
x: angledLineThatIntersects.x,
x: angledLineThatIntersects.x + 20,
y: angledLineThatIntersects.y,
},
constraintType: 'intersectionOffset',
@ -4947,7 +4848,6 @@ const part001 = startSketchOn('XZ')
intersectTag: 'a'
}, %)`,
ang: ang + 180,
locator: '[data-overlay-toolbar-index="11"]',
})
})
test('for segment [tangentialArcTo]', async ({ page }) => {
@ -4975,7 +4875,6 @@ const part001 = startSketchOn('XZ')
|> tangentialArcTo([3.14 + 13, -3.14], %)
`
)
localStorage.setItem('disableAxis', 'true')
})
const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 })
@ -4998,9 +4897,9 @@ const part001 = startSketchOn('XZ')
const clickConstrained = _clickConstrained(page)
const tangentialArcTo = await u.getBoundingBox(
'[data-overlay-index="12"]'
`[data-overlay-index="12"]`
)
let ang = await u.getAngle('[data-overlay-index="12"]')
let ang = await u.getAngle(`[data-overlay-index="12"]`)
console.log('tangentialArcTo')
await clickConstrained({
hoverPos: { x: tangentialArcTo.x, y: tangentialArcTo.y },
@ -5010,7 +4909,6 @@ const part001 = startSketchOn('XZ')
expectFinal: 'tangentialArcTo([xAbs001, -3.14], %)',
ang: ang + 180,
steps: 6,
locator: '[data-overlay-toolbar-index="12"]',
})
console.log('tangentialArcTo2')
await clickUnconstrained({
@ -5021,7 +4919,6 @@ const part001 = startSketchOn('XZ')
expectFinal: 'tangentialArcTo([xAbs001, -3.14], %)',
ang: ang + 180,
steps: 10,
locator: '[data-overlay-toolbar-index="12"]',
})
})
})
@ -5034,26 +4931,21 @@ const part001 = startSketchOn('XZ')
stdLibFnName,
ang = 45,
steps = 6,
locator,
}: {
hoverPos: { x: number; y: number }
codeToBeDeleted: string
stdLibFnName: string
ang?: number
steps?: number
locator?: string
}) => {
await expect(page.getByText('Added variable')).not.toBeVisible()
const [x, y] = [
Math.cos((ang * Math.PI) / 180) * 45,
Math.sin((ang * Math.PI) / 180) * 45,
]
await page.mouse.move(0, 0)
await page.waitForTimeout(1000)
let x = 0,
y = 0
x = hoverPos.x + Math.cos(ang * deg) * 32
y = hoverPos.y - Math.sin(ang * deg) * 32
await page.mouse.move(x, y)
await wiggleMove(page, x, y, 20, 30, ang, 10, 5, locator)
await page.mouse.move(hoverPos.x + x, hoverPos.y + y)
await page.mouse.move(hoverPos.x, hoverPos.y, { steps })
await expect(page.locator('.cm-content')).toContainText(codeToBeDeleted)
await page.locator(`[data-stdlib-fn-name="${stdLibFnName}"]`).click()
@ -5088,7 +4980,6 @@ const part001 = startSketchOn('XZ')
|> tangentialArcTo([3.14 + 13, 1.14], %)
`
)
localStorage.setItem('disableAxis', 'true')
})
const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 })
@ -5113,137 +5004,96 @@ const part001 = startSketchOn('XZ')
const getOverlayByIndex = (index: number) =>
u.getBoundingBox(`[data-overlay-index="${index}"]`)
segmentToDelete = await getOverlayByIndex(12)
let ang = await u.getAngle(`[data-overlay-index="${12}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x - 10, y: segmentToDelete.y + 20 },
codeToBeDeleted: 'tangentialArcTo([3.14 + 13, 1.14], %)',
stdLibFnName: 'tangentialArcTo',
ang: ang + 180,
ang: -45,
steps: 6,
locator: '[data-overlay-toolbar-index="12"]',
})
segmentToDelete = await getOverlayByIndex(11)
ang = await u.getAngle(`[data-overlay-index="${11}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x + 10, y: segmentToDelete.y },
codeToBeDeleted: `angledLineThatIntersects({
angle: 4.14,
intersectTag: 'a',
offset: 9
}, %)`,
stdLibFnName: 'angledLineThatIntersects',
ang: ang + 180,
ang: -45,
steps: 7,
locator: '[data-overlay-toolbar-index="11"]',
})
segmentToDelete = await getOverlayByIndex(10)
ang = await u.getAngle(`[data-overlay-index="${10}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x + 10, y: segmentToDelete.y },
codeToBeDeleted: 'angledLineToY({ angle: 89, to: 9.14 + 0 }, %)',
stdLibFnName: 'angledLineToY',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="10"]',
})
segmentToDelete = await getOverlayByIndex(9)
ang = await u.getAngle(`[data-overlay-index="${9}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x - 10, y: segmentToDelete.y },
codeToBeDeleted: 'angledLineToX({ angle: 3 + 0, to: 26 }, %)',
stdLibFnName: 'angledLineToX',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="9"]',
})
segmentToDelete = await getOverlayByIndex(8)
ang = await u.getAngle(`[data-overlay-index="${8}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y - 10 },
codeToBeDeleted:
'angledLineOfYLength({ angle: -91, length: 19 + 0 }, %)',
stdLibFnName: 'angledLineOfYLength',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="8"]',
})
segmentToDelete = await getOverlayByIndex(7)
ang = await u.getAngle(`[data-overlay-index="${7}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x + 10, y: segmentToDelete.y },
codeToBeDeleted:
'angledLineOfXLength({ angle: 181 + 0, length: 23.14 }, %)',
stdLibFnName: 'angledLineOfXLength',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="7"]',
})
segmentToDelete = await getOverlayByIndex(6)
ang = await u.getAngle(`[data-overlay-index="${6}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y + 10 },
codeToBeDeleted: 'yLine(21.14 + 0, %)',
stdLibFnName: 'yLine',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="6"]',
})
segmentToDelete = await getOverlayByIndex(5)
ang = await u.getAngle(`[data-overlay-index="${5}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x - 10, y: segmentToDelete.y },
codeToBeDeleted: 'xLine(26.04, %)',
stdLibFnName: 'xLine',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="5"]',
})
segmentToDelete = await getOverlayByIndex(4)
ang = await u.getAngle(`[data-overlay-index="${4}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y - 10 },
codeToBeDeleted: "yLineTo(-10.77, %, 'a')",
stdLibFnName: 'yLineTo',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="4"]',
})
segmentToDelete = await getOverlayByIndex(3)
ang = await u.getAngle(`[data-overlay-index="${3}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x + 10, y: segmentToDelete.y },
codeToBeDeleted: 'xLineTo(9 - 5, %)',
stdLibFnName: 'xLineTo',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="3"]',
})
// Not sure why this is diff. from the others - Kurt, ideas?
segmentToDelete = await getOverlayByIndex(2)
ang = await u.getAngle(`[data-overlay-index="${2}"]`)
const hoverPos = { x: segmentToDelete.x - 10, y: segmentToDelete.y + 10 }
await expect(page.getByText('Added variable')).not.toBeVisible()
const [x, y] = [
Math.cos((45 * Math.PI) / 180) * 45,
Math.sin((45 * Math.PI) / 180) * 45,
]
const hoverPos = { x: segmentToDelete.x, y: segmentToDelete.y }
await page.mouse.move(0, 0)
await page.waitForTimeout(1000)
let x = 0,
y = 0
x = hoverPos.x + Math.cos(ang * deg) * 32
y = hoverPos.y - Math.sin(ang * deg) * 32
await page.mouse.move(hoverPos.x, hoverPos.y)
await wiggleMove(
page,
hoverPos.x,
hoverPos.y,
20,
30,
ang,
10,
5,
'[data-overlay-toolbar-index="2"]'
)
await page.mouse.move(hoverPos.x + x, hoverPos.y + y)
await page.mouse.move(hoverPos.x, hoverPos.y, { steps: 5 })
const codeToBeDeleted = 'lineTo([33, 11.5 + 0], %)'
await expect(page.locator('.cm-content')).toContainText(codeToBeDeleted)
@ -5255,22 +5105,19 @@ const part001 = startSketchOn('XZ')
)
segmentToDelete = await getOverlayByIndex(1)
ang = await u.getAngle(`[data-overlay-index="${1}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x - 20, y: segmentToDelete.y },
codeToBeDeleted: 'angledLine({ angle: 3 + 0, length: 32 + 0 }, %)',
stdLibFnName: 'angledLine',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="1"]',
ang: 135,
})
segmentToDelete = await getOverlayByIndex(0)
ang = await u.getAngle(`[data-overlay-index="${0}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y - 20 },
codeToBeDeleted: 'line([0.5, -14 + 0], %)',
stdLibFnName: 'line',
ang: ang + 180,
ang: -45,
})
await page.waitForTimeout(200)
@ -5484,31 +5331,25 @@ ${extraLine ? "const myVar = segLen('seg01', part001)" : ''}`
await page.waitForTimeout(500)
await expect(page.getByTestId('segment-overlay')).toHaveCount(3)
await expect(page.getByText('Added variable')).not.toBeVisible()
const hoverPos = await u.getBoundingBox(`[data-overlay-index="0"]`)
let ang = await u.getAngle(`[data-overlay-index="${0}"]`)
ang += 180
await page.mouse.move(0, 0)
await page.waitForTimeout(1000)
let x = 0,
y = 0
x = hoverPos.x + Math.cos(ang * deg) * 32
y = hoverPos.y - Math.sin(ang * deg) * 32
await page.mouse.move(x, y)
await wiggleMove(
page,
x,
y,
20,
30,
ang,
10,
5,
'[data-overlay-toolbar-index="0"]'
const segmentToDelete = await u.getBoundingBox(
`[data-overlay-index="0"]`
)
const isYLine = before.toLowerCase().includes('yline')
const hoverPos = {
x: segmentToDelete.x + (isYLine ? 0 : -20),
y: segmentToDelete.y + (isYLine ? -20 : 0),
}
await expect(page.getByText('Added variable')).not.toBeVisible()
const ang = isYLine ? 45 : -45
const [x, y] = [
Math.cos((ang * Math.PI) / 180) * 45,
Math.sin((ang * Math.PI) / 180) * 45,
]
await page.mouse.move(hoverPos.x + x, hoverPos.y + y)
await page.mouse.move(hoverPos.x, hoverPos.y, { steps: 5 })
await expect(page.locator('.cm-content')).toContainText(before)
await page.getByTestId('overlay-menu').click()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -114,45 +114,19 @@ export const wiggleMove = async (
dist: number,
ang: number,
amplitude: number,
freq: number,
locator?: string
freq: number
) => {
const tau = Math.PI * 2
const deg = tau / 360
const step = dist / steps
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 [x2, y2] = [
Math.cos(-ang * deg) * i - Math.sin(-ang * deg) * y1,
Math.sin(-ang * deg) * i + Math.cos(-ang * deg) * y1,
]
const [xr, yr] = [x2, y2]
await page.mouse.move(x + xr, y + yr, { steps: 5 })
}
}
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 })
await page.mouse.move(x + xr, y + yr, { steps: 2 })
}
}
@ -177,11 +151,11 @@ export const getMovementUtils = (opts: any) => {
// Make it easier to click around from center ("click [from] zero zero")
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
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
if (x === undefined || y === undefined) {
last.x = 0
@ -189,19 +163,12 @@ export const getMovementUtils = (opts: any) => {
return
}
await circleMove(
opts.page,
opts.center.x + last.x + x,
opts.center.y + last.y + y,
10,
10
)
await click00(last.x + x, last.y + y)
const ret = click00(last.x + x, last.y + y)
last.x += x
last.y += y
// Returns the new absolute coordinate if you need it.
return [last.x, last.y]
return ret.then(() => [last.x, last.y])
}
return { toSU, click00r }

View File

@ -1,6 +1,6 @@
{
"name": "untitled-app",
"version": "0.22.6",
"version": "0.22.5",
"private": true,
"dependencies": {
"@codemirror/autocomplete": "^6.16.0",
@ -37,7 +37,6 @@
"crypto-js": "^4.2.0",
"debounce-promise": "^3.1.2",
"decamelize": "^6.0.0",
"eslint-plugin-suggest-no-throw": "^1.0.0",
"formik": "^2.4.6",
"fuse.js": "^7.0.0",
"html2canvas-pro": "^1.4.3",
@ -121,7 +120,7 @@
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.24.3",
"@iarna/toml": "^2.2.5",
"@playwright/test": "^1.44.1",
"@playwright/test": "^1.43.1",
"@tauri-apps/cli": "^2.0.0-beta.13",
"@types/crypto-js": "^4.2.2",
"@types/debounce-promise": "^3.1.9",

View File

@ -18,7 +18,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 3 : 0,
/* Different amount of parallelism on CI and local. */
workers: process.env.CI ? 1 : 4,
workers: process.env.CI ? 1 : 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

110
src-tauri/Cargo.lock generated
View File

@ -344,7 +344,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -379,7 +379,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -425,7 +425,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -574,7 +574,7 @@ dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
"syn_derive",
]
@ -883,7 +883,7 @@ dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1085,7 +1085,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
dependencies = [
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1095,7 +1095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f"
dependencies = [
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1119,7 +1119,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim 0.10.0",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1130,7 +1130,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [
"darling_core",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1177,7 +1177,7 @@ checksum = "4078275de501a61ceb9e759d37bdd3d7210e654dbc167ac1a3678ef4435ed57b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
"synstructure",
]
@ -1214,7 +1214,7 @@ dependencies = [
"regex",
"serde",
"serde_tokenstream",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1225,7 +1225,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1287,7 +1287,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1319,7 +1319,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1417,7 +1417,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1568,7 +1568,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1684,7 +1684,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1960,7 +1960,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -1988,7 +1988,7 @@ dependencies = [
"inflections",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -2063,7 +2063,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -2568,7 +2568,7 @@ dependencies = [
[[package]]
name = "kcl-lib"
version = "0.1.65"
version = "0.1.62"
dependencies = [
"anyhow",
"approx",
@ -2625,9 +2625,9 @@ dependencies = [
[[package]]
name = "kittycad"
version = "0.3.6"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af3de9bb4b1441f198689a9f64a8163a518377e30b348a784680e738985b95eb"
checksum = "df75feef10313fa1cb15b7cecd0f579877312ba3d42bb5b8b4c1d4b1d0fcabf0"
dependencies = [
"anyhow",
"async-trait",
@ -2677,9 +2677,9 @@ dependencies = [
[[package]]
name = "lazy_static"
version = "1.5.0"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libappindicator"
@ -3358,7 +3358,7 @@ dependencies = [
"regex",
"regex-syntax 0.8.3",
"structmeta",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -3500,7 +3500,7 @@ dependencies = [
"phf_shared 0.11.2",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -3568,7 +3568,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4413,7 +4413,7 @@ dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4522,7 +4522,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4533,7 +4533,7 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4566,7 +4566,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4587,7 +4587,7 @@ dependencies = [
"proc-macro2",
"quote",
"serde",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4629,7 +4629,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4897,7 +4897,7 @@ dependencies = [
"proc-macro2",
"quote",
"structmeta-derive",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4908,7 +4908,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4930,7 +4930,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4963,9 +4963,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.68"
version = "2.0.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90"
dependencies = [
"proc-macro2",
"quote",
@ -4981,7 +4981,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -4998,7 +4998,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -5215,7 +5215,7 @@ dependencies = [
"serde",
"serde_json",
"sha2",
"syn 2.0.68",
"syn 2.0.67",
"tauri-utils",
"thiserror",
"time",
@ -5233,7 +5233,7 @@ dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
"tauri-codegen",
"tauri-utils",
]
@ -5599,7 +5599,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -5688,7 +5688,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -5888,7 +5888,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -5917,7 +5917,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -6041,7 +6041,7 @@ checksum = "cbdee324e50a7402416d9c25270d3df4241ed528af5d36dda18b6f219551c577"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
"termcolor",
]
@ -6253,7 +6253,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -6352,7 +6352,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
"wasm-bindgen-shared",
]
@ -6386,7 +6386,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -6527,7 +6527,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -6633,7 +6633,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -6644,7 +6644,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]
@ -7086,7 +7086,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.68",
"syn 2.0.67",
]
[[package]]

View File

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

View File

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

View File

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

View File

@ -101,7 +101,6 @@ import {
updateRectangleSketch,
} from 'lib/rectangleTool'
import { getThemeColorForThreeJs } from 'lib/theme'
import { err, trap } from 'lib/trap'
type DraftSegment = 'line' | 'tangentialArcTo'
@ -319,14 +318,8 @@ export class SceneEntities {
}> {
this.createIntersectionPlane()
const prepared = this.prepareTruncatedMemoryAndAst(
sketchPathToNode || [],
maybeModdedAst
)
if (err(prepared)) return Promise.reject(prepared)
const { truncatedAst, programMemoryOverride, variableDeclarationName } =
prepared
this.prepareTruncatedMemoryAndAst(sketchPathToNode || [], maybeModdedAst)
const { programMemory } = await executeAst({
ast: truncatedAst,
useFakeExecutor: true,
@ -338,8 +331,6 @@ export class SceneEntities {
ast: maybeModdedAst,
programMemory,
})
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (!Array.isArray(sketchGroup?.value))
return {
truncatedAst,
@ -415,14 +406,11 @@ export class SceneEntities {
)
let seg
const _node1 = getNodeFromPath<CallExpression>(
const callExpName = getNodeFromPath<CallExpression>(
maybeModdedAst,
segPathToNode,
'CallExpression'
)
if (err(_node1)) return
const callExpName = _node1.node?.callee?.name
)?.node?.callee?.name
if (segment.type === 'TangentialArcTo') {
seg = tangentialArcToSegment({
prevSegment: sketchGroup.value[index - 1],
@ -501,14 +489,12 @@ export class SceneEntities {
}
updateAstAndRejigSketch = async (
sketchPathToNode: PathToNode,
modifiedAst: Program | Error,
modifiedAst: Program,
forward: [number, number, number],
up: [number, number, number],
origin: [number, number, number]
) => {
if (err(modifiedAst)) return modifiedAst
const nextAst = await kclManager.updateAst(modifiedAst, false)
await kclManager.updateAst(modifiedAst, false)
await this.tearDownSketch({ removeAxis: false })
sceneInfra.resetMouseListeners()
await this.setupSketch({
@ -516,7 +502,7 @@ export class SceneEntities {
forward,
up,
position: origin,
maybeModdedAst: nextAst.newAst,
maybeModdedAst: kclManager.ast,
})
this.setupSketchIdleCallbacks({
forward,
@ -524,7 +510,6 @@ export class SceneEntities {
position: origin,
pathToNode: sketchPathToNode,
})
return nextAst
}
setUpDraftSegment = async (
sketchPathToNode: PathToNode,
@ -536,15 +521,12 @@ export class SceneEntities {
) => {
const _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName =
_node1.node?.declarations?.[0]?.id?.name || ''
getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
const sg = kclManager.programMemory.root[
variableDeclarationName
] as SketchGroup
@ -560,9 +542,7 @@ export class SceneEntities {
fnName: segmentName,
pathToNode: sketchPathToNode,
})
if (trap(mod)) return Promise.reject(mod)
const modifiedAst = parse(recast(mod.modifiedAst))
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
const draftExpressionsIndices = { start: index, end: index }
@ -613,16 +593,14 @@ export class SceneEntities {
),
],
})
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
modifiedAst = addCloseToPipe({
node: modifiedAst,
programMemory: kclManager.programMemory,
pathToNode: sketchPathToNode,
})
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else if (intersection2d) {
const lastSegment = sketchGroup.value.slice(-1)[0]
const tmp = addNewSketchLn({
modifiedAst = addNewSketchLn({
node: kclManager.ast,
programMemory: kclManager.programMemory,
to: [intersection2d.x, intersection2d.y],
@ -632,10 +610,7 @@ export class SceneEntities {
? 'tangentialArcTo'
: 'line',
pathToNode: sketchPathToNode,
})
if (trap(tmp)) return Promise.reject(tmp)
modifiedAst = tmp.modifiedAst
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
}).modifiedAst
} else {
// return early as we didn't modify the ast
return
@ -694,14 +669,12 @@ export class SceneEntities {
) => {
let _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName =
_node1.node?.declarations?.[0]?.id?.name || ''
getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
const tags: [string, string, string] = [
findUniqueName(_ast, 'rectangleSegmentA'),
@ -709,13 +682,11 @@ export class SceneEntities {
findUniqueName(_ast, 'rectangleSegmentC'),
]
const _node2 = getNodeFromPath<VariableDeclaration>(
const startSketchOn = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node2)) return Promise.reject(_node2)
const startSketchOn = _node2.node?.declarations
)?.node?.declarations
const startSketchOnInit = startSketchOn?.[0]?.init
startSketchOn[0].init = createPipeExpression([
@ -740,13 +711,11 @@ export class SceneEntities {
const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode))
pathToNodeTwo[1][0] = 0
const _node = getNodeFromPath<VariableDeclaration>(
const sketchInit = getNodeFromPath<VariableDeclaration>(
truncatedAst,
pathToNodeTwo || [],
'VariableDeclaration'
)
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
)?.node?.declarations?.[0]?.init
const x = (args.intersectionPoint.twoD.x || 0) - rectangleOrigin[0]
const y = (args.intersectionPoint.twoD.y || 0) - rectangleOrigin[1]
@ -788,13 +757,11 @@ export class SceneEntities {
const x = roundOff((cornerPoint.x || 0) - rectangleOrigin[0])
const y = roundOff((cornerPoint.y || 0) - rectangleOrigin[1])
const _node = getNodeFromPath<VariableDeclaration>(
const sketchInit = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
)?.node?.declarations?.[0]?.init
if (sketchInit.type === 'PipeExpression') {
updateRectangleSketch(sketchInit, x, y, tags[0])
@ -890,7 +857,6 @@ export class SceneEntities {
ast: kclManager.ast,
programMemory: kclManager.programMemory,
})
if (trap(sketchGroup)) return
const pipeIndex = pathToNode[pathToNodeIndex + 1][0] as number
if (addingNewSegmentStatus === 'nothing') {
@ -908,8 +874,6 @@ export class SceneEntities {
spliceBetween: true,
})
addingNewSegmentStatus = 'pending'
if (trap(mod)) return
await kclManager.executeAstMock(mod.modifiedAst)
await this.tearDownSketch({ removeAxis: false })
this.setupSketch({
@ -1018,22 +982,17 @@ export class SceneEntities {
const to: [number, number] = [intersection2d.x, intersection2d.y]
let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast }
const _node = getNodeFromPath<CallExpression>(
const node = getNodeFromPath<CallExpression>(
modifiedAst,
pathToNode,
'CallExpression'
)
if (trap(_node)) return
const node = _node.node
).node
if (node.type !== 'CallExpression') return
let modded:
| {
modifiedAst: Program
pathToNode: PathToNode
}
| Error
let modded: {
modifiedAst: Program
pathToNode: PathToNode
}
if (group.name === PROFILE_START) {
modded = updateStartProfileAtArgs({
node: modifiedAst,
@ -1051,18 +1010,14 @@ export class SceneEntities {
from
)
}
if (trap(modded)) return
modifiedAst = modded.modifiedAst
const info = draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(pathToNode || [])
if (trap(info, { suppress: true })) return
const { truncatedAst, programMemoryOverride, variableDeclarationName } =
info
draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(sketchPathToNode || [])
;(async () => {
const code = recast(modifiedAst)
if (trap(code)) return
if (!draftInfo)
// 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
@ -1589,14 +1544,11 @@ export class SceneEntities {
])
if (parent?.userData?.pathToNode) {
const updatedAst = parse(recast(kclManager.ast))
if (trap(updatedAst)) return
const _node = getNodeFromPath<CallExpression>(
const node = getNodeFromPath<CallExpression>(
updatedAst,
parent.userData.pathToNode,
'CallExpression'
)
if (trap(_node, { suppress: true })) return
const node = _node.node
).node
editorManager.setHighlightRange([node.start, node.end])
const yellow = 0xffff00
colorSegment(selected, yellow)
@ -1711,23 +1663,20 @@ function prepareTruncatedMemoryAndAst(
ast: Program,
programMemory: ProgramMemory,
draftSegment?: DraftSegment
):
| {
truncatedAst: Program
programMemoryOverride: ProgramMemory
variableDeclarationName: string
}
| Error {
): {
truncatedAst: Program
programMemoryOverride: ProgramMemory
variableDeclarationName: string
} {
const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0
const _ast = JSON.parse(JSON.stringify(ast))
const _node = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (err(_node)) return _node
const variableDeclarationName = _node.node?.declarations?.[0]?.id?.name || ''
const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
const lastSeg = (
programMemory.root[variableDeclarationName] as SketchGroup
).value.slice(-1)[0]
@ -1755,8 +1704,6 @@ function prepareTruncatedMemoryAndAst(
// 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
const updatedSrcRangeAst = parse(recast(_ast)) // get source ranges correct since unfortunately we still rely on them
if (err(updatedSrcRangeAst)) return updatedSrcRangeAst
const lastPipeItem = (
(updatedSrcRangeAst.body[bodyIndex] as VariableDeclaration)
.declarations[0].init as PipeExpression
@ -1780,9 +1727,7 @@ function prepareTruncatedMemoryAndAst(
..._ast,
body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))],
}
const programMemoryOverride = programMemoryInit()
if (err(programMemoryOverride)) return programMemoryOverride
const programMemoryOverride: ProgramMemory = programMemoryInit()
for (let i = 0; i < bodyIndex; i++) {
const node = _ast.body[i]
if (node.type !== 'VariableDeclaration') {
@ -1823,14 +1768,12 @@ export function sketchGroupFromPathToNode({
pathToNode: PathToNode
ast: Program
programMemory: ProgramMemory
}): SketchGroup | Error {
const _varDec = getNodeFromPath<VariableDeclarator>(
}): SketchGroup {
const varDec = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
pathToNode,
'VariableDeclarator'
)
if (err(_varDec)) return _varDec
const varDec = _varDec.node
).node
const result = programMemory.root[varDec?.id?.name || '']
if (result?.type === 'ExtrudeGroup') {
return result.sketchGroup
@ -1865,15 +1808,13 @@ function colorSegment(object: any, color: number) {
export function getSketchQuaternion(
sketchPathToNode: PathToNode,
sketchNormalBackUp: [number, number, number] | null
): Quaternion | Error {
): Quaternion {
const sketchGroup = sketchGroupFromPathToNode({
pathToNode: sketchPathToNode,
ast: kclManager.ast,
programMemory: kclManager.programMemory,
})
if (err(sketchGroup)) return sketchGroup
const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp
return getQuaternionFromZAxis(massageFormats(zAxis))
}
export async function getSketchOrientationDetails(
@ -1887,8 +1828,6 @@ export async function getSketchOrientationDetails(
ast: kclManager.ast,
programMemory: kclManager.programMemory,
})
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (sketchGroup.on.type === 'plane') {
const zAxis = sketchGroup?.on.zAxis
return {
@ -1906,12 +1845,11 @@ export async function getSketchOrientationDetails(
},
}
}
if (sketchGroup.on.type === 'face') {
const faceInfo = await getFaceDetails(sketchGroup.on.id)
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 quaternion = quaternionFromUpNForward(
new Vector3(y_axis.x, y_axis.y, y_axis.z),
@ -1928,7 +1866,7 @@ export async function getSketchOrientationDetails(
},
}
}
return Promise.reject(
throw new Error(
'sketchGroup.on.type not recognized, has a new type been added?'
)
}

View File

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

View File

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

View File

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

View File

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

View File

@ -29,6 +29,7 @@ import {
applyConstraintAngleBetween,
} from './Toolbar/SetAngleBetween'
import { applyConstraintAngleLength } from './Toolbar/setAngleLength'
import { pathMapToSelections } from 'lang/util'
import { useStore } from 'useStore'
import {
Selections,
@ -36,7 +37,6 @@ import {
handleSelectionBatch,
isSelectionLastLine,
isSketchPipe,
updateSelections,
} from 'lib/selections'
import { applyConstraintIntersect } from './Toolbar/Intersect'
import { applyConstraintAbsDistance } from './Toolbar/SetAbsDistance'
@ -77,7 +77,6 @@ import { letEngineAnimateAndSyncCamAfter } from 'clientSideScene/CameraControls'
import { getVarNameModal } from 'hooks/useToolbarGuards'
import useHotkeyWrapper from 'lib/hotkeyWrapper'
import { uuidv4 } from 'lib/utils'
import { err, trap } from 'lib/trap'
type MachineContext<T extends AnyStateMachine> = {
state: StateFrom<T>
@ -460,17 +459,12 @@ export const ModelingMachineProvider = ({
return canExtrudeSelection(selectionRanges)
},
'Sketch is empty': ({ sketchDetails }) => {
const node = getNodeFromPath<VariableDeclaration>(
'Sketch is empty': ({ sketchDetails }) =>
getNodeFromPath<VariableDeclaration>(
kclManager.ast,
sketchDetails?.sketchPathToNode || [],
'VariableDeclaration'
)
// 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'
},
)?.node?.declarations?.[0]?.init.type !== 'PipeExpression',
'Selection is on face': ({ selectionRanges }, { data }) => {
if (data?.forceNewSketch) return false
if (!isSingleCursorInPipe(selectionRanges, kclManager.ast))
@ -513,16 +507,14 @@ export const ModelingMachineProvider = ({
},
'animate-to-face': async (_, { data }) => {
if (data.type === 'extrudeFace') {
const sketched = sketchOnExtrudedFace(
kclManager.ast,
data.sketchPathToNode,
data.extrudePathToNode,
kclManager.programMemory,
data.cap
)
if (trap(sketched)) return Promise.reject(sketched)
const { modifiedAst, pathToNode: pathToNewSketchNode } = sketched
const { modifiedAst, pathToNode: pathToNewSketchNode } =
sketchOnExtrudedFace(
kclManager.ast,
data.sketchPathToNode,
data.extrudePathToNode,
kclManager.programMemory,
data.cap
)
await kclManager.executeAstMock(modifiedAst)
await letEngineAnimateAndSyncCamAfter(
@ -543,12 +535,10 @@ export const ModelingMachineProvider = ({
)
await kclManager.updateAst(modifiedAst, false)
sceneInfra.camControls.syncDirection = 'clientToEngine'
await letEngineAnimateAndSyncCamAfter(
engineCommandManager,
data.planeId
)
return {
sketchPathToNode: pathToNode,
zAxis: data.zAxis,
@ -586,29 +576,25 @@ export const ModelingMachineProvider = ({
selectionRanges,
})
const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
if (!sketchDetails) throw new Error('No sketch details')
const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
@ -622,29 +608,25 @@ export const ModelingMachineProvider = ({
selectionRanges,
})
const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
if (!sketchDetails) throw new Error('No sketch details')
const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
@ -652,11 +634,9 @@ export const ModelingMachineProvider = ({
selectionRanges,
sketchDetails,
}): Promise<SetSelections> => {
const info = angleBetweenInfo({
const { modifiedAst, pathToNodeMap } = await (angleBetweenInfo({
selectionRanges,
})
if (err(info)) return Promise.reject(info)
const { modifiedAst, pathToNodeMap } = await (info.enabled
}).enabled
? applyConstraintAngleBetween({
selectionRanges,
})
@ -665,31 +645,25 @@ export const ModelingMachineProvider = ({
angleOrLength: 'setAngle',
}))
const _modifiedAst = parse(recast(modifiedAst))
if (err(_modifiedAst)) return Promise.reject(_modifiedAst)
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
if (!sketchDetails) throw new Error('No sketch details')
const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
selection: pathMapToSelections(
_modifiedAst,
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
@ -700,29 +674,25 @@ export const ModelingMachineProvider = ({
const { modifiedAst, pathToNodeMap } =
await applyConstraintAngleLength({ selectionRanges })
const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
if (!sketchDetails) throw new Error('No sketch details')
const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
@ -736,29 +706,25 @@ export const ModelingMachineProvider = ({
}
)
const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
if (!sketchDetails) throw new Error('No sketch details')
const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
@ -772,29 +738,25 @@ export const ModelingMachineProvider = ({
selectionRanges,
})
const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
if (!sketchDetails) throw new Error('No sketch details')
const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
@ -808,77 +770,48 @@ export const ModelingMachineProvider = ({
selectionRanges,
})
const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
if (!sketchDetails) throw new Error('No sketch details')
const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
'Get convert to variable info': async (
{ sketchDetails, selectionRanges },
{ data }
): Promise<SetSelections> => {
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
'Get convert to variable info': async ({ sketchDetails }, { data }) => {
if (!sketchDetails) return []
const { variableName } = await getVarNameModal({
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 } =
moveValueIntoNewVariablePath(
parsed,
parse(recast(kclManager.ast)),
kclManager.programMemory,
data.pathToNode,
variableName
)
parsed = parse(recast(_modifiedAst))
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(
await sceneEntitiesManager.updateAstAndRejigSketch(
pathToReplacedNode || [],
parsed,
parse(recast(_modifiedAst)),
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
{ 0: pathToReplacedNode },
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
updatedPathToNode: pathToReplacedNode,
}
return pathToReplacedNode || sketchDetails.sketchPathToNode
},
},
devTools: true,

View File

@ -43,23 +43,23 @@ describe('processMemory', () => {
theExtrude: [
{
type: 'extrudePlane',
tag: null,
name: '',
id: expect.any(String),
faceId: expect.any(String),
sourceRange: [170, 194],
},
{
type: 'extrudePlane',
tag: null,
name: '',
id: expect.any(String),
faceId: expect.any(String),
sourceRange: [202, 230],
},
],
theSketch: [
{ type: 'ToPoint', to: [-3.35, 0.17], from: [0, 0], tag: null },
{ type: 'ToPoint', to: [0.98, 5.16], from: [-3.35, 0.17], tag: null },
{ type: 'ToPoint', to: [2.15, 4.32], from: [0.98, 5.16], 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], name: '' },
{ 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 { useMemo } from 'react'
import { ProgramMemory, Path, ExtrudeSurface } from 'lang/wasm'
import { useKclContext } from 'lang/KclProvider'
import { useResolvedTheme } from 'hooks/useResolvedTheme'
import { ActionButton } from 'components/ActionButton'
import { trap } from 'lib/trap'
import toast from 'react-hot-toast'
import Tooltip from 'components/Tooltip'
import { useModelingContext } from 'hooks/useModelingContext'
@ -14,12 +13,12 @@ export const MemoryPaneMenu = () => {
function copyProgramMemoryToClipboard() {
if (globalThis && 'navigator' in globalThis) {
navigator.clipboard
.writeText(JSON.stringify(programMemory))
.then(() => toast.success('Program memory copied to clipboard'))
.catch((e) =>
trap(new Error('Failed to copy program memory to clipboard'))
)
try {
navigator.clipboard.writeText(JSON.stringify(programMemory))
toast.success('Program memory copied to clipboard')
} catch (e) {
toast.error('Failed to copy program memory to clipboard')
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,6 @@ import {
PathToNodeMap,
getTransformInfos,
transformAstSketchLines,
TransformInfo,
} from '../../lang/std/sketchcombos'
import {
SetAngleLengthModal,
@ -23,7 +22,6 @@ import {
import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { normaliseAngle } from '../../lib/utils'
import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal)
@ -33,29 +31,19 @@ export function angleLengthInfo({
}: {
selectionRanges: Selections
angleOrLength?: 'setLength' | 'setAngle'
}):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
}) {
const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range)
)
const nodes = paths.map((pathToNode) =>
getNodeFromPath<Value>(kclManager.ast, pathToNode, 'CallExpression')
const nodes = paths.map(
(pathToNode) =>
getNodeFromPath<Value>(kclManager.ast, pathToNode, 'CallExpression').node
)
const isAllTooltips = nodes.every(
(node) =>
node?.type === 'CallExpression' &&
toolTips.includes(node.callee.name as any)
)
const _err1 = nodes.find(err)
if (err(_err1)) return _err1
const isAllTooltips = nodes.every((meta) => {
if (err(meta)) return false
return (
meta.node?.type === 'CallExpression' &&
toolTips.includes(meta.node.callee.name as any)
)
})
const transforms = getTransformInfos(
selectionRanges,
@ -79,91 +67,88 @@ export async function applyConstraintAngleLength({
modifiedAst: Program
pathToNodeMap: PathToNodeMap
}> {
const angleLength = angleLengthInfo({ selectionRanges, angleOrLength })
if (err(angleLength)) return Promise.reject(angleLength)
const { transforms } = angleLength
const sketched = transformAstSketchLines({
const { transforms } = angleLengthInfo({ selectionRanges, angleOrLength })
const { valueUsedInTransform } = transformAstSketchLines({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges,
transformInfos: transforms,
programMemory: kclManager.programMemory,
referenceSegName: '',
})
if (err(sketched)) return Promise.reject(sketched)
const { valueUsedInTransform } = sketched
try {
const isReferencingYAxis =
selectionRanges.otherSelections.length === 1 &&
selectionRanges.otherSelections[0] === 'y-axis'
const isReferencingYAxisAngle =
isReferencingYAxis && angleOrLength === 'setAngle'
const isReferencingYAxis =
selectionRanges.otherSelections.length === 1 &&
selectionRanges.otherSelections[0] === 'y-axis'
const isReferencingYAxisAngle =
isReferencingYAxis && angleOrLength === 'setAngle'
const isReferencingXAxis =
selectionRanges.otherSelections.length === 1 &&
selectionRanges.otherSelections[0] === 'x-axis'
const isReferencingXAxisAngle =
isReferencingXAxis && angleOrLength === 'setAngle'
const isReferencingXAxis =
selectionRanges.otherSelections.length === 1 &&
selectionRanges.otherSelections[0] === 'x-axis'
const isReferencingXAxisAngle =
isReferencingXAxis && angleOrLength === 'setAngle'
let forceVal = valueUsedInTransform || 0
let calcIdentifier = createIdentifier('ZERO')
if (isReferencingYAxisAngle) {
calcIdentifier = createIdentifier(
forceVal < 0 ? 'THREE_QUARTER_TURN' : 'QUARTER_TURN'
)
forceVal = normaliseAngle(forceVal + (forceVal < 0 ? 90 : -90))
} else if (isReferencingXAxisAngle) {
calcIdentifier = createIdentifier(
Math.abs(forceVal) > 90 ? 'HALF_TURN' : 'ZERO'
)
forceVal =
Math.abs(forceVal) > 90 ? normaliseAngle(forceVal - 180) : forceVal
}
const { valueNode, variableName, newVariableInsertIndex, sign } =
await getModalInfo({
value: forceVal,
valueName: angleOrLength === 'setAngle' ? 'angle' : 'length',
shouldCreateVariable: true,
})
let forceVal = valueUsedInTransform || 0
let calcIdentifier = createIdentifier('ZERO')
if (isReferencingYAxisAngle) {
calcIdentifier = createIdentifier(
forceVal < 0 ? 'THREE_QUARTER_TURN' : 'QUARTER_TURN'
let finalValue = removeDoubleNegatives(
valueNode as BinaryPart,
sign,
variableName
)
forceVal = normaliseAngle(forceVal + (forceVal < 0 ? 90 : -90))
} else if (isReferencingXAxisAngle) {
calcIdentifier = createIdentifier(
Math.abs(forceVal) > 90 ? 'HALF_TURN' : 'ZERO'
)
forceVal =
Math.abs(forceVal) > 90 ? normaliseAngle(forceVal - 180) : forceVal
}
const { valueNode, variableName, newVariableInsertIndex, sign } =
await getModalInfo({
value: forceVal,
valueName: angleOrLength === 'setAngle' ? 'angle' : 'length',
shouldCreateVariable: true,
})
if (
isReferencingYAxisAngle ||
(isReferencingXAxisAngle && calcIdentifier.name !== 'ZERO')
) {
finalValue = createBinaryExpressionWithUnary([calcIdentifier, finalValue])
}
let finalValue = removeDoubleNegatives(
valueNode as BinaryPart,
sign,
variableName
)
if (
isReferencingYAxisAngle ||
(isReferencingXAxisAngle && calcIdentifier.name !== 'ZERO')
) {
finalValue = createBinaryExpressionWithUnary([calcIdentifier, finalValue])
}
const retval = transformAstSketchLines({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges,
transformInfos: transforms,
programMemory: kclManager.programMemory,
referenceSegName: '',
forceValueUsedInTransform: finalValue,
})
if (err(retval)) return Promise.reject(retval)
const { modifiedAst: _modifiedAst, pathToNodeMap } = retval
if (variableName) {
const newBody = [..._modifiedAst.body]
newBody.splice(
newVariableInsertIndex,
0,
createVariableDeclaration(variableName, valueNode)
)
_modifiedAst.body = newBody
Object.values(pathToNodeMap).forEach((pathToNode) => {
const index = pathToNode.findIndex((a) => a[0] === 'body') + 1
pathToNode[index][0] = Number(pathToNode[index][0]) + 1
})
}
return {
modifiedAst: _modifiedAst,
pathToNodeMap,
const { modifiedAst: _modifiedAst, pathToNodeMap } =
transformAstSketchLines({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges,
transformInfos: transforms,
programMemory: kclManager.programMemory,
referenceSegName: '',
forceValueUsedInTransform: finalValue,
})
if (variableName) {
const newBody = [..._modifiedAst.body]
newBody.splice(
newVariableInsertIndex,
0,
createVariableDeclaration(variableName, valueNode)
)
_modifiedAst.body = newBody
Object.values(pathToNodeMap).forEach((pathToNode) => {
const index = pathToNode.findIndex((a) => a[0] === 'body') + 1
pathToNode[index][0] = Number(pathToNode[index][0]) + 1
})
}
return {
modifiedAst: _modifiedAst,
pathToNodeMap,
}
} catch (e) {
console.log('error', e)
throw e
}
}

View File

@ -6,7 +6,6 @@ import {
unregisterServerCapability,
} from './server-capability-registration'
import { Codec, FromServer, IntoServer } from './codec'
import { err } from 'lib/trap'
const client_capabilities: LSP.ClientCapabilities = {
textDocument: {
@ -120,12 +119,10 @@ export default class Client extends jsrpc.JSONRPCServerAndClient {
// Register a server capability.
params.registrations.forEach(
(capabilityRegistration: LSP.Registration) => {
const caps = registerServerCapability(
this.serverCapabilities = registerServerCapability(
this.serverCapabilities,
capabilityRegistration
)
if (err(caps)) return (this.serverCapabilities = {})
this.serverCapabilities = caps
}
)
})
@ -135,12 +132,10 @@ export default class Client extends jsrpc.JSONRPCServerAndClient {
// Unregister a server capability.
params.unregisterations.forEach(
(capabilityUnregistration: LSP.Unregistration) => {
const caps = unregisterServerCapability(
this.serverCapabilities = unregisterServerCapability(
this.serverCapabilities,
capabilityUnregistration
)
if (err(caps)) return (this.serverCapabilities = {})
this.serverCapabilities = caps
}
)
})

View File

@ -67,13 +67,7 @@ export interface FromServer extends WritableStream<Uint8Array> {
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace FromServer {
export function create(): FromServer | Error {
// Calls private method .start() which can throw.
// This is an odd one of the bunch but try/catch seems most suitable here.
try {
return new StreamDemuxer()
} catch (e: any) {
return e
}
export function create(): FromServer {
return new StreamDemuxer()
}
}

View File

@ -38,9 +38,7 @@ export default class StreamDemuxer extends Queue<Uint8Array> {
// try to parse the content-length from the headers
const length = parseInt(match[1])
if (isNaN(length))
return Promise.reject(new Error('invalid content length'))
if (isNaN(length)) throw new Error('invalid content length')
// slice the headers since we now have the content length
buffer = buffer.slice(match[0].length)

View File

@ -176,7 +176,7 @@ export class LanguageServerClient {
},
})
this.semanticTokens = await deserializeTokens(
this.semanticTokens = deserializeTokens(
result.data,
this.getServerCapabilities().semanticTokensProvider
)

View File

@ -22,16 +22,16 @@ export class SemanticToken {
}
}
export async function deserializeTokens(
export function deserializeTokens(
data: number[],
semanticTokensProvider?: LSP.SemanticTokensOptions
): Promise<SemanticToken[]> {
): SemanticToken[] {
if (!semanticTokensProvider) {
return []
}
// Check if data length is divisible by 5
if (data.length % 5 !== 0) {
return Promise.reject(new Error('Length is not divisible by 5'))
throw new Error('Length is not divisible by 5')
}
const tokens = []

View File

@ -167,7 +167,6 @@ export class LanguageServerPlugin implements PluginValue {
if (pos === null) return null
const dom = document.createElement('div')
dom.classList.add('documentation')
dom.classList.add('hover-tooltip')
dom.style.zIndex = '99999999'
if (this.allowHTMLContent) dom.innerHTML = formatContents(contents)
else dom.textContent = formatContents(contents)

View File

@ -41,7 +41,7 @@ const ServerCapabilitiesProviders: IMethodServerCapabilityProviderDictionary = {
function registerServerCapability(
serverCapabilities: ServerCapabilities,
registration: Registration
): ServerCapabilities | Error {
): ServerCapabilities {
const serverCapabilitiesCopy = JSON.parse(
JSON.stringify(serverCapabilities)
) as IFlexibleServerCapabilities
@ -58,7 +58,7 @@ function registerServerCapability(
)
}
} else {
return new Error('Could not register server capability.')
throw new Error('Could not register server capability.')
}
return serverCapabilitiesCopy

View File

@ -14,10 +14,9 @@ import {
CopilotWorkerOptions,
} from 'editor/plugins/lsp/types'
import { EngineCommandManager } from 'lang/std/engineConnection'
import { err } from 'lib/trap'
const intoServer: IntoServer = new IntoServer()
const fromServer: FromServer | Error = FromServer.create()
const fromServer: FromServer = FromServer.create()
// Initialise the wasm module.
const initialise = async (wasmUrl: string) => {
@ -57,7 +56,6 @@ export async function kclLspRun(
}
onmessage = function (event) {
if (err(fromServer)) return
const { worker, eventType, eventData }: LspWorkerEvent = event.data
switch (eventType) {
@ -113,7 +111,6 @@ onmessage = function (event) {
}
new Promise<void>(async (resolve) => {
if (err(fromServer)) return
for await (const requests of fromServer.requests) {
const encoded = Codec.encode(requests as jsrpc.JSONRPCRequest)
postMessage(encoded)
@ -121,7 +118,6 @@ new Promise<void>(async (resolve) => {
})
new Promise<void>(async (resolve) => {
if (err(fromServer)) return
for await (const notification of fromServer.notifications) {
const encoded = Codec.encode(notification as jsrpc.JSONRPCRequest)
postMessage(encoded)

View File

@ -15,8 +15,6 @@ export function useRefreshSettings(routeId: string = paths.INDEX) {
const routeData = useRouteLoaderData(routeId) as typeof settings
if (!ctx) {
// Intended to stop the world
// eslint-disable-next-line
throw new Error(
'useRefreshSettings must be used within a SettingsAuthProvider'
)

View File

@ -3,7 +3,6 @@ import {
createSetVarNameModal,
} from 'components/SetVarNameModal'
import { editorManager, kclManager } from 'lib/singletons'
import { trap } from 'lib/trap'
import { moveValueIntoNewVariable } from 'lang/modifyAst'
import { isNodeSafeToReplace } from 'lang/queryAst'
import { useEffect, useState } from 'react'
@ -23,16 +22,10 @@ export function useConvertToVariable(range?: SourceRange) {
}, [enable])
useEffect(() => {
const parsed = parse(recast(ast))
if (trap(parsed)) return
const meta = isNodeSafeToReplace(
parsed,
const { isSafe, value } = isNodeSafeToReplace(
parse(recast(ast)),
range || context.selectionRanges.codeBasedSelections?.[0]?.range || []
)
if (trap(meta)) return
const { isSafe, value } = meta
const canReplace = isSafe && value.type !== 'Identifier'
const isOnlyOneSelection =
!!range || context.selectionRanges.codeBasedSelections.length === 1

View File

@ -3,7 +3,6 @@ import { Selections } from 'lib/selections'
import { KCLError, kclErrorsToDiagnostics } from './errors'
import { uuidv4 } from 'lib/utils'
import { EngineCommandManager } from './std/engineConnection'
import { err } from 'lib/trap'
import { deferExecution } from 'lib/utils'
import {
@ -162,17 +161,18 @@ export class KclManager {
}
safeParse(code: string): Program | null {
const ast = parse(code)
this.kclErrors = []
if (!err(ast)) return ast
const kclerror: KCLError = ast as KCLError
console.error('error parsing code', kclerror)
this.kclErrors = [kclerror]
// TODO: re-eval if session should end?
if (kclerror.msg === 'file is empty')
this.engineCommandManager?.endSession()
return null
try {
const ast = parse(code)
this.kclErrors = []
return ast
} catch (e) {
console.error('error parsing code', e)
if (e instanceof KCLError) {
this.kclErrors = [e]
if (e.msg === 'file is empty') this.engineCommandManager?.endSession()
}
return null
}
}
async ensureWasmInit() {
@ -256,10 +256,6 @@ export class KclManager {
await this.ensureWasmInit()
const newCode = recast(ast)
if (err(newCode)) {
console.error(newCode)
return
}
const newAst = this.safeParse(newCode)
if (!newAst) return
codeManager.updateCodeEditor(newCode)
@ -285,13 +281,11 @@ export class KclManager {
Object.entries(this.engineCommandManager.artifactMap).forEach(
([commandId, artifact]) => {
if (!artifact.pathToNode) return
const _node1 = getNodeFromPath<CallExpression>(
const node = getNodeFromPath<CallExpression>(
this.ast,
artifact.pathToNode,
'CallExpression'
)
if (err(_node1)) return
const { node } = _node1
).node
if (node.type !== 'CallExpression') return
const [oldStart, oldEnd] = artifact.range
if (oldStart === 0 && oldEnd === 0) return
@ -328,10 +322,6 @@ export class KclManager {
return
}
const code = recast(ast)
if (err(code)) {
console.error(code)
return
}
if (originalCode === code) return
// Update the code state and the editor.
@ -349,31 +339,19 @@ export class KclManager {
optionalParams?: {
focusPath?: PathToNode
}
): Promise<{
newAst: Program
selections?: Selections
}> {
): Promise<Selections | null> {
const newCode = recast(ast)
if (err(newCode)) return Promise.reject(newCode)
const astWithUpdatedSource = this.safeParse(newCode)
if (!astWithUpdatedSource) return Promise.reject(new Error('bad ast'))
let returnVal: Selections | undefined = undefined
if (!astWithUpdatedSource) return null
let returnVal: Selections | null = null
if (optionalParams?.focusPath) {
const _node1 = getNodeFromPath<any>(
const { node } = getNodeFromPath<any>(
astWithUpdatedSource,
optionalParams?.focusPath
)
if (err(_node1)) return Promise.reject(_node1)
const { node } = _node1
const { start, end } = node
if (!start || !end)
return {
selections: undefined,
newAst: astWithUpdatedSource,
}
if (!start || !end) return null
returnVal = {
codeBasedSelections: [
{
@ -399,8 +377,7 @@ export class KclManager {
// Execute ast mock will update the code state and editor.
await this.executeAstMock(astWithUpdatedSource)
}
return { selections: returnVal, newAst: astWithUpdatedSource }
return returnVal
}
get defaultPlanes() {

View File

@ -1,6 +1,5 @@
import { KCLError } from './errors'
import { initPromise, parse } from './wasm'
import { err } from 'lib/trap'
beforeAll(async () => {
await initPromise
@ -9,7 +8,6 @@ beforeAll(async () => {
describe('testing AST', () => {
test('5 + 6', () => {
const result = parse('5 +6')
if (err(result)) throw result
delete (result as any).nonCodeMeta
expect(result.body).toEqual([
{
@ -40,9 +38,7 @@ describe('testing AST', () => {
])
})
test('const myVar = 5', () => {
const ast = parse('const myVar = 5')
if (err(ast)) throw ast
const { body } = ast
const { body } = parse('const myVar = 5')
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -76,9 +72,7 @@ describe('testing AST', () => {
const code = `const myVar = 5
const newVar = myVar + 1
`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -150,11 +144,9 @@ const newVar = myVar + 1
describe('testing function declaration', () => {
test('fn funcN = (a, b) => {return a + b}', () => {
const ast = parse(
const { body } = parse(
['fn funcN = (a, b) => {', ' return a + b', '}'].join('\n')
)
if (err(ast)) throw ast
const { body } = ast
delete (body[0] as any).declarations[0].init.body.nonCodeMeta
expect(body).toEqual([
{
@ -237,9 +229,7 @@ describe('testing function declaration', () => {
test('call expression assignment', () => {
const code = `fn funcN = (a, b) => { return a + b }
const myVar = funcN(1, 2)`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
delete (body[0] as any).declarations[0].init.body.nonCodeMeta
expect(body).toEqual([
{
@ -376,9 +366,7 @@ describe('testing pipe operator special', () => {
|> lineTo([1, 1], %)
|> rx(45, %)
`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
delete (body[0] as any).declarations[0].init.nonCodeMeta
expect(body).toEqual([
{
@ -578,9 +566,7 @@ describe('testing pipe operator special', () => {
})
test('pipe operator with binary expression', () => {
let code = `const myVar = 5 + 6 |> myFunc(45, %)`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
delete (body as any)[0].declarations[0].init.nonCodeMeta
expect(body).toEqual([
{
@ -659,9 +645,7 @@ describe('testing pipe operator special', () => {
})
test('array expression', () => {
let code = `const yo = [1, '2', three, 4 + 5]`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -736,9 +720,7 @@ describe('testing pipe operator special', () => {
'const three = 3',
"const yo = {aStr: 'str', anum: 2, identifier: three, binExp: 4 + 5}",
].join('\n')
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -882,9 +864,7 @@ describe('testing pipe operator special', () => {
const code = `const yo = {key: {
key2: 'value'
}}`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -952,9 +932,7 @@ describe('testing pipe operator special', () => {
})
test('object expression with array ast', () => {
const code = `const yo = {key: [1, '2']}`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -1018,9 +996,7 @@ describe('testing pipe operator special', () => {
})
test('object memberExpression simple', () => {
const code = `const prop = yo.one.two`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -1075,9 +1051,7 @@ describe('testing pipe operator special', () => {
})
test('object memberExpression with square braces', () => {
const code = `const prop = yo.one["two"]`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -1133,9 +1107,7 @@ describe('testing pipe operator special', () => {
})
test('object memberExpression with two square braces literal and identifier', () => {
const code = `const prop = yo["one"][two]`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -1194,9 +1166,7 @@ describe('testing pipe operator special', () => {
describe('nests binary expressions correctly', () => {
it('works with the simple case', () => {
const code = `const yo = 1 + 2`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body[0]).toEqual({
type: 'VariableDeclaration',
start: 0,
@ -1240,9 +1210,7 @@ describe('nests binary expressions correctly', () => {
it('should nest according to precedence with multiply first', () => {
// should be binExp { binExp { lit-1 * lit-2 } + lit}
const code = `const yo = 1 * 2 + 3`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body[0]).toEqual({
type: 'VariableDeclaration',
start: 0,
@ -1299,9 +1267,7 @@ describe('nests binary expressions correctly', () => {
it('should nest according to precedence with sum first', () => {
// should be binExp { lit-1 + binExp { lit-2 * lit-3 } }
const code = `const yo = 1 + 2 * 3`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect(body[0]).toEqual({
type: 'VariableDeclaration',
start: 0,
@ -1357,9 +1323,7 @@ describe('nests binary expressions correctly', () => {
})
it('should nest properly with two operators of equal precedence', () => {
const code = `const yo = 1 + 2 - 3`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect((body[0] as any).declarations[0].init).toEqual({
type: 'BinaryExpression',
start: 11,
@ -1396,9 +1360,7 @@ describe('nests binary expressions correctly', () => {
})
it('should nest properly with two operators of equal (but higher) precedence', () => {
const code = `const yo = 1 * 2 / 3`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
expect((body[0] as any).declarations[0].init).toEqual({
type: 'BinaryExpression',
start: 11,
@ -1435,9 +1397,7 @@ describe('nests binary expressions correctly', () => {
})
it('should nest properly with longer example', () => {
const code = `const yo = 1 + 2 * (3 - 4) / 5 + 6`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
const init = (body[0] as any).declarations[0].init
expect(init).toEqual({
type: 'BinaryExpression',
@ -1500,16 +1460,12 @@ const key = 'c'`
value: 'this is a comment',
},
}
const ast = parse(code)
if (err(ast)) throw ast
const { nonCodeMeta } = ast
const { nonCodeMeta } = parse(code)
expect(nonCodeMeta.nonCodeNodes[0][0]).toEqual(nonCodeMetaInstance)
// extra whitespace won't change it's position (0) or value (NB the start end would have changed though)
const codeWithExtraStartWhitespace = '\n\n\n' + code
const ast2 = parse(codeWithExtraStartWhitespace)
if (err(ast2)) throw ast2
const { nonCodeMeta: nonCodeMeta2 } = ast2
const { nonCodeMeta: nonCodeMeta2 } = parse(codeWithExtraStartWhitespace)
expect(nonCodeMeta2.nonCodeNodes[0][0].value).toStrictEqual(
nonCodeMetaInstance.value
)
@ -1527,9 +1483,7 @@ const key = 'c'`
|> close(%)
`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
const indexOfSecondLineToExpression = 2
const sketchNonCodeMeta = (body as any)[0].declarations[0].init.nonCodeMeta
.nonCodeNodes
@ -1554,9 +1508,7 @@ const key = 'c'`
' |> rx(90, %)',
].join('\n')
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
const sketchNonCodeMeta = (body[0] as any).declarations[0].init.nonCodeMeta
.nonCodeNodes[3][0]
expect(sketchNonCodeMeta).toEqual({
@ -1575,9 +1527,7 @@ const key = 'c'`
describe('test UnaryExpression', () => {
it('should parse a unary expression in simple var dec situation', () => {
const code = `const myVar = -min(4, 100)`
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
const myVarInit = (body?.[0] as any).declarations[0]?.init
expect(myVarInit).toEqual({
type: 'UnaryExpression',
@ -1602,9 +1552,7 @@ describe('test UnaryExpression', () => {
describe('testing nested call expressions', () => {
it('callExp in a binExp in a callExp', () => {
const code = 'const myVar = min(100, 1 + legLen(5, 3))'
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
const myVarInit = (body?.[0] as any).declarations[0]?.init
expect(myVarInit).toEqual({
type: 'CallExpression',
@ -1640,9 +1588,7 @@ describe('testing nested call expressions', () => {
describe('should recognise callExpresions in binaryExpressions', () => {
const code = "xLineTo(segEndX('seg02', %) + 1, %)"
it('should recognise the callExp', () => {
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const { body } = parse(code)
const callExpArgs = (body?.[0] as any).expression?.arguments
expect(callExpArgs).toEqual([
{
@ -1677,12 +1623,16 @@ describe('should recognise callExpresions in binaryExpressions', () => {
describe('parsing errors', () => {
it('should return an error when there is a unexpected closed curly brace', async () => {
const code = `const myVar = startSketchAt([}], %)`
const result = parse(code)
expect(result).toBeInstanceOf(KCLError)
const error = result as KCLError
expect(error.kind).toBe('syntax')
expect(error.msg).toBe('Unexpected token')
expect(error.sourceRanges).toEqual([[27, 28]])
let _theError
try {
let _ = expect(parse(code))
} catch (e) {
_theError = e
}
const theError = _theError as any
expect(theError).toEqual(
new KCLError('syntax', 'Unexpected token', [[27, 28]])
)
})
})

View File

@ -23,7 +23,7 @@ const mySketch001 = startSketchOn('XY')
start: {
to: [0, 0],
from: [0, 0],
tag: null,
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [46, 71],
@ -32,7 +32,7 @@ const mySketch001 = startSketchOn('XY')
value: [
{
type: 'ToPoint',
tag: null,
name: '',
to: [-1.59, -1.54],
from: [0, 0],
__geoMeta: {
@ -44,7 +44,7 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint',
to: [0.46, -5.82],
from: [-1.59, -1.54],
tag: null,
name: '',
__geoMeta: {
sourceRange: [108, 132],
id: expect.any(String),
@ -74,14 +74,14 @@ const mySketch001 = startSketchOn('XY')
{
type: 'extrudePlane',
faceId: expect.any(String),
tag: null,
name: '',
id: expect.any(String),
sourceRange: [77, 102],
},
{
type: 'extrudePlane',
faceId: expect.any(String),
tag: null,
name: '',
id: expect.any(String),
sourceRange: [108, 132],
},
@ -97,7 +97,7 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 0],
to: [-1.59, -1.54],
tag: null,
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [77, 102],
@ -107,7 +107,7 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint',
from: [-1.59, -1.54],
to: [0.46, -5.82],
tag: null,
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [108, 132],
@ -155,26 +155,21 @@ const sk2 = startSketchOn('XY')
{
type: 'extrudePlane',
faceId: expect.any(String),
tag: null,
name: '',
id: expect.any(String),
sourceRange: [69, 89],
},
{
type: 'extrudePlane',
faceId: expect.any(String),
tag: {
end: 117,
start: 114,
type: 'TagDeclarator',
value: 'p',
},
name: 'p',
id: expect.any(String),
sourceRange: [95, 118],
},
{
type: 'extrudePlane',
faceId: expect.any(String),
tag: null,
name: '',
id: expect.any(String),
sourceRange: [124, 143],
},
@ -190,7 +185,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
tag: null,
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [69, 89],
@ -200,12 +195,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [-2.5, 0],
to: [0, 10],
tag: {
end: 117,
start: 114,
type: 'TagDeclarator',
value: 'p',
},
name: 'p',
__geoMeta: {
id: expect.any(String),
sourceRange: [95, 118],
@ -215,7 +205,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 10],
to: [2.5, 0],
tag: null,
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [124, 143],
@ -235,26 +225,21 @@ const sk2 = startSketchOn('XY')
{
type: 'extrudePlane',
faceId: expect.any(String),
tag: null,
name: '',
id: expect.any(String),
sourceRange: [374, 394],
},
{
type: 'extrudePlane',
faceId: expect.any(String),
tag: {
end: 421,
start: 418,
type: 'TagDeclarator',
value: 'p',
},
name: 'p',
id: expect.any(String),
sourceRange: [400, 422],
},
{
type: 'extrudePlane',
faceId: expect.any(String),
tag: null,
name: '',
id: expect.any(String),
sourceRange: [428, 447],
},
@ -270,7 +255,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
tag: null,
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [374, 394],
@ -280,12 +265,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [-2.5, 0],
to: [0, 3],
tag: {
end: 421,
start: 418,
type: 'TagDeclarator',
value: 'p',
},
name: 'p',
__geoMeta: {
id: expect.any(String),
sourceRange: [400, 422],
@ -295,7 +275,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 3],
to: [2.5, 0],
tag: null,
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [428, 447],

View File

@ -4,8 +4,6 @@ describe('test kclErrToDiagnostic', () => {
it('converts KCL errors to CodeMirror diagnostics', () => {
const errors: KCLError[] = [
{
name: '',
message: '',
kind: 'semantic',
msg: 'Semantic error',
sourceRanges: [
@ -14,8 +12,6 @@ describe('test kclErrToDiagnostic', () => {
],
},
{
name: '',
message: '',
kind: 'type',
msg: 'Type error',
sourceRanges: [

View File

@ -5,7 +5,7 @@ import { Diagnostic as LspDiagnostic } from 'vscode-languageserver-protocol'
import { Text } from '@codemirror/state'
type ExtractKind<T> = T extends { kind: infer K } ? K : never
export class KCLError extends Error {
export class KCLError {
kind: ExtractKind<RustKclError> | 'name'
sourceRanges: [number, number][]
msg: string
@ -14,7 +14,6 @@ export class KCLError extends Error {
msg: string,
sourceRanges: [number, number][]
) {
super()
this.kind = kind
this.msg = msg
this.sourceRanges = sourceRanges

View File

@ -62,18 +62,13 @@ const newVar = myVar + 1`
sourceRange: [72, 98],
id: expect.any(String),
},
tag: {
end: 97,
start: 89,
type: 'TagDeclarator',
value: 'myPath',
},
name: 'myPath',
},
{
type: 'ToPoint',
to: [2, 3],
from: [0, 2],
tag: null,
name: '',
__geoMeta: {
sourceRange: [104, 120],
id: expect.any(String),
@ -87,12 +82,7 @@ const newVar = myVar + 1`
sourceRange: [126, 156],
id: expect.any(String),
},
tag: {
end: 155,
start: 144,
type: 'TagDeclarator',
value: 'rightPath',
},
name: 'rightPath',
},
])
})
@ -149,7 +139,7 @@ const newVar = myVar + 1`
start: {
to: [0, 0],
from: [0, 0],
tag: null,
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [39, 63],
@ -160,7 +150,7 @@ const newVar = myVar + 1`
type: 'ToPoint',
to: [1, 1],
from: [0, 0],
tag: null,
name: '',
__geoMeta: {
sourceRange: [69, 85],
id: expect.any(String),
@ -174,18 +164,13 @@ const newVar = myVar + 1`
sourceRange: [91, 118],
id: expect.any(String),
},
tag: {
end: 117,
start: 109,
type: 'TagDeclarator',
value: 'myPath',
},
name: 'myPath',
},
{
type: 'ToPoint',
to: [1, 1],
from: [0, 1],
tag: null,
name: '',
__geoMeta: {
sourceRange: [124, 140],
id: expect.any(String),

View File

@ -1,6 +1,5 @@
import { getNodePathFromSourceRange, getNodeFromPath } from './queryAst'
import { Identifier, parse, initPromise, Parameter } from './wasm'
import { err } from 'lib/trap'
beforeAll(async () => {
await initPromise
@ -23,11 +22,8 @@ const sk3 = startSketchAt([0, 0])
]
const ast = parse(code)
if (err(ast)) throw ast
const nodePath = getNodePathFromSourceRange(ast, sourceRange)
const _node = getNodeFromPath<any>(ast, nodePath)
if (err(_node)) throw _node
const { node } = _node
const { node } = getNodeFromPath<any>(ast, nodePath)
expect([node.start, node.end]).toEqual(sourceRange)
expect(node.type).toBe('CallExpression')
@ -51,11 +47,8 @@ const b1 = cube([0,0], 10)`
]
const ast = parse(code)
if (err(ast)) throw ast
const nodePath = getNodePathFromSourceRange(ast, sourceRange)
const _node = getNodeFromPath<Parameter>(ast, nodePath)
if (err(_node)) throw _node
const node = _node.node
const node = getNodeFromPath<Parameter>(ast, nodePath).node
expect(nodePath).toEqual([
['body', ''],
@ -88,11 +81,8 @@ const b1 = cube([0,0], 10)`
]
const ast = parse(code)
if (err(ast)) throw ast
const nodePath = getNodePathFromSourceRange(ast, sourceRange)
const _node = getNodeFromPath<Identifier>(ast, nodePath)
if (err(_node)) throw _node
const node = _node.node
const node = getNodeFromPath<Identifier>(ast, nodePath).node
expect(nodePath).toEqual([
['body', ''],
[0, 'index'],

View File

@ -18,7 +18,6 @@ import {
} from './modifyAst'
import { enginelessExecutor } from '../lib/testHelpers'
import { findUsesOfTagInPipe, getNodePathFromSourceRange } from './queryAst'
import { err } from 'lib/trap'
beforeAll(async () => {
await initPromise
@ -141,14 +140,10 @@ function giveSketchFnCallTagTestHelper(
// this wrapper changes the input and output to code
// making it more of an integration test, but easier to read the test intention is the goal
const ast = parse(code)
if (err(ast)) throw ast
const start = code.indexOf(searchStr)
const range: [number, number] = [start, start + searchStr.length]
const sketchRes = giveSketchFnCallTag(ast, range)
if (err(sketchRes)) throw sketchRes
const { modifiedAst, tag, isTagExisting } = sketchRes
const { modifiedAst, tag, isTagExisting } = giveSketchFnCallTag(ast, range)
const newCode = recast(modifiedAst)
if (err(newCode)) throw newCode
return { tag, newCode, isTagExisting }
}
@ -216,7 +211,6 @@ const part001 = startSketchOn('XY')
const yo2 = hmm([identifierGuy + 5])`
it('should move a binary expression into a new variable', async () => {
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const startIndex = code.indexOf('100 + 100') + 1
const { modifiedAst } = moveValueIntoNewVariable(
@ -231,7 +225,6 @@ const yo2 = hmm([identifierGuy + 5])`
})
it('should move a value into a new variable', async () => {
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const startIndex = code.indexOf('2.8') + 1
const { modifiedAst } = moveValueIntoNewVariable(
@ -246,7 +239,6 @@ const yo2 = hmm([identifierGuy + 5])`
})
it('should move a callExpression into a new variable', async () => {
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const startIndex = code.indexOf('def(')
const { modifiedAst } = moveValueIntoNewVariable(
@ -261,7 +253,6 @@ const yo2 = hmm([identifierGuy + 5])`
})
it('should move a binary expression with call expression into a new variable', async () => {
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const startIndex = code.indexOf('jkl(') + 1
const { modifiedAst } = moveValueIntoNewVariable(
@ -276,7 +267,6 @@ const yo2 = hmm([identifierGuy + 5])`
})
it('should move a identifier into a new variable', async () => {
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const startIndex = code.indexOf('identifierGuy +') + 1
const { modifiedAst } = moveValueIntoNewVariable(
@ -300,8 +290,6 @@ describe('testing sketchOnExtrudedFace', () => {
|> close(%)
|> extrude(5 + 7, %)`
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const segmentSnippet = `line([9.7, 9.19], %)`
const segmentRange: [number, number] = [
@ -316,15 +304,12 @@ describe('testing sketchOnExtrudedFace', () => {
]
const extrudePathToNode = getNodePathFromSourceRange(ast, extrudeRange)
const extruded = sketchOnExtrudedFace(
const { modifiedAst } = sketchOnExtrudedFace(
ast,
segmentPathToNode,
extrudePathToNode,
programMemory
)
if (err(extruded)) throw extruded
const { modifiedAst } = extruded
const newCode = recast(modifiedAst)
expect(newCode).toContain(`const part001 = startSketchOn('-XZ')
|> startProfileAt([3.58, 2.06], %)
@ -332,7 +317,8 @@ describe('testing sketchOnExtrudedFace', () => {
|> line([8.62, -9.57], %)
|> close(%)
|> extrude(5 + 7, %)
const sketch001 = startSketchOn(part001, 'seg01')`)
const surface001 = startSketchOn(part001, 'seg01')
const sketch001 = surface001`)
})
test('it should be able to extrude on close segments', async () => {
const code = `const part001 = startSketchOn('-XZ')
@ -342,7 +328,6 @@ const sketch001 = startSketchOn(part001, 'seg01')`)
|> close(%)
|> extrude(5 + 7, %)`
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const segmentSnippet = `close(%)`
const segmentRange: [number, number] = [
@ -357,15 +342,12 @@ const sketch001 = startSketchOn(part001, 'seg01')`)
]
const extrudePathToNode = getNodePathFromSourceRange(ast, extrudeRange)
const extruded = sketchOnExtrudedFace(
const { modifiedAst } = sketchOnExtrudedFace(
ast,
segmentPathToNode,
extrudePathToNode,
programMemory
)
if (err(extruded)) throw extruded
const { modifiedAst } = extruded
const newCode = recast(modifiedAst)
expect(newCode).toContain(`const part001 = startSketchOn('-XZ')
|> startProfileAt([3.58, 2.06], %)
@ -373,7 +355,8 @@ const sketch001 = startSketchOn(part001, 'seg01')`)
|> line([8.62, -9.57], %)
|> close(%, 'seg01')
|> extrude(5 + 7, %)
const sketch001 = startSketchOn(part001, 'seg01')`)
const surface001 = startSketchOn(part001, 'seg01')
const sketch001 = surface001`)
})
test('it should be able to extrude on start-end caps', async () => {
const code = `const part001 = startSketchOn('-XZ')
@ -383,7 +366,6 @@ const sketch001 = startSketchOn(part001, 'seg01')`)
|> close(%)
|> extrude(5 + 7, %)`
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const sketchSnippet = `startProfileAt([3.58, 2.06], %)`
const sketchRange: [number, number] = [
@ -398,16 +380,13 @@ const sketch001 = startSketchOn(part001, 'seg01')`)
]
const extrudePathToNode = getNodePathFromSourceRange(ast, extrudeRange)
const extruded = sketchOnExtrudedFace(
const { modifiedAst } = sketchOnExtrudedFace(
ast,
sketchPathToNode,
extrudePathToNode,
programMemory,
'end'
)
if (err(extruded)) throw extruded
const { modifiedAst } = extruded
const newCode = recast(modifiedAst)
expect(newCode).toContain(`const part001 = startSketchOn('-XZ')
|> startProfileAt([3.58, 2.06], %)
@ -415,7 +394,8 @@ const sketch001 = startSketchOn(part001, 'seg01')`)
|> line([8.62, -9.57], %)
|> close(%)
|> extrude(5 + 7, %)
const sketch001 = startSketchOn(part001, 'END')`)
const surface001 = startSketchOn(part001, 'END')
const sketch001 = surface001`)
})
test('it should ensure that the new sketch is inserted after the extrude', async () => {
const code = `const sketch001 = startSketchOn('-XZ')
@ -433,7 +413,6 @@ const sketch001 = startSketchOn(part001, 'END')`)
|> close(%)
const part001 = extrude(5 + 7, sketch001)`
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const segmentSnippet = `line([4.99, -0.46], %)`
const segmentRange: [number, number] = [
@ -448,16 +427,16 @@ const sketch001 = startSketchOn(part001, 'END')`)
]
const extrudePathToNode = getNodePathFromSourceRange(ast, extrudeRange)
const updatedAst = sketchOnExtrudedFace(
const { modifiedAst } = sketchOnExtrudedFace(
ast,
segmentPathToNode,
extrudePathToNode,
programMemory
)
if (err(updatedAst)) throw updatedAst
const newCode = recast(updatedAst.modifiedAst)
const newCode = recast(modifiedAst)
expect(newCode).toContain(`const part001 = extrude(5 + 7, sketch001)
const sketch002 = startSketchOn(part001, 'seg01')`)
const surface001 = startSketchOn(part001, 'seg01')
const sketch002 = surface001`)
})
})
@ -469,7 +448,6 @@ describe('Testing deleteSegmentFromPipeExpression', () => {
|> line([306.21, 198.85], %, 'a')
|> line([306.21, 198.87], %)`
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const lineOfInterest = "line([306.21, 198.85], %, 'a')"
const range: [number, number] = [
@ -484,7 +462,6 @@ describe('Testing deleteSegmentFromPipeExpression', () => {
code,
pathToNode
)
if (err(modifiedAst)) throw modifiedAst
const newCode = recast(modifiedAst)
expect(newCode).toBe(`const part001 = startSketchOn('-XZ')
|> startProfileAt([54.78, -95.91], %)
@ -547,7 +524,6 @@ ${!replace1 ? ` |> ${line}\n` : ''} |> angledLine([-65, ${
])(`%s`, async (_, line, [replace1, replace2]) => {
const code = makeCode(line)
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const lineOfInterest = line
const range: [number, number] = [
@ -563,7 +539,6 @@ ${!replace1 ? ` |> ${line}\n` : ''} |> angledLine([-65, ${
code,
pathToNode
)
if (err(modifiedAst)) throw modifiedAst
const newCode = recast(modifiedAst)
expect(newCode).toBe(makeCode(line, replace1, replace2))
})
@ -635,8 +610,6 @@ describe('Testing removeSingleConstraintInfo', () => {
['tangentialArcTo([3.14 + 0, 13.14], %)', 'arrayIndex', 1],
])('stdlib fn: %s', async (expectedFinish, key, value) => {
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const lineOfInterest = expectedFinish.split('(')[0] + '('
const range: [number, number] = [
@ -652,7 +625,7 @@ describe('Testing removeSingleConstraintInfo', () => {
ast,
programMemory
)
if (!mod) return new Error('mod is undefined')
if (!mod) throw new Error('yo is undefined')
const recastCode = recast(mod.modifiedAst)
expect(recastCode).toContain(expectedFinish)
})
@ -673,8 +646,6 @@ describe('Testing removeSingleConstraintInfo', () => {
['angledLineToY([30, 10.14 + 0], %)', 'arrayIndex', 0],
])('stdlib fn: %s', async (expectedFinish, key, value) => {
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const lineOfInterest = expectedFinish.split('(')[0] + '('
const range: [number, number] = [
@ -690,7 +661,7 @@ describe('Testing removeSingleConstraintInfo', () => {
ast,
programMemory
)
if (!mod) return new Error('mod is undefined')
if (!mod) throw new Error('yo is undefined')
const recastCode = recast(mod.modifiedAst)
expect(recastCode).toContain(expectedFinish)
})

View File

@ -1,5 +1,4 @@
import { Selection } from 'lib/selections'
import { err, trap } from 'lib/trap'
import {
Program,
CallExpression,
@ -44,15 +43,27 @@ export function startSketchOnDefault(
name = ''
): { modifiedAst: Program; id: string; pathToNode: PathToNode } {
const _node = { ...node }
const _name =
name || findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH)
const surfaceName =
name || findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SURFACE)
const startSketchOn = createCallExpressionStdLib('startSketchOn', [
createLiteral(axis),
])
const variableDeclaration = createVariableDeclaration(_name, startSketchOn)
_node.body = [...node.body, variableDeclaration]
const surfaceVariableDeclaration = createVariableDeclaration(
surfaceName,
startSketchOn
)
_node.body = [..._node.body, surfaceVariableDeclaration]
// Create the variable for the sketch.
const sketchName =
name || findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH)
const sketchVariableDeclaration = createVariableDeclaration(
sketchName,
createIdentifier(surfaceName)
)
_node.body = [..._node.body, sketchVariableDeclaration]
const sketchIndex = _node.body.length - 1
let pathToNode: PathToNode = [
@ -65,7 +76,7 @@ export function startSketchOnDefault(
return {
modifiedAst: _node,
id: _name,
id: sketchName,
pathToNode,
}
}
@ -74,16 +85,14 @@ export function addStartProfileAt(
node: Program,
pathToNode: PathToNode,
at: [number, number]
): { modifiedAst: Program; pathToNode: PathToNode } | Error {
const _node1 = getNodeFromPath<VariableDeclaration>(
): { modifiedAst: Program; pathToNode: PathToNode } {
const variableDeclaration = getNodeFromPath<VariableDeclaration>(
node,
pathToNode,
'VariableDeclaration'
)
if (err(_node1)) return _node1
const variableDeclaration = _node1.node
).node
if (variableDeclaration.type !== 'VariableDeclaration') {
return new Error('variableDeclaration.init.type !== PipeExpression')
throw new Error('variableDeclaration.init.type !== PipeExpression')
}
const _node = { ...node }
const init = variableDeclaration.declarations[0].init
@ -250,36 +259,24 @@ export function extrudeSketch(
pathToNode: PathToNode,
shouldPipe = false,
distance = createLiteral(4) as Value
):
| {
modifiedAst: Program
pathToNode: PathToNode
pathToExtrudeArg: PathToNode
}
| Error {
): {
modifiedAst: Program
pathToNode: PathToNode
pathToExtrudeArg: PathToNode
} {
const _node = { ...node }
const _node1 = getNodeFromPath(_node, pathToNode)
if (err(_node1)) return _node1
const { node: sketchExpression } = _node1
const { node: sketchExpression } = getNodeFromPath(_node, pathToNode)
// determine if sketchExpression is in a pipeExpression or not
const _node2 = getNodeFromPath<PipeExpression>(
const { node: pipeExpression } = getNodeFromPath<PipeExpression>(
_node,
pathToNode,
'PipeExpression'
)
if (err(_node2)) return _node2
const { node: pipeExpression } = _node2
const isInPipeExpression = pipeExpression.type === 'PipeExpression'
const _node3 = getNodeFromPath<VariableDeclarator>(
_node,
pathToNode,
'VariableDeclarator'
)
if (err(_node3)) return _node3
const { node: variableDeclarator, shallowPath: pathToDecleration } = _node3
const { node: variableDeclarator, shallowPath: pathToDecleration } =
getNodeFromPath<VariableDeclarator>(_node, pathToNode, 'VariableDeclarator')
const extrudeCall = createCallExpressionStdLib('extrude', [
distance,
@ -346,42 +343,35 @@ export function sketchOnExtrudedFace(
extrudePathToNode: PathToNode,
programMemory: ProgramMemory,
cap: 'none' | 'start' | 'end' = 'none'
): { modifiedAst: Program; pathToNode: PathToNode } | Error {
): { modifiedAst: Program; pathToNode: PathToNode } {
let _node = { ...node }
const newSketchName = findUniqueName(
const newSurfaceName = findUniqueName(
node,
KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH
KCL_DEFAULT_CONSTANT_PREFIXES.SURFACE
)
const _node1 = getNodeFromPath<VariableDeclarator>(
const { node: oldSketchNode } = getNodeFromPath<VariableDeclarator>(
_node,
sketchPathToNode,
'VariableDeclarator',
true
)
if (err(_node1)) return _node1
const { node: oldSketchNode } = _node1
const oldSketchName = oldSketchNode.id.name
const _node2 = getNodeFromPath<CallExpression>(
const { node: expression } = getNodeFromPath<CallExpression>(
_node,
sketchPathToNode,
'CallExpression'
)
if (err(_node2)) return _node2
const { node: expression } = _node2
const _node3 = getNodeFromPath<VariableDeclarator>(
const { node: extrudeVarDec } = getNodeFromPath<VariableDeclarator>(
_node,
extrudePathToNode,
'VariableDeclarator'
)
if (err(_node3)) return _node3
const { node: extrudeVarDec } = _node3
const extrudeName = extrudeVarDec.id?.name
let _tag = ''
if (cap === 'none') {
const __tag = addTagForSketchOnFace(
const { modifiedAst, tag } = addTagForSketchOnFace(
{
previousProgramMemory: programMemory,
pathToNode: sketchPathToNode,
@ -389,16 +379,14 @@ export function sketchOnExtrudedFace(
},
expression.callee.name
)
if (err(__tag)) return __tag
const { modifiedAst, tag } = __tag
_tag = tag
_node = modifiedAst
} else {
_tag = cap.toUpperCase()
}
const newSketch = createVariableDeclaration(
newSketchName,
const newSurface = createVariableDeclaration(
newSurfaceName,
createCallExpressionStdLib('startSketchOn', [
createIdentifier(extrudeName ? extrudeName : oldSketchName),
createLiteral(_tag),
@ -410,18 +398,31 @@ export function sketchOnExtrudedFace(
sketchPathToNode[1][0] as number,
extrudePathToNode[1][0] as number
)
_node.body.splice(expressionIndex + 1, 0, newSketch)
const newpathToNode: PathToNode = [
_node.body.splice(expressionIndex + 1, 0, newSurface)
// Create the variable for the sketch.
const newSketchName = findUniqueName(
node,
KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH
)
const sketchVariableDeclaration = createVariableDeclaration(
newSketchName,
createIdentifier(newSurfaceName)
)
const sketchIndex = expressionIndex + 2
_node.body.splice(sketchIndex, 0, sketchVariableDeclaration)
let newPathToNode: PathToNode = [
['body', ''],
[expressionIndex + 1, 'index'],
[sketchIndex, 'index'],
['declarations', 'VariableDeclaration'],
[0, 'index'],
['0', 'index'],
['init', 'VariableDeclarator'],
]
return {
modifiedAst: _node,
pathToNode: newpathToNode,
pathToNode: newPathToNode,
}
}
@ -641,19 +642,18 @@ export function giveSketchFnCallTag(
ast: Program,
range: Selection['range'],
tag?: string
):
| {
modifiedAst: Program
tag: string
isTagExisting: boolean
pathToNode: PathToNode
}
| Error {
): {
modifiedAst: Program
tag: string
isTagExisting: boolean
pathToNode: PathToNode
} {
const path = getNodePathFromSourceRange(ast, range)
const _node1 = getNodeFromPath<CallExpression>(ast, path, 'CallExpression')
if (err(_node1)) return _node1
const { node: primaryCallExp } = _node1
const { node: primaryCallExp } = getNodeFromPath<CallExpression>(
ast,
path,
'CallExpression'
)
// Tag is always 3rd expression now, using arg index feels brittle
// but we can come up with a better way to identify tag later.
const thirdArg = primaryCallExp.arguments?.[2]
@ -672,7 +672,7 @@ export function giveSketchFnCallTag(
pathToNode: path,
}
} else {
return new Error('Unable to assign tag without value')
throw new Error('Unable to assign tag without value')
}
}
@ -685,10 +685,7 @@ export function moveValueIntoNewVariablePath(
modifiedAst: Program
pathToReplacedNode?: PathToNode
} {
const meta = isNodeSafeToReplacePath(ast, pathToNode)
if (trap(meta)) return { modifiedAst: ast }
const { isSafe, value, replacer } = meta
const { isSafe, value, replacer } = isNodeSafeToReplacePath(ast, pathToNode)
if (!isSafe || value.type === 'Identifier') return { modifiedAst: ast }
const { insertIndex } = findAllPreviousVariablesPath(
@ -698,8 +695,6 @@ export function moveValueIntoNewVariablePath(
)
let _node = JSON.parse(JSON.stringify(ast))
const boop = replacer(_node, variableName)
if (trap(boop)) return { modifiedAst: ast }
_node = boop.modifiedAst
_node.body.splice(
insertIndex,
@ -718,9 +713,7 @@ export function moveValueIntoNewVariable(
modifiedAst: Program
pathToReplacedNode?: PathToNode
} {
const meta = isNodeSafeToReplace(ast, sourceRange)
if (trap(meta)) return { modifiedAst: ast }
const { isSafe, value, replacer } = meta
const { isSafe, value, replacer } = isNodeSafeToReplace(ast, sourceRange)
if (!isSafe || value.type === 'Identifier') return { modifiedAst: ast }
const { insertIndex } = findAllPreviousVariables(
@ -729,10 +722,7 @@ export function moveValueIntoNewVariable(
sourceRange
)
let _node = JSON.parse(JSON.stringify(ast))
const replaced = replacer(_node, variableName)
if (trap(replaced)) return { modifiedAst: ast }
const { modifiedAst, pathToReplaced } = replaced
const { modifiedAst, pathToReplaced } = replacer(_node, variableName)
_node = modifiedAst
_node.body.splice(
insertIndex,
@ -752,7 +742,7 @@ export function deleteSegmentFromPipeExpression(
programMemory: ProgramMemory,
code: string,
pathToNode: PathToNode
): Program | Error {
): Program {
let _modifiedAst: Program = JSON.parse(JSON.stringify(modifiedAst))
dependentRanges.forEach((range) => {
@ -764,13 +754,10 @@ export function deleteSegmentFromPipeExpression(
'CallExpression',
true
)
if (err(callExp)) return callExp
const constraintInfo = getConstraintInfo(callExp.node, code, path).find(
({ sourceRange }) => isOverlap(sourceRange, range)
)
if (!constraintInfo) return
const input = makeRemoveSingleConstraintInput(
constraintInfo.argPosition,
callExp.shallowPath
@ -791,17 +778,13 @@ export function deleteSegmentFromPipeExpression(
_modifiedAst,
pathToNode,
'PipeExpression'
)
if (err(pipeExpression)) return pipeExpression
).node
const pipeInPathIndex = pathToNode.findIndex(
([_, desc]) => desc === 'PipeExpression'
)
const segmentIndexInPipe = pathToNode[pipeInPathIndex + 1]
pipeExpression.node.body.splice(segmentIndexInPipe[0] as number, 1)
// Move up to the next segment.
segmentIndexInPipe[0] = Math.max((segmentIndexInPipe[0] as number) - 1, 0)
const segmentIndexInPipe = pathToNode[pipeInPathIndex + 1][0] as number
pipeExpression.body.splice(segmentIndexInPipe, 1)
return _modifiedAst
}
@ -852,13 +835,11 @@ export function removeSingleConstraintInfo(
ast,
})
if (!transform) return false
const retval = transformAstSketchLines({
return transformAstSketchLines({
ast,
selectionRanges: [pathToCallExp],
transformInfos: [transform],
programMemory,
referenceSegName: '',
})
if (err(retval)) return false
return retval
}

View File

@ -17,7 +17,6 @@ import {
createLiteral,
createPipeSubstitution,
} from './modifyAst'
import { err } from 'lib/trap'
beforeAll(async () => {
await initPromise
@ -43,7 +42,6 @@ const variableBelowShouldNotBeIncluded = 3
`
const rangeStart = code.indexOf('// selection-range-7ish-before-this') - 7
const ast = parse(code)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const { variables, bodyPath, insertIndex } = findAllPreviousVariables(
@ -78,65 +76,53 @@ const yo = 5 + 6
const yo2 = hmm([identifierGuy + 5])`
it('find a safe binaryExpression', () => {
const ast = parse(code)
if (err(ast)) throw ast
const rangeStart = code.indexOf('100 + 100') + 2
const result = isNodeSafeToReplace(ast, [rangeStart, rangeStart])
if (err(result)) throw result
expect(result.isSafe).toBe(true)
expect(result.value?.type).toBe('BinaryExpression')
expect(code.slice(result.value.start, result.value.end)).toBe('100 + 100')
const replaced = result.replacer(
const { modifiedAst } = result.replacer(
JSON.parse(JSON.stringify(ast)),
'replaceName'
)
if (err(replaced)) throw replaced
const outCode = recast(replaced.modifiedAst)
const outCode = recast(modifiedAst)
expect(outCode).toContain(`angledLine([replaceName, 3.09], %)`)
})
it('find a safe Identifier', () => {
const ast = parse(code)
if (err(ast)) throw ast
const rangeStart = code.indexOf('abc')
const result = isNodeSafeToReplace(ast, [rangeStart, rangeStart])
if (err(result)) throw result
expect(result.isSafe).toBe(true)
expect(result.value?.type).toBe('Identifier')
expect(code.slice(result.value.start, result.value.end)).toBe('abc')
})
it('find a safe CallExpression', () => {
const ast = parse(code)
if (err(ast)) throw ast
const rangeStart = code.indexOf('def')
const result = isNodeSafeToReplace(ast, [rangeStart, rangeStart])
if (err(result)) throw result
expect(result.isSafe).toBe(true)
expect(result.value?.type).toBe('CallExpression')
expect(code.slice(result.value.start, result.value.end)).toBe("def('yo')")
const replaced = result.replacer(
const { modifiedAst } = result.replacer(
JSON.parse(JSON.stringify(ast)),
'replaceName'
)
if (err(replaced)) throw replaced
const outCode = recast(replaced.modifiedAst)
const outCode = recast(modifiedAst)
expect(outCode).toContain(`angledLine([replaceName, 3.09], %)`)
})
it('find an UNsafe CallExpression, as it has a PipeSubstitution', () => {
const ast = parse(code)
if (err(ast)) throw ast
const rangeStart = code.indexOf('ghi')
const range: [number, number] = [rangeStart, rangeStart]
const result = isNodeSafeToReplace(ast, range)
if (err(result)) throw result
expect(result.isSafe).toBe(false)
expect(result.value?.type).toBe('CallExpression')
expect(code.slice(result.value.start, result.value.end)).toBe('ghi(%)')
})
it('find an UNsafe Identifier, as it is a callee', () => {
const ast = parse(code)
if (err(ast)) throw ast
const rangeStart = code.indexOf('ine([2.8,')
const result = isNodeSafeToReplace(ast, [rangeStart, rangeStart])
if (err(result)) throw result
expect(result.isSafe).toBe(false)
expect(result.value?.type).toBe('CallExpression')
expect(code.slice(result.value.start, result.value.end)).toBe(
@ -145,60 +131,47 @@ const yo2 = hmm([identifierGuy + 5])`
})
it("find a safe BinaryExpression that's assigned to a variable", () => {
const ast = parse(code)
if (err(ast)) throw ast
const rangeStart = code.indexOf('5 + 6') + 1
const result = isNodeSafeToReplace(ast, [rangeStart, rangeStart])
if (err(result)) throw result
expect(result.isSafe).toBe(true)
expect(result.value?.type).toBe('BinaryExpression')
expect(code.slice(result.value.start, result.value.end)).toBe('5 + 6')
const replaced = result.replacer(
const { modifiedAst } = result.replacer(
JSON.parse(JSON.stringify(ast)),
'replaceName'
)
if (err(replaced)) throw replaced
const outCode = recast(replaced.modifiedAst)
const outCode = recast(modifiedAst)
expect(outCode).toContain(`const yo = replaceName`)
})
it('find a safe BinaryExpression that has a CallExpression within', () => {
const ast = parse(code)
if (err(ast)) throw ast
const rangeStart = code.indexOf('jkl') + 1
const result = isNodeSafeToReplace(ast, [rangeStart, rangeStart])
if (err(result)) throw result
expect(result.isSafe).toBe(true)
expect(result.value?.type).toBe('BinaryExpression')
expect(code.slice(result.value.start, result.value.end)).toBe(
"jkl('yo') + 2"
)
const replaced = result.replacer(
const { modifiedAst } = result.replacer(
JSON.parse(JSON.stringify(ast)),
'replaceName'
)
if (err(replaced)) throw replaced
const { modifiedAst } = replaced
const outCode = recast(modifiedAst)
expect(outCode).toContain(`angledLine([replaceName, 3.09], %)`)
})
it('find a safe BinaryExpression within a CallExpression', () => {
const ast = parse(code)
if (err(ast)) throw ast
const rangeStart = code.indexOf('identifierGuy') + 1
const result = isNodeSafeToReplace(ast, [rangeStart, rangeStart])
if (err(result)) throw result
expect(result.isSafe).toBe(true)
expect(result.value?.type).toBe('BinaryExpression')
expect(code.slice(result.value.start, result.value.end)).toBe(
'identifierGuy + 5'
)
const replaced = result.replacer(
const { modifiedAst } = result.replacer(
JSON.parse(JSON.stringify(ast)),
'replaceName'
)
if (err(replaced)) throw replaced
const { modifiedAst } = replaced
const outCode = recast(modifiedAst)
expect(outCode).toContain(`const yo2 = hmm([replaceName])`)
})
@ -236,8 +209,6 @@ describe('testing getNodePathFromSourceRange', () => {
const searchLn = `line([0.94, 2.61], %)`
const sourceIndex = code.indexOf(searchLn) + searchLn.length
const ast = parse(code)
if (err(ast)) throw ast
const result = getNodePathFromSourceRange(ast, [sourceIndex, sourceIndex])
expect(result).toEqual([
['body', ''],
@ -253,8 +224,6 @@ describe('testing getNodePathFromSourceRange', () => {
const searchLn = `line([-0.21, -1.4], %)`
const sourceIndex = code.indexOf(searchLn) + searchLn.length
const ast = parse(code)
if (err(ast)) throw ast
const result = getNodePathFromSourceRange(ast, [sourceIndex, sourceIndex])
const expected = [
['body', ''],
@ -293,8 +262,6 @@ const part001 = startSketchAt([-1.41, 3.46])
|> close(%)
`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const result = doesPipeHaveCallExp({
calleeName: 'close',
ast,
@ -313,8 +280,6 @@ const part001 = startSketchAt([-1.41, 3.46])
|> extrude(1, %)
`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const result = doesPipeHaveCallExp({
calleeName: 'extrude',
ast,
@ -331,8 +296,6 @@ const part001 = startSketchAt([-1.41, 3.46])
|> angledLine([-175, segLen('seg01', %)], %)
`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const result = doesPipeHaveCallExp({
calleeName: 'close',
ast,
@ -343,8 +306,6 @@ const part001 = startSketchAt([-1.41, 3.46])
it('returns false if not a pipe', () => {
const exampleCode = `const length001 = 2`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const result = doesPipeHaveCallExp({
calleeName: 'close',
ast,
@ -363,8 +324,6 @@ const part001 = startSketchAt([-1.41, 3.46])
|> line([-3.22, -7.36], %)
|> angledLine([-175, segLen('seg01', %)], %)`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const result = hasExtrudeSketchGroup({
ast,
@ -382,8 +341,6 @@ const part001 = startSketchAt([-1.41, 3.46])
|> angledLine([-175, segLen('seg01', %)], %)
|> extrude(1, %)`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const result = hasExtrudeSketchGroup({
ast,
@ -395,8 +352,6 @@ const part001 = startSketchAt([-1.41, 3.46])
it('finds nothing', async () => {
const exampleCode = `const length001 = 2`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const programMemory = await enginelessExecutor(ast)
const result = hasExtrudeSketchGroup({
ast,
@ -417,8 +372,6 @@ describe('Testing findUsesOfTagInPipe', () => {
|> angledLine([65, segLen('seg01', %)], %)`
it('finds the current segment', async () => {
const ast = parse(exampleCode)
if (err(ast)) throw ast
const lineOfInterest = `198.85], %, 'seg01'`
const characterIndex =
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
@ -434,8 +387,6 @@ describe('Testing findUsesOfTagInPipe', () => {
})
it('find no tag if line has no tag', () => {
const ast = parse(exampleCode)
if (err(ast)) throw ast
const lineOfInterest = `line([306.21, 198.82], %)`
const characterIndex =
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
@ -472,7 +423,6 @@ const sketch002 = startSketchOn(extrude001, 'seg01')
`
it('finds sketch001 pipe to be extruded', async () => {
const ast = parse(exampleCode)
if (err(ast)) throw ast
const lineOfInterest = `line([4.99, -0.46], %, 'seg01')`
const characterIndex =
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
@ -487,7 +437,6 @@ const sketch002 = startSketchOn(extrude001, 'seg01')
})
it('find sketch002 NOT pipe to be extruded', async () => {
const ast = parse(exampleCode)
if (err(ast)) throw ast
const lineOfInterest = `line([2.45, -0.2], %)`
const characterIndex =
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
@ -519,7 +468,6 @@ const sketch002 = startSketchOn(extrude001, 'seg01')
|> close(%)
`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const extrudable = hasExtrudableGeometry(ast)
expect(extrudable).toBeTruthy()
})
@ -533,7 +481,6 @@ const sketch002 = startSketchOn(extrude001, 'seg01')
const extrude001 = extrude(10, sketch001)
`
const ast = parse(exampleCode)
if (err(ast)) throw ast
const extrudable = hasExtrudableGeometry(ast)
expect(extrudable).toBeFalsy()
})

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