Compare commits
41 Commits
try-16-cor
...
v0.22.6
Author | SHA1 | Date | |
---|---|---|---|
cd33b40c37 | |||
3300772e3d | |||
fa37752a41 | |||
34c5c153c8 | |||
3f343698a8 | |||
0bd9f42e17 | |||
aad29fca9f | |||
a8c1a14d48 | |||
8194f8b70b | |||
03e4f457d4 | |||
226ed37c5f | |||
0f3f923019 | |||
bf8fb0d127 | |||
4a275c2ff7 | |||
baf5509f1d | |||
47a5e1f6d3 | |||
d85211c5a4 | |||
1beb6b5186 | |||
17978ab1d7 | |||
a1bcad9dfb | |||
2e7bdf02cf | |||
6f76196b72 | |||
e7af064518 | |||
674d49e2ae | |||
4cb48674c6 | |||
82daec2aff | |||
f1ef9d5200 | |||
dc226d3270 | |||
7bf50d8fe0 | |||
b26764bc9a | |||
1b0c6298d7 | |||
fe9a483726 | |||
bd42ea037b | |||
fdb1b21af3 | |||
630ef316b8 | |||
e322926be9 | |||
a9e61da8b5 | |||
e2a835a437 | |||
c61273085f | |||
a79e365c0f | |||
2386ba24e5 |
40
.github/workflows/cargo-check.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- '**.rs'
|
||||||
|
- .github/workflows/cargo-check.yml
|
||||||
|
pull_request:
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
name: cargo check
|
||||||
|
jobs:
|
||||||
|
cargocheck:
|
||||||
|
name: cargo check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
dir: ['src/wasm-lib']
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install latest rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Rust Cache
|
||||||
|
uses: Swatinem/rust-cache@v2.6.1
|
||||||
|
|
||||||
|
- name: Run check
|
||||||
|
run: |
|
||||||
|
cd "${{ matrix.dir }}"
|
||||||
|
# We specifically want to test the disable-println feature
|
||||||
|
# Since it is not enabled by default, we need to specify it
|
||||||
|
# This is used in kcl-lsp
|
||||||
|
cargo check --all --features disable-println --features pyo3
|
6
.github/workflows/cargo-clippy.yml
vendored
@ -9,6 +9,12 @@ on:
|
|||||||
- '**.rs'
|
- '**.rs'
|
||||||
- .github/workflows/cargo-clippy.yml
|
- .github/workflows/cargo-clippy.yml
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- '**.rs'
|
||||||
|
- .github/workflows/cargo-clippy.yml
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
8
.github/workflows/playwright.yml
vendored
@ -57,7 +57,7 @@ jobs:
|
|||||||
- name: Download Wasm Cache
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||||
uses: dawidd6/action-download-artifact@v5
|
uses: dawidd6/action-download-artifact@v6
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||||
@ -133,7 +133,7 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: playwright-report
|
name: playwright-report-ubuntu
|
||||||
path: playwright-report/
|
path: playwright-report/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ jobs:
|
|||||||
- name: Download Wasm Cache
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||||
uses: dawidd6/action-download-artifact@v5
|
uses: dawidd6/action-download-artifact@v6
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||||
@ -204,6 +204,6 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: playwright-report
|
name: playwright-report-macos
|
||||||
path: playwright-report/
|
path: playwright-report/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
@ -319,7 +319,7 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
|
|||||||
|
|
||||||
```
|
```
|
||||||
yarn install
|
yarn install
|
||||||
yarn build:wasm
|
yarn build:wasm-dev
|
||||||
cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
||||||
yarn vite build --mode development
|
yarn vite build --mode development
|
||||||
yarn tauri build --debug -b
|
yarn tauri build --debug -b
|
||||||
|
@ -17,4 +17,11 @@ once fixed in engine will just start working here with no language changes.
|
|||||||
currently move or transform the imported objects at all, once we have assemblies
|
currently move or transform the imported objects at all, once we have assemblies
|
||||||
this will work.
|
this will work.
|
||||||
|
|
||||||
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet cases work currently.
|
- **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.
|
||||||
|
|
||||||
|
- **Shell**: Shell is only working for `end` faces, not for `side` or `start`
|
||||||
|
faces. We are tracking the engine side bug on this.
|
||||||
|
@ -36,8 +36,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -73,8 +71,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -101,10 +97,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -179,24 +171,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -37,8 +37,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -74,8 +72,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -102,10 +98,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -180,24 +172,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -43,8 +43,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -80,8 +78,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -108,10 +104,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -186,24 +178,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -213,8 +187,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -250,8 +222,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -278,10 +248,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -356,24 +322,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -42,8 +42,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -79,8 +77,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -107,10 +103,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -185,24 +177,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -212,8 +186,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -249,8 +221,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -277,10 +247,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -355,24 +321,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -81,8 +79,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -109,10 +105,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -187,24 +179,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -214,8 +188,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -251,8 +223,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -279,10 +249,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -357,24 +323,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -48,8 +48,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -85,8 +83,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -113,10 +109,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -191,24 +183,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -218,8 +192,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -255,8 +227,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -283,10 +253,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -361,24 +327,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -41,8 +41,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -78,8 +76,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -106,10 +102,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -184,24 +176,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -211,8 +185,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -248,8 +220,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -276,10 +246,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -354,24 +320,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -41,8 +41,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -78,8 +76,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -106,10 +102,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -184,24 +176,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -211,8 +185,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -248,8 +220,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -276,10 +246,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -354,24 +320,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -52,8 +52,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -89,8 +87,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -117,10 +113,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -195,24 +187,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -222,8 +196,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -259,8 +231,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -287,10 +257,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -365,24 +331,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -47,8 +47,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -84,8 +82,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -112,10 +108,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -190,24 +182,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -217,8 +191,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -254,8 +226,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -282,10 +252,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -360,24 +326,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ chamfer(data: ChamferData, extrude_group: ExtrudeGroup) -> ExtrudeGroup
|
|||||||
const width = 20
|
const width = 20
|
||||||
const length = 10
|
const length = 10
|
||||||
const thickness = 1
|
const thickness = 1
|
||||||
const chamferRadius = 2
|
const chamferLength = 2
|
||||||
|
|
||||||
const mountingPlateSketch = startSketchOn("XY")
|
const mountingPlateSketch = startSketchOn("XY")
|
||||||
|> startProfileAt([-width / 2, -length / 2], %)
|
|> startProfileAt([-width / 2, -length / 2], %)
|
||||||
@ -29,7 +29,7 @@ const mountingPlateSketch = startSketchOn("XY")
|
|||||||
|
|
||||||
const mountingPlate = extrude(thickness, mountingPlateSketch)
|
const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||||
|> chamfer({
|
|> chamfer({
|
||||||
radius: chamferRadius,
|
length: chamferLength,
|
||||||
tags: [
|
tags: [
|
||||||
getNextAdjacentEdge('edge1', %),
|
getNextAdjacentEdge('edge1', %),
|
||||||
getNextAdjacentEdge('edge2', %),
|
getNextAdjacentEdge('edge2', %),
|
||||||
@ -46,8 +46,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
|||||||
* `data`: `ChamferData` - Data for chamfers. (REQUIRED)
|
* `data`: `ChamferData` - Data for chamfers. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The radius of the chamfer.
|
// The length of the chamfer.
|
||||||
radius: number,
|
length: number,
|
||||||
// The tags of the paths you want to chamfer.
|
// The tags of the paths you want to chamfer.
|
||||||
tags: [uuid |
|
tags: [uuid |
|
||||||
string],
|
string],
|
||||||
@ -62,12 +62,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -131,6 +199,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -141,10 +210,6 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -156,32 +221,10 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -196,12 +239,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -265,6 +376,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -275,10 +387,6 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -290,32 +398,10 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -76,8 +76,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -105,8 +103,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -142,8 +138,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -170,10 +164,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -248,24 +238,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -274,8 +246,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -311,8 +281,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -339,10 +307,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -417,24 +381,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -42,8 +42,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -79,8 +77,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -107,10 +103,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -185,24 +177,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -212,8 +186,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -249,8 +221,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -277,10 +247,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -355,24 +321,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -67,8 +67,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -104,8 +102,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -132,10 +128,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -211,24 +203,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "sketchGroups",
|
type: "sketchGroups",
|
||||||
@ -246,12 +220,80 @@ const example = extrude(10, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -315,6 +357,7 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
type: "extrudeGroup",
|
type: "extrudeGroup",
|
||||||
@ -326,10 +369,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -341,32 +380,10 @@ const example = extrude(10, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "extrudeGroups",
|
type: "extrudeGroups",
|
||||||
|
@ -62,12 +62,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -131,6 +199,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -141,10 +210,6 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -156,32 +221,10 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -196,12 +239,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -265,6 +376,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -275,10 +387,6 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -290,32 +398,10 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -49,12 +49,80 @@ const revolution = startSketchOn(box, "revolveAxis")
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -118,6 +186,7 @@ const revolution = startSketchOn(box, "revolveAxis")
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -128,10 +197,6 @@ const revolution = startSketchOn(box, "revolveAxis")
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -143,32 +208,10 @@ const revolution = startSketchOn(box, "revolveAxis")
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -47,12 +47,80 @@ const example = extrude(5, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -116,6 +184,7 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -126,10 +195,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -141,32 +206,10 @@ const example = extrude(5, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -45,12 +45,80 @@ const example = extrude(5, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -114,6 +182,7 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -124,10 +193,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -139,32 +204,10 @@ const example = extrude(5, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -47,12 +47,80 @@ const example = extrude(5, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -116,6 +184,7 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -126,10 +195,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -141,32 +206,10 @@ const example = extrude(5, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -52,12 +52,80 @@ const part001 = startSketchOn('XY')
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -121,6 +189,7 @@ const part001 = startSketchOn('XY')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -131,10 +200,6 @@ const part001 = startSketchOn('XY')
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -146,32 +211,10 @@ const part001 = startSketchOn('XY')
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -186,12 +229,80 @@ const part001 = startSketchOn('XY')
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -255,6 +366,7 @@ const part001 = startSketchOn('XY')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -265,10 +377,6 @@ const part001 = startSketchOn('XY')
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -280,32 +388,10 @@ const part001 = startSketchOn('XY')
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -53,8 +53,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -90,8 +88,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -118,10 +114,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -197,24 +189,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "sketchGroups",
|
type: "sketchGroups",
|
||||||
@ -223,8 +197,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -260,8 +232,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -288,10 +258,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -366,24 +332,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -392,8 +340,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -429,8 +375,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -457,10 +401,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -535,24 +475,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -70,8 +68,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -98,10 +94,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -176,24 +168,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -70,8 +68,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -98,10 +94,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -176,24 +168,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -46,8 +46,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -83,8 +81,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -111,10 +107,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -189,24 +181,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -216,8 +190,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -253,8 +225,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -281,10 +251,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -359,24 +325,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -70,8 +68,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -98,10 +94,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -176,24 +168,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -203,8 +177,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -240,8 +212,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -268,10 +238,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -346,24 +312,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -51,8 +51,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -88,8 +86,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -116,10 +112,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -195,24 +187,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "sketchGroups",
|
type: "sketchGroups",
|
||||||
|
@ -56,12 +56,80 @@ const example = extrude(-5, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -125,6 +193,7 @@ const example = extrude(-5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
type: "extrudeGroup",
|
type: "extrudeGroup",
|
||||||
@ -136,10 +205,6 @@ const example = extrude(-5, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -151,32 +216,10 @@ const example = extrude(-5, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "extrudeGroups",
|
type: "extrudeGroups",
|
||||||
|
@ -44,8 +44,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -81,8 +79,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -109,10 +105,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -188,24 +180,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "sketchGroups",
|
type: "sketchGroups",
|
||||||
|
@ -54,12 +54,80 @@ const example = extrude(1, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -123,6 +191,7 @@ const example = extrude(1, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
type: "extrudeGroup",
|
type: "extrudeGroup",
|
||||||
@ -134,10 +203,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -149,32 +214,10 @@ const example = extrude(1, exampleSketch)
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "extrudeGroups",
|
type: "extrudeGroups",
|
||||||
|
@ -34,8 +34,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -71,8 +69,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -99,10 +95,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -177,24 +169,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,8 +29,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -66,8 +64,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -94,10 +90,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -172,24 +164,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -28,8 +28,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -65,8 +63,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -93,10 +89,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -171,24 +163,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -162,8 +162,6 @@ string,
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -199,8 +197,6 @@ string,
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -227,10 +223,6 @@ string,
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -305,24 +297,6 @@ string,
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -337,12 +311,80 @@ string,
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -406,6 +448,7 @@ string,
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -416,10 +459,6 @@ string,
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -431,32 +470,10 @@ string,
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,8 +36,6 @@ const example = extrude(4, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -73,8 +71,6 @@ const example = extrude(4, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -101,10 +97,6 @@ const example = extrude(4, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -179,24 +171,6 @@ const example = extrude(4, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -34,8 +34,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -71,8 +69,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -99,10 +95,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -177,24 +169,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -35,8 +35,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -72,8 +70,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -100,10 +96,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -178,24 +170,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,8 +36,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -73,8 +71,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -101,10 +97,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -179,24 +171,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -50,12 +50,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -119,6 +187,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -129,10 +198,6 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -144,32 +209,10 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -184,12 +227,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -253,6 +364,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -263,10 +375,6 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -278,32 +386,10 @@ string],
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -90,8 +90,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -126,8 +124,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -163,8 +159,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -191,10 +185,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -269,24 +259,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -59,8 +59,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -96,8 +94,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -124,10 +120,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -202,24 +194,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -167,12 +167,80 @@ const a1 = startSketchOn({
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The position of the extrude group.
|
// The sketch group.
|
||||||
position: [number, number, number],
|
sketchGroup: {
|
||||||
// The rotation of the extrude group.
|
// The id of the sketch group.
|
||||||
rotation: [number, number, number, number],
|
id: uuid,
|
||||||
// The sketch group paths.
|
// What the sketch is on (can be a plane or a face).
|
||||||
sketchGroupValues: [{
|
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 plane’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the plane’s Y axis be?
|
||||||
|
yAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// The z-axis (normal).
|
||||||
|
zAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
} |
|
||||||
|
{
|
||||||
|
// 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,
|
||||||
|
// What should the face’s X axis be?
|
||||||
|
xAxis: {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
z: number,
|
||||||
|
},
|
||||||
|
// What should the face’s 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 name of the path.
|
||||||
|
name: string,
|
||||||
|
// The to point.
|
||||||
|
to: [number, number],
|
||||||
|
},
|
||||||
|
// The paths in the sketch group.
|
||||||
|
value: [{
|
||||||
// The from point.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -236,6 +304,7 @@ const a1 = startSketchOn({
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -246,10 +315,6 @@ const a1 = startSketchOn({
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudePlane",
|
type: "extrudePlane",
|
||||||
@ -261,32 +326,10 @@ const a1 = startSketchOn({
|
|||||||
id: uuid,
|
id: uuid,
|
||||||
// The name.
|
// The name.
|
||||||
name: string,
|
name: string,
|
||||||
// The position.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The source range.
|
// The source range.
|
||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
|
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
|
||||||
@ -331,8 +374,6 @@ string
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
|
50076
docs/kcl/std.json
@ -42,8 +42,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -79,8 +77,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -107,10 +103,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -185,24 +177,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -212,8 +186,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -249,8 +221,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -277,10 +247,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -355,24 +321,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -70,8 +68,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -98,10 +94,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -176,24 +168,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -203,8 +177,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -240,8 +212,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -268,10 +238,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -346,24 +312,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,8 +36,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -73,8 +71,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -101,10 +97,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -179,24 +171,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -206,8 +180,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -243,8 +215,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -271,10 +241,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -349,24 +315,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,8 +36,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -73,8 +71,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -101,10 +97,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -179,24 +171,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -206,8 +180,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -243,8 +215,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -271,10 +241,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -349,24 +315,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -34,8 +34,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -71,8 +69,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -99,10 +95,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -177,24 +169,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -204,8 +178,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -241,8 +213,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -269,10 +239,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -347,24 +313,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -32,8 +32,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -69,8 +67,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -97,10 +93,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -175,24 +167,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String` (OPTIONAL)
|
* `tag`: `String` (OPTIONAL)
|
||||||
@ -202,8 +176,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
`SketchGroup` - A sketch group is a collection of paths.
|
`SketchGroup` - A sketch group is a collection of paths.
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
|
||||||
entityId: uuid,
|
|
||||||
// The id of the sketch group.
|
// The id of the sketch group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// What the sketch is on (can be a plane or a face).
|
// What the sketch is on (can be a plane or a face).
|
||||||
@ -239,8 +211,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
// the face id the sketch is on
|
|
||||||
faceId: uuid,
|
|
||||||
// The id of the face.
|
// The id of the face.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The original sketch group id of the object we are sketching on.
|
// The original sketch group id of the object we are sketching on.
|
||||||
@ -267,10 +237,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
z: number,
|
z: number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// The position of the sketch group.
|
|
||||||
position: [number, number, number],
|
|
||||||
// The rotation of the sketch group base plane.
|
|
||||||
rotation: [number, number, number, number],
|
|
||||||
// The starting path.
|
// The starting path.
|
||||||
start: {
|
start: {
|
||||||
// The from point.
|
// The from point.
|
||||||
@ -345,24 +311,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the sketch group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the sketch group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the sketch group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 43 KiB |
@ -1,5 +1,6 @@
|
|||||||
import { SaveSettingsPayload } from 'lib/settings/settingsTypes'
|
import { SaveSettingsPayload } from 'lib/settings/settingsTypes'
|
||||||
import { Themes } from 'lib/theme'
|
import { Themes } from 'lib/theme'
|
||||||
|
import { onboardingPaths } from 'routes/Onboarding/paths'
|
||||||
|
|
||||||
export const TEST_SETTINGS_KEY = '/settings.toml'
|
export const TEST_SETTINGS_KEY = '/settings.toml'
|
||||||
export const TEST_SETTINGS = {
|
export const TEST_SETTINGS = {
|
||||||
@ -22,9 +23,22 @@ export const TEST_SETTINGS = {
|
|||||||
},
|
},
|
||||||
} satisfies Partial<SaveSettingsPayload>
|
} satisfies Partial<SaveSettingsPayload>
|
||||||
|
|
||||||
|
export const TEST_SETTINGS_ONBOARDING_USER_MENU = {
|
||||||
|
...TEST_SETTINGS,
|
||||||
|
app: { ...TEST_SETTINGS.app, onboardingStatus: onboardingPaths.USER_MENU },
|
||||||
|
} satisfies Partial<SaveSettingsPayload>
|
||||||
|
|
||||||
export const TEST_SETTINGS_ONBOARDING_EXPORT = {
|
export const TEST_SETTINGS_ONBOARDING_EXPORT = {
|
||||||
...TEST_SETTINGS,
|
...TEST_SETTINGS,
|
||||||
app: { ...TEST_SETTINGS.app, onboardingStatus: '/export' },
|
app: { ...TEST_SETTINGS.app, onboardingStatus: onboardingPaths.EXPORT },
|
||||||
|
} satisfies Partial<SaveSettingsPayload>
|
||||||
|
|
||||||
|
export const TEST_SETTINGS_ONBOARDING_PARAMETRIC_MODELING = {
|
||||||
|
...TEST_SETTINGS,
|
||||||
|
app: {
|
||||||
|
...TEST_SETTINGS.app,
|
||||||
|
onboardingStatus: onboardingPaths.PARAMETRIC_MODELING,
|
||||||
|
},
|
||||||
} satisfies Partial<SaveSettingsPayload>
|
} satisfies Partial<SaveSettingsPayload>
|
||||||
|
|
||||||
export const TEST_SETTINGS_ONBOARDING_START = {
|
export const TEST_SETTINGS_ONBOARDING_START = {
|
||||||
|
@ -8,6 +8,13 @@ import { Protocol } from 'playwright-core/types/protocol'
|
|||||||
import type { Models } from '@kittycad/lib'
|
import type { Models } from '@kittycad/lib'
|
||||||
import { APP_NAME } from 'lib/constants'
|
import { APP_NAME } from 'lib/constants'
|
||||||
|
|
||||||
|
type TestColor = [number, number, number]
|
||||||
|
export const TEST_COLORS = {
|
||||||
|
WHITE: [249, 249, 249] as TestColor,
|
||||||
|
YELLOW: [255, 255, 0] as TestColor,
|
||||||
|
BLUE: [0, 0, 255] as TestColor,
|
||||||
|
} as const
|
||||||
|
|
||||||
async function waitForPageLoad(page: Page) {
|
async function waitForPageLoad(page: Page) {
|
||||||
// wait for 'Loading stream...' spinner
|
// wait for 'Loading stream...' spinner
|
||||||
await page.getByTestId('loading-stream').waitFor()
|
await page.getByTestId('loading-stream').waitFor()
|
||||||
|
@ -2,6 +2,7 @@ import { browser, $, expect } from '@wdio/globals'
|
|||||||
import fs from 'fs/promises'
|
import fs from 'fs/promises'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import os from 'os'
|
import os from 'os'
|
||||||
|
import { click, setDatasetValue } from '../utils'
|
||||||
|
|
||||||
const isWin32 = os.platform() === 'win32'
|
const isWin32 = os.platform() === 'win32'
|
||||||
const documentsDir = path.join(os.homedir(), 'Documents')
|
const documentsDir = path.join(os.homedir(), 'Documents')
|
||||||
@ -15,25 +16,8 @@ const newProjectDir = path.join(documentsDir, 'a-different-directory')
|
|||||||
const tmp = process.env.TEMP || '/tmp'
|
const tmp = process.env.TEMP || '/tmp'
|
||||||
const userCodeDir = path.join(tmp, 'kittycad_user_code')
|
const userCodeDir = path.join(tmp, 'kittycad_user_code')
|
||||||
|
|
||||||
async function click(element: WebdriverIO.Element): Promise<void> {
|
describe('ZMA sign in flow', () => {
|
||||||
// Workaround for .click(), see https://github.com/tauri-apps/tauri/issues/6541
|
before(async () => {
|
||||||
await element.waitForClickable()
|
|
||||||
await browser.execute('arguments[0].click();', element)
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Shoutout to @Sheap on Github for a great workaround utility:
|
|
||||||
* https://github.com/tauri-apps/tauri/issues/6541#issue-1638944060
|
|
||||||
*/
|
|
||||||
async function setDatasetValue(
|
|
||||||
field: WebdriverIO.Element,
|
|
||||||
property: string,
|
|
||||||
value: string
|
|
||||||
) {
|
|
||||||
await browser.execute(`arguments[0].dataset.${property} = "${value}"`, field)
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('ZMA (Tauri)', () => {
|
|
||||||
it('opens the auth page and signs in', async () => {
|
|
||||||
// Clean up filesystem from previous tests
|
// Clean up filesystem from previous tests
|
||||||
await new Promise((resolve) => setTimeout(resolve, 100))
|
await new Promise((resolve) => setTimeout(resolve, 100))
|
||||||
await fs.rm(defaultProjectDir, { force: true, recursive: true })
|
await fs.rm(defaultProjectDir, { force: true, recursive: true })
|
||||||
@ -42,7 +26,9 @@ describe('ZMA (Tauri)', () => {
|
|||||||
await fs.rm(userSettingsDir, { force: true, recursive: true })
|
await fs.rm(userSettingsDir, { force: true, recursive: true })
|
||||||
await fs.mkdir(defaultProjectDir, { recursive: true })
|
await fs.mkdir(defaultProjectDir, { recursive: true })
|
||||||
await fs.mkdir(newProjectDir, { recursive: true })
|
await fs.mkdir(newProjectDir, { recursive: true })
|
||||||
|
})
|
||||||
|
|
||||||
|
it('opens the auth page and signs in', async () => {
|
||||||
const signInButton = await $('[data-testid="sign-in-button"]')
|
const signInButton = await $('[data-testid="sign-in-button"]')
|
||||||
expect(await signInButton.getText()).toEqual('Sign in')
|
expect(await signInButton.getText()).toEqual('Sign in')
|
||||||
|
|
||||||
@ -82,6 +68,10 @@ describe('ZMA (Tauri)', () => {
|
|||||||
const newFileButton = await $('[data-testid="home-new-file"]')
|
const newFileButton = await $('[data-testid="home-new-file"]')
|
||||||
expect(await newFileButton.getText()).toEqual('New project')
|
expect(await newFileButton.getText()).toEqual('New project')
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('ZMA authorized user flows', () => {
|
||||||
|
// Note: each flow below is intended to start *and* end from the home page
|
||||||
|
|
||||||
it('opens the settings page, checks filesystem settings, and closes the settings page', async () => {
|
it('opens the settings page, checks filesystem settings, and closes the settings page', async () => {
|
||||||
const menuButton = await $('[data-testid="user-sidebar-toggle"]')
|
const menuButton = await $('[data-testid="user-sidebar-toggle"]')
|
||||||
@ -150,7 +140,9 @@ describe('ZMA (Tauri)', () => {
|
|||||||
const base = isWin32 ? 'http://tauri.localhost' : 'tauri://localhost'
|
const base = isWin32 ? 'http://tauri.localhost' : 'tauri://localhost'
|
||||||
await browser.execute(`window.location.href = "${base}/home"`)
|
await browser.execute(`window.location.href = "${base}/home"`)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('ZMA sign out flow', () => {
|
||||||
it('signs out', async () => {
|
it('signs out', async () => {
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000))
|
await new Promise((resolve) => setTimeout(resolve, 1000))
|
||||||
const menuButton = await $('[data-testid="user-sidebar-toggle"]')
|
const menuButton = await $('[data-testid="user-sidebar-toggle"]')
|
18
e2e/tauri/utils.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { browser } from '@wdio/globals'
|
||||||
|
|
||||||
|
export async function click(element: WebdriverIO.Element): Promise<void> {
|
||||||
|
// Workaround for .click(), see https://github.com/tauri-apps/tauri/issues/6541
|
||||||
|
await element.waitForClickable()
|
||||||
|
await browser.execute('arguments[0].click();', element)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Shoutout to @Sheap on Github for a great workaround utility:
|
||||||
|
* https://github.com/tauri-apps/tauri/issues/6541#issue-1638944060
|
||||||
|
*/
|
||||||
|
export async function setDatasetValue(
|
||||||
|
field: WebdriverIO.Element,
|
||||||
|
property: string,
|
||||||
|
value: string
|
||||||
|
) {
|
||||||
|
await browser.execute(`arguments[0].dataset.${property} = "${value}"`, field)
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "untitled-app",
|
"name": "untitled-app",
|
||||||
"version": "0.22.2",
|
"version": "0.22.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "^6.16.0",
|
"@codemirror/autocomplete": "^6.16.0",
|
||||||
|
1722
src-tauri/Cargo.lock
generated
@ -20,7 +20,7 @@ kittycad = "0.3.5"
|
|||||||
log = "0.4.21"
|
log = "0.4.21"
|
||||||
oauth2 = "4.4.2"
|
oauth2 = "4.4.2"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
tauri = { version = "2.0.0-beta.22", features = [ "devtools", "unstable"] }
|
tauri = { version = "2.0.0-beta.15", features = [ "devtools", "unstable"] }
|
||||||
tauri-plugin-cli = { version = "2.0.0-beta.3" }
|
tauri-plugin-cli = { version = "2.0.0-beta.3" }
|
||||||
tauri-plugin-deep-link = { version = "2.0.0-beta.3" }
|
tauri-plugin-deep-link = { version = "2.0.0-beta.3" }
|
||||||
tauri-plugin-dialog = { version = "2.0.0-beta.6" }
|
tauri-plugin-dialog = { version = "2.0.0-beta.6" }
|
||||||
|
@ -63,17 +63,16 @@
|
|||||||
"subcommands": {}
|
"subcommands": {}
|
||||||
},
|
},
|
||||||
"deep-link": {
|
"deep-link": {
|
||||||
"mobile": [],
|
"domains": [
|
||||||
"desktop": {
|
{
|
||||||
"schemes": [
|
"host": "app.zoo.dev"
|
||||||
"app.zoo.dev"
|
}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"shell": {
|
"shell": {
|
||||||
"open": true
|
"open": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"productName": "Zoo Modeling App",
|
"productName": "Zoo Modeling App",
|
||||||
"version": "0.22.2"
|
"version": "0.22.6"
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,7 @@ import {
|
|||||||
SKETCH_GROUP_SEGMENTS,
|
SKETCH_GROUP_SEGMENTS,
|
||||||
SKETCH_LAYER,
|
SKETCH_LAYER,
|
||||||
X_AXIS,
|
X_AXIS,
|
||||||
XZ_PLANE,
|
|
||||||
Y_AXIS,
|
Y_AXIS,
|
||||||
YZ_PLANE,
|
|
||||||
} from './sceneInfra'
|
} from './sceneInfra'
|
||||||
import { isQuaternionVertical, quaternionFromUpNForward } from './helpers'
|
import { isQuaternionVertical, quaternionFromUpNForward } from './helpers'
|
||||||
import {
|
import {
|
||||||
@ -75,7 +73,7 @@ import {
|
|||||||
changeSketchArguments,
|
changeSketchArguments,
|
||||||
updateStartProfileAtArgs,
|
updateStartProfileAtArgs,
|
||||||
} from 'lang/std/sketch'
|
} from 'lang/std/sketch'
|
||||||
import { normaliseAngle, roundOff, throttle } from 'lib/utils'
|
import { isOverlap, normaliseAngle, roundOff, throttle } from 'lib/utils'
|
||||||
import {
|
import {
|
||||||
createArrayExpression,
|
createArrayExpression,
|
||||||
createCallExpressionStdLib,
|
createCallExpressionStdLib,
|
||||||
@ -85,6 +83,7 @@ import {
|
|||||||
findUniqueName,
|
findUniqueName,
|
||||||
} from 'lang/modifyAst'
|
} from 'lang/modifyAst'
|
||||||
import {
|
import {
|
||||||
|
Selections,
|
||||||
getEventForSegmentSelection,
|
getEventForSegmentSelection,
|
||||||
sendSelectEventToEngine,
|
sendSelectEventToEngine,
|
||||||
} from 'lib/selections'
|
} from 'lib/selections'
|
||||||
@ -302,6 +301,7 @@ export class SceneEntities {
|
|||||||
position,
|
position,
|
||||||
maybeModdedAst,
|
maybeModdedAst,
|
||||||
draftExpressionsIndices,
|
draftExpressionsIndices,
|
||||||
|
selectionRanges,
|
||||||
}: {
|
}: {
|
||||||
sketchPathToNode: PathToNode
|
sketchPathToNode: PathToNode
|
||||||
maybeModdedAst: Program
|
maybeModdedAst: Program
|
||||||
@ -309,6 +309,7 @@ export class SceneEntities {
|
|||||||
forward: [number, number, number]
|
forward: [number, number, number]
|
||||||
up: [number, number, number]
|
up: [number, number, number]
|
||||||
position?: [number, number, number]
|
position?: [number, number, number]
|
||||||
|
selectionRanges?: Selections
|
||||||
}): Promise<{
|
}): Promise<{
|
||||||
truncatedAst: Program
|
truncatedAst: Program
|
||||||
programMemoryOverride: ProgramMemory
|
programMemoryOverride: ProgramMemory
|
||||||
@ -345,11 +346,8 @@ export class SceneEntities {
|
|||||||
pathToNode: sketchPathToNode,
|
pathToNode: sketchPathToNode,
|
||||||
}
|
}
|
||||||
const dummy = new Mesh()
|
const dummy = new Mesh()
|
||||||
dummy.position.set(
|
// TODO: When we actually have sketch positions and rotations we can use them here.
|
||||||
sketchGroup.position[0],
|
dummy.position.set(0, 0, 0)
|
||||||
sketchGroup.position[1],
|
|
||||||
sketchGroup.position[2]
|
|
||||||
)
|
|
||||||
const orthoFactor = orthoScale(sceneInfra.camControls.camera)
|
const orthoFactor = orthoScale(sceneInfra.camControls.camera)
|
||||||
const factor =
|
const factor =
|
||||||
(sceneInfra.camControls.camera instanceof OrthographicCamera
|
(sceneInfra.camControls.camera instanceof OrthographicCamera
|
||||||
@ -401,6 +399,12 @@ export class SceneEntities {
|
|||||||
draftExpressionsIndices &&
|
draftExpressionsIndices &&
|
||||||
index <= draftExpressionsIndices.end &&
|
index <= draftExpressionsIndices.end &&
|
||||||
index >= draftExpressionsIndices.start
|
index >= draftExpressionsIndices.start
|
||||||
|
const isSelected = selectionRanges?.codeBasedSelections.some(
|
||||||
|
(selection) => {
|
||||||
|
return isOverlap(selection.range, segment.__geoMeta.sourceRange)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
let seg
|
let seg
|
||||||
const callExpName = getNodeFromPath<CallExpression>(
|
const callExpName = getNodeFromPath<CallExpression>(
|
||||||
maybeModdedAst,
|
maybeModdedAst,
|
||||||
@ -418,6 +422,7 @@ export class SceneEntities {
|
|||||||
scale: factor,
|
scale: factor,
|
||||||
texture: sceneInfra.extraSegmentTexture,
|
texture: sceneInfra.extraSegmentTexture,
|
||||||
theme: sceneInfra._theme,
|
theme: sceneInfra._theme,
|
||||||
|
isSelected,
|
||||||
})
|
})
|
||||||
callbacks.push(
|
callbacks.push(
|
||||||
this.updateTangentialArcToSegment({
|
this.updateTangentialArcToSegment({
|
||||||
@ -439,6 +444,7 @@ export class SceneEntities {
|
|||||||
callExpName,
|
callExpName,
|
||||||
texture: sceneInfra.extraSegmentTexture,
|
texture: sceneInfra.extraSegmentTexture,
|
||||||
theme: sceneInfra._theme,
|
theme: sceneInfra._theme,
|
||||||
|
isSelected,
|
||||||
})
|
})
|
||||||
callbacks.push(
|
callbacks.push(
|
||||||
this.updateStraightSegment({
|
this.updateStraightSegment({
|
||||||
@ -1393,13 +1399,13 @@ export class SceneEntities {
|
|||||||
},
|
},
|
||||||
onClick: async (args) => {
|
onClick: async (args) => {
|
||||||
const { streamDimensions } = useStore.getState()
|
const { streamDimensions } = useStore.getState()
|
||||||
const { entity_id, ...rest } = await sendSelectEventToEngine(
|
const { entity_id } = await sendSelectEventToEngine(
|
||||||
args?.mouseEvent,
|
args?.mouseEvent,
|
||||||
document.getElementById('video-stream') as HTMLVideoElement,
|
document.getElementById('video-stream') as HTMLVideoElement,
|
||||||
streamDimensions
|
streamDimensions
|
||||||
)
|
)
|
||||||
|
|
||||||
let _entity_id = entity_id
|
let _entity_id = entity_id
|
||||||
console.log('things', _entity_id, rest)
|
|
||||||
if (!_entity_id) return
|
if (!_entity_id) return
|
||||||
if (
|
if (
|
||||||
engineCommandManager.defaultPlanes?.xy === _entity_id ||
|
engineCommandManager.defaultPlanes?.xy === _entity_id ||
|
||||||
@ -1428,7 +1434,6 @@ export class SceneEntities {
|
|||||||
.sub(sceneInfra.camControls.target)
|
.sub(sceneInfra.camControls.target)
|
||||||
|
|
||||||
if (engineCommandManager.defaultPlanes?.xy === _entity_id) {
|
if (engineCommandManager.defaultPlanes?.xy === _entity_id) {
|
||||||
console.log('XY')
|
|
||||||
zAxis = [0, 0, 1]
|
zAxis = [0, 0, 1]
|
||||||
yAxis = [0, 1, 0]
|
yAxis = [0, 1, 0]
|
||||||
if (camVector.z < 0) {
|
if (camVector.z < 0) {
|
||||||
@ -1436,7 +1441,6 @@ export class SceneEntities {
|
|||||||
_entity_id = engineCommandManager.defaultPlanes?.negXy || ''
|
_entity_id = engineCommandManager.defaultPlanes?.negXy || ''
|
||||||
}
|
}
|
||||||
} else if (engineCommandManager.defaultPlanes?.yz === _entity_id) {
|
} else if (engineCommandManager.defaultPlanes?.yz === _entity_id) {
|
||||||
console.log('YZ')
|
|
||||||
zAxis = [1, 0, 0]
|
zAxis = [1, 0, 0]
|
||||||
yAxis = [0, 0, 1]
|
yAxis = [0, 0, 1]
|
||||||
if (camVector.x < 0) {
|
if (camVector.x < 0) {
|
||||||
@ -1444,7 +1448,6 @@ export class SceneEntities {
|
|||||||
_entity_id = engineCommandManager.defaultPlanes?.negYz || ''
|
_entity_id = engineCommandManager.defaultPlanes?.negYz || ''
|
||||||
}
|
}
|
||||||
} else if (engineCommandManager.defaultPlanes?.xz === _entity_id) {
|
} else if (engineCommandManager.defaultPlanes?.xz === _entity_id) {
|
||||||
console.log('XZ')
|
|
||||||
zAxis = [0, 1, 0]
|
zAxis = [0, 1, 0]
|
||||||
yAxis = [0, 0, 1]
|
yAxis = [0, 0, 1]
|
||||||
_entity_id = engineCommandManager.defaultPlanes?.negXz || ''
|
_entity_id = engineCommandManager.defaultPlanes?.negXz || ''
|
||||||
@ -1498,6 +1501,7 @@ export class SceneEntities {
|
|||||||
kclManager.ast,
|
kclManager.ast,
|
||||||
artifact.range
|
artifact.range
|
||||||
)
|
)
|
||||||
|
|
||||||
const extrudePathToNode = extrusions?.range
|
const extrudePathToNode = extrusions?.range
|
||||||
? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
|
? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
|
||||||
: []
|
: []
|
||||||
@ -1770,7 +1774,11 @@ export function sketchGroupFromPathToNode({
|
|||||||
pathToNode,
|
pathToNode,
|
||||||
'VariableDeclarator'
|
'VariableDeclarator'
|
||||||
).node
|
).node
|
||||||
return programMemory.root[varDec?.id?.name || ''] as SketchGroup
|
const result = programMemory.root[varDec?.id?.name || '']
|
||||||
|
if (result?.type === 'ExtrudeGroup') {
|
||||||
|
return result.sketchGroup
|
||||||
|
}
|
||||||
|
return result as SketchGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
function colorSegment(object: any, color: number) {
|
function colorSegment(object: any, color: number) {
|
||||||
@ -1806,7 +1814,7 @@ export function getSketchQuaternion(
|
|||||||
ast: kclManager.ast,
|
ast: kclManager.ast,
|
||||||
programMemory: kclManager.programMemory,
|
programMemory: kclManager.programMemory,
|
||||||
})
|
})
|
||||||
const zAxis = sketchGroup?.zAxis || sketchNormalBackUp
|
const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp
|
||||||
return getQuaternionFromZAxis(massageFormats(zAxis))
|
return getQuaternionFromZAxis(massageFormats(zAxis))
|
||||||
}
|
}
|
||||||
export async function getSketchOrientationDetails(
|
export async function getSketchOrientationDetails(
|
||||||
@ -1821,20 +1829,24 @@ export async function getSketchOrientationDetails(
|
|||||||
programMemory: kclManager.programMemory,
|
programMemory: kclManager.programMemory,
|
||||||
})
|
})
|
||||||
if (sketchGroup.on.type === 'plane') {
|
if (sketchGroup.on.type === 'plane') {
|
||||||
const zAxis = sketchGroup?.zAxis
|
const zAxis = sketchGroup?.on.zAxis
|
||||||
return {
|
return {
|
||||||
quat: getQuaternionFromZAxis(massageFormats(zAxis)),
|
quat: getQuaternionFromZAxis(massageFormats(zAxis)),
|
||||||
sketchDetails: {
|
sketchDetails: {
|
||||||
sketchPathToNode,
|
sketchPathToNode,
|
||||||
zAxis: [zAxis.x, zAxis.y, zAxis.z],
|
zAxis: [zAxis.x, zAxis.y, zAxis.z],
|
||||||
yAxis: [sketchGroup.yAxis.x, sketchGroup.yAxis.y, sketchGroup.yAxis.z],
|
yAxis: [
|
||||||
|
sketchGroup.on.yAxis.x,
|
||||||
|
sketchGroup.on.yAxis.y,
|
||||||
|
sketchGroup.on.yAxis.z,
|
||||||
|
],
|
||||||
origin: [0, 0, 0],
|
origin: [0, 0, 0],
|
||||||
faceId: sketchGroup.on.id,
|
faceId: sketchGroup.on.id,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sketchGroup.on.type === 'face') {
|
if (sketchGroup.on.type === 'face') {
|
||||||
const faceInfo = await getFaceDetails(sketchGroup.on.faceId)
|
const faceInfo = await getFaceDetails(sketchGroup.on.id)
|
||||||
|
|
||||||
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis)
|
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis)
|
||||||
throw new Error('faceInfo')
|
throw new Error('faceInfo')
|
||||||
@ -1850,7 +1862,7 @@ export async function getSketchOrientationDetails(
|
|||||||
zAxis: [z_axis.x, z_axis.y, z_axis.z],
|
zAxis: [z_axis.x, z_axis.y, z_axis.z],
|
||||||
yAxis: [y_axis.x, y_axis.y, y_axis.z],
|
yAxis: [y_axis.x, y_axis.y, y_axis.z],
|
||||||
origin: [origin.x, origin.y, origin.z],
|
origin: [origin.x, origin.y, origin.z],
|
||||||
faceId: sketchGroup.on.faceId,
|
faceId: sketchGroup.on.id,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,18 +45,21 @@ export function profileStart({
|
|||||||
pathToNode,
|
pathToNode,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
theme,
|
theme,
|
||||||
|
isSelected,
|
||||||
}: {
|
}: {
|
||||||
from: Coords2d
|
from: Coords2d
|
||||||
id: string
|
id: string
|
||||||
pathToNode: PathToNode
|
pathToNode: PathToNode
|
||||||
scale?: number
|
scale?: number
|
||||||
theme: Themes
|
theme: Themes
|
||||||
|
isSelected?: boolean
|
||||||
}) {
|
}) {
|
||||||
const group = new Group()
|
const group = new Group()
|
||||||
|
|
||||||
const geometry = new BoxGeometry(12, 12, 12) // in pixels scaled later
|
const geometry = new BoxGeometry(12, 12, 12) // in pixels scaled later
|
||||||
const baseColor = getThemeColorForThreeJs(theme)
|
const baseColor = getThemeColorForThreeJs(theme)
|
||||||
const body = new MeshBasicMaterial({ color: baseColor })
|
const color = isSelected ? 0x0000ff : baseColor
|
||||||
|
const body = new MeshBasicMaterial({ color })
|
||||||
const mesh = new Mesh(geometry, body)
|
const mesh = new Mesh(geometry, body)
|
||||||
|
|
||||||
group.add(mesh)
|
group.add(mesh)
|
||||||
@ -66,7 +69,8 @@ export function profileStart({
|
|||||||
id,
|
id,
|
||||||
from,
|
from,
|
||||||
pathToNode,
|
pathToNode,
|
||||||
isSelected: false,
|
isSelected,
|
||||||
|
baseColor,
|
||||||
}
|
}
|
||||||
group.name = PROFILE_START
|
group.name = PROFILE_START
|
||||||
group.position.set(from[0], from[1], 0)
|
group.position.set(from[0], from[1], 0)
|
||||||
@ -84,6 +88,7 @@ export function straightSegment({
|
|||||||
callExpName,
|
callExpName,
|
||||||
texture,
|
texture,
|
||||||
theme,
|
theme,
|
||||||
|
isSelected = false,
|
||||||
}: {
|
}: {
|
||||||
from: Coords2d
|
from: Coords2d
|
||||||
to: Coords2d
|
to: Coords2d
|
||||||
@ -94,6 +99,7 @@ export function straightSegment({
|
|||||||
callExpName: string
|
callExpName: string
|
||||||
texture: Texture
|
texture: Texture
|
||||||
theme: Themes
|
theme: Themes
|
||||||
|
isSelected?: boolean
|
||||||
}): Group {
|
}): Group {
|
||||||
const group = new Group()
|
const group = new Group()
|
||||||
|
|
||||||
@ -119,7 +125,8 @@ export function straightSegment({
|
|||||||
|
|
||||||
const baseColor =
|
const baseColor =
|
||||||
callExpName === 'close' ? 0x444444 : getThemeColorForThreeJs(theme)
|
callExpName === 'close' ? 0x444444 : getThemeColorForThreeJs(theme)
|
||||||
const body = new MeshBasicMaterial({ color: baseColor })
|
const color = isSelected ? 0x0000ff : baseColor
|
||||||
|
const body = new MeshBasicMaterial({ color })
|
||||||
const mesh = new Mesh(geometry, body)
|
const mesh = new Mesh(geometry, body)
|
||||||
mesh.userData.type = isDraftSegment
|
mesh.userData.type = isDraftSegment
|
||||||
? STRAIGHT_SEGMENT_DASH
|
? STRAIGHT_SEGMENT_DASH
|
||||||
@ -132,7 +139,7 @@ export function straightSegment({
|
|||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
pathToNode,
|
pathToNode,
|
||||||
isSelected: false,
|
isSelected,
|
||||||
callExpName,
|
callExpName,
|
||||||
baseColor,
|
baseColor,
|
||||||
}
|
}
|
||||||
@ -141,7 +148,7 @@ export function straightSegment({
|
|||||||
const length = Math.sqrt(
|
const length = Math.sqrt(
|
||||||
Math.pow(to[0] - from[0], 2) + Math.pow(to[1] - from[1], 2)
|
Math.pow(to[0] - from[0], 2) + Math.pow(to[1] - from[1], 2)
|
||||||
)
|
)
|
||||||
const arrowGroup = createArrowhead(scale, theme)
|
const arrowGroup = createArrowhead(scale, theme, color)
|
||||||
arrowGroup.position.set(to[0], to[1], 0)
|
arrowGroup.position.set(to[0], to[1], 0)
|
||||||
const dir = new Vector3()
|
const dir = new Vector3()
|
||||||
.subVectors(new Vector3(to[0], to[1], 0), new Vector3(from[0], from[1], 0))
|
.subVectors(new Vector3(to[0], to[1], 0), new Vector3(from[0], from[1], 0))
|
||||||
@ -169,9 +176,10 @@ export function straightSegment({
|
|||||||
return group
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
function createArrowhead(scale = 1, theme: Themes): Group {
|
function createArrowhead(scale = 1, theme: Themes, color?: number): Group {
|
||||||
|
const baseColor = getThemeColorForThreeJs(theme)
|
||||||
const arrowMaterial = new MeshBasicMaterial({
|
const arrowMaterial = new MeshBasicMaterial({
|
||||||
color: getThemeColorForThreeJs(theme),
|
color: color || baseColor,
|
||||||
})
|
})
|
||||||
// specify the size of the geometry in pixels (i.e. cone height = 20px, cone radius = 4.5px)
|
// specify the size of the geometry in pixels (i.e. cone height = 20px, cone radius = 4.5px)
|
||||||
// we'll scale the group to the correct size later to match these sizes in screen space
|
// we'll scale the group to the correct size later to match these sizes in screen space
|
||||||
@ -232,6 +240,7 @@ export function tangentialArcToSegment({
|
|||||||
scale = 1,
|
scale = 1,
|
||||||
texture,
|
texture,
|
||||||
theme,
|
theme,
|
||||||
|
isSelected,
|
||||||
}: {
|
}: {
|
||||||
prevSegment: SketchGroup['value'][number]
|
prevSegment: SketchGroup['value'][number]
|
||||||
from: Coords2d
|
from: Coords2d
|
||||||
@ -242,6 +251,7 @@ export function tangentialArcToSegment({
|
|||||||
scale?: number
|
scale?: number
|
||||||
texture: Texture
|
texture: Texture
|
||||||
theme: Themes
|
theme: Themes
|
||||||
|
isSelected?: boolean
|
||||||
}): Group {
|
}): Group {
|
||||||
const group = new Group()
|
const group = new Group()
|
||||||
|
|
||||||
@ -273,7 +283,8 @@ export function tangentialArcToSegment({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const baseColor = getThemeColorForThreeJs(theme)
|
const baseColor = getThemeColorForThreeJs(theme)
|
||||||
const body = new MeshBasicMaterial({ color: baseColor })
|
const color = isSelected ? 0x0000ff : baseColor
|
||||||
|
const body = new MeshBasicMaterial({ color })
|
||||||
const mesh = new Mesh(geometry, body)
|
const mesh = new Mesh(geometry, body)
|
||||||
mesh.userData.type = isDraftSegment
|
mesh.userData.type = isDraftSegment
|
||||||
? TANGENTIAL_ARC_TO__SEGMENT_DASH
|
? TANGENTIAL_ARC_TO__SEGMENT_DASH
|
||||||
@ -286,12 +297,12 @@ export function tangentialArcToSegment({
|
|||||||
to,
|
to,
|
||||||
prevSegment,
|
prevSegment,
|
||||||
pathToNode,
|
pathToNode,
|
||||||
isSelected: false,
|
isSelected,
|
||||||
baseColor,
|
baseColor,
|
||||||
}
|
}
|
||||||
group.name = TANGENTIAL_ARC_TO_SEGMENT
|
group.name = TANGENTIAL_ARC_TO_SEGMENT
|
||||||
|
|
||||||
const arrowGroup = createArrowhead(scale, theme)
|
const arrowGroup = createArrowhead(scale, theme, color)
|
||||||
arrowGroup.position.set(to[0], to[1], 0)
|
arrowGroup.position.set(to[0], to[1], 0)
|
||||||
const arrowheadAngle = endAngle + (Math.PI / 2) * (ccw ? 1 : -1)
|
const arrowheadAngle = endAngle + (Math.PI / 2) * (ccw ? 1 : -1)
|
||||||
arrowGroup.quaternion.setFromUnitVectors(
|
arrowGroup.quaternion.setFromUnitVectors(
|
||||||
|
@ -47,7 +47,6 @@ import {
|
|||||||
TANGENTIAL_ARC_TO_SEGMENT,
|
TANGENTIAL_ARC_TO_SEGMENT,
|
||||||
getParentGroup,
|
getParentGroup,
|
||||||
getSketchOrientationDetails,
|
getSketchOrientationDetails,
|
||||||
getSketchQuaternion,
|
|
||||||
} from 'clientSideScene/sceneEntities'
|
} from 'clientSideScene/sceneEntities'
|
||||||
import {
|
import {
|
||||||
moveValueIntoNewVariablePath,
|
moveValueIntoNewVariablePath,
|
||||||
@ -64,6 +63,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
getNodeFromPath,
|
getNodeFromPath,
|
||||||
getNodePathFromSourceRange,
|
getNodePathFromSourceRange,
|
||||||
|
hasExtrudableGeometry,
|
||||||
isSingleCursorInPipe,
|
isSingleCursorInPipe,
|
||||||
} from 'lang/queryAst'
|
} from 'lang/queryAst'
|
||||||
import { TEST } from 'env'
|
import { TEST } from 'env'
|
||||||
@ -122,7 +122,24 @@ export const ModelingMachineProvider = ({
|
|||||||
htmlRef,
|
htmlRef,
|
||||||
token
|
token
|
||||||
)
|
)
|
||||||
useHotkeyWrapper(['meta + shift + .'], () => coreDump(coreDumpManager, true))
|
useHotkeyWrapper(['meta + shift + .'], () => {
|
||||||
|
console.warn('CoreDump: Initializing core dump')
|
||||||
|
toast.promise(
|
||||||
|
coreDump(coreDumpManager, true),
|
||||||
|
{
|
||||||
|
loading: 'Starting core dump...',
|
||||||
|
success: 'Core dump completed successfully',
|
||||||
|
error: 'Error while exporting core dump',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
success: {
|
||||||
|
// Note: this extended duration is especially important for Playwright e2e testing
|
||||||
|
// default duration is 2000 - https://react-hot-toast.com/docs/toast#default-durations
|
||||||
|
duration: 6000,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
// Settings machine setup
|
// Settings machine setup
|
||||||
// const retrievedSettings = useRef(
|
// const retrievedSettings = useRef(
|
||||||
@ -258,9 +275,9 @@ export const ModelingMachineProvider = ({
|
|||||||
),
|
),
|
||||||
'Set selection': assign(({ selectionRanges, sketchDetails }, event) => {
|
'Set selection': assign(({ selectionRanges, sketchDetails }, event) => {
|
||||||
const setSelections = event.data as SetSelections // this was needed for ts after adding 'Set selection' action to on done modal events
|
const setSelections = event.data as SetSelections // this was needed for ts after adding 'Set selection' action to on done modal events
|
||||||
if (!editorManager.editorView) return {}
|
|
||||||
const dispatchSelection = (selection?: EditorSelection) => {
|
const dispatchSelection = (selection?: EditorSelection) => {
|
||||||
if (!selection) return // TODO less of hack for the below please
|
if (!selection) return // TODO less of hack for the below please
|
||||||
|
if (!editorManager.editorView) return
|
||||||
editorManager.lastSelectionEvent = Date.now()
|
editorManager.lastSelectionEvent = Date.now()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (editorManager.editorView) {
|
if (editorManager.editorView) {
|
||||||
@ -431,8 +448,13 @@ export const ModelingMachineProvider = ({
|
|||||||
if (
|
if (
|
||||||
selectionRanges.codeBasedSelections.length === 0 ||
|
selectionRanges.codeBasedSelections.length === 0 ||
|
||||||
isSelectionLastLine(selectionRanges, codeManager.code)
|
isSelectionLastLine(selectionRanges, codeManager.code)
|
||||||
)
|
) {
|
||||||
return true
|
// they have no selection, we should enable the button
|
||||||
|
// so they can select the face through the cmdbar
|
||||||
|
// BUT only if there's extrudable geometry
|
||||||
|
if (hasExtrudableGeometry(kclManager.ast)) return true
|
||||||
|
return false
|
||||||
|
}
|
||||||
if (!isPipe) return false
|
if (!isPipe) return false
|
||||||
|
|
||||||
return canExtrudeSelection(selectionRanges)
|
return canExtrudeSelection(selectionRanges)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
@apply relative z-0 rounded-r max-w-full h-full flex-1;
|
@apply relative z-0 rounded-r max-w-full h-full flex-1;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: auto 1fr;
|
grid-template-rows: auto 1fr;
|
||||||
@apply bg-chalkboard-10/50 backdrop-blur-sm border border-chalkboard-20;
|
@apply bg-chalkboard-10/50 focus-within:bg-chalkboard-10/90 backdrop-blur-sm border border-chalkboard-20;
|
||||||
scroll-margin-block-start: 41px;
|
scroll-margin-block-start: 41px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:global(.dark) .panel {
|
:global(.dark) .panel {
|
||||||
@apply bg-chalkboard-100/50 backdrop-blur-[3px] border-chalkboard-80;
|
@apply bg-chalkboard-100/50 focus-within:bg-chalkboard-100/90 backdrop-blur-[3px] border-chalkboard-80;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
@ -46,7 +46,11 @@ export const ModelingPane = ({
|
|||||||
data-testid={detailsTestId}
|
data-testid={detailsTestId}
|
||||||
id={id}
|
id={id}
|
||||||
className={
|
className={
|
||||||
pointerEventsCssClass + styles.panel + ' group ' + (className || '')
|
'group-focus-within:border-primary dark:group-focus-within:border-chalkboard-50 ' +
|
||||||
|
pointerEventsCssClass +
|
||||||
|
styles.panel +
|
||||||
|
' group ' +
|
||||||
|
(className || '')
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ModelingPaneHeader title={title} Menu={Menu} />
|
<ModelingPaneHeader title={title} Menu={Menu} />
|
||||||
|
@ -43,20 +43,16 @@ describe('processMemory', () => {
|
|||||||
theExtrude: [
|
theExtrude: [
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
|
||||||
name: '',
|
name: '',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
|
faceId: expect.any(String),
|
||||||
sourceRange: [170, 194],
|
sourceRange: [170, 194],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
|
||||||
name: '',
|
name: '',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
|
faceId: expect.any(String),
|
||||||
sourceRange: [202, 230],
|
sourceRange: [202, 230],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -123,70 +123,73 @@ function ModelingSidebarSection({
|
|||||||
}, [showDebugPanel.current, togglePane, openPanes])
|
}, [showDebugPanel.current, togglePane, openPanes])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tab.Group
|
<div className="group contents">
|
||||||
vertical
|
<Tab.Group
|
||||||
selectedIndex={
|
vertical
|
||||||
currentPane === 'none' ? 0 : paneIds.indexOf(currentPane) + 1
|
selectedIndex={
|
||||||
}
|
currentPane === 'none' ? 0 : paneIds.indexOf(currentPane) + 1
|
||||||
onChange={(index) => {
|
|
||||||
const newPane = index === 0 ? 'none' : paneIds[index - 1]
|
|
||||||
togglePane(newPane)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Tab.List
|
|
||||||
className={
|
|
||||||
'pointer-events-auto ' +
|
|
||||||
(alignButtons === 'start'
|
|
||||||
? 'justify-start self-start'
|
|
||||||
: 'justify-end self-end') +
|
|
||||||
(currentPane === 'none'
|
|
||||||
? ' rounded-r focus-within:!border-primary/50'
|
|
||||||
: ' border-r-0') +
|
|
||||||
' p-2 col-start-1 col-span-1 h-fit w-fit flex flex-col items-start gap-2 bg-chalkboard-10 border border-solid border-chalkboard-20 dark:bg-chalkboard-90 dark:border-chalkboard-80 ' +
|
|
||||||
(openPanes.length === 1 && currentPane === 'none' ? 'pr-0.5' : '')
|
|
||||||
}
|
}
|
||||||
|
onChange={(index) => {
|
||||||
|
const newPane = index === 0 ? 'none' : paneIds[index - 1]
|
||||||
|
togglePane(newPane)
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Tab key="none" className="sr-only">
|
<Tab.List
|
||||||
No panes open
|
className={
|
||||||
</Tab>
|
'pointer-events-auto ' +
|
||||||
{filteredPanes.map((pane) => (
|
(alignButtons === 'start'
|
||||||
<ModelingPaneButton
|
? 'justify-start self-start'
|
||||||
key={pane.id}
|
: 'justify-end self-end') +
|
||||||
paneConfig={pane}
|
(currentPane === 'none'
|
||||||
currentPane={currentPane}
|
? ' rounded-r focus-within:!border-primary/50'
|
||||||
togglePane={() => togglePane(pane.id)}
|
: ' border-r-0') +
|
||||||
/>
|
' p-2 col-start-1 col-span-1 h-fit w-fit flex flex-col items-start gap-2 ' +
|
||||||
))}
|
'bg-chalkboard-10 border border-solid border-chalkboard-20 dark:bg-chalkboard-90 dark:border-chalkboard-80 group-focus-within:border-primary dark:group-focus-within:border-chalkboard-50 ' +
|
||||||
</Tab.List>
|
(openPanes.length === 1 && currentPane === 'none' ? 'pr-0.5' : '')
|
||||||
<Tab.Panels
|
}
|
||||||
as="article"
|
>
|
||||||
className={
|
<Tab key="none" className="sr-only">
|
||||||
'col-start-2 col-span-1 ' +
|
No panes open
|
||||||
(openPanes.length === 1
|
</Tab>
|
||||||
? currentPane !== 'none'
|
{filteredPanes.map((pane) => (
|
||||||
? `row-start-1 row-end-3`
|
<ModelingPaneButton
|
||||||
: `hidden`
|
key={pane.id}
|
||||||
: ``)
|
paneConfig={pane}
|
||||||
}
|
currentPane={currentPane}
|
||||||
>
|
togglePane={() => togglePane(pane.id)}
|
||||||
<Tab.Panel key="none" />
|
/>
|
||||||
{filteredPanes.map((pane) => (
|
))}
|
||||||
<Tab.Panel key={pane.id} className="h-full">
|
</Tab.List>
|
||||||
<ModelingPane
|
<Tab.Panels
|
||||||
id={`${pane.id}-pane`}
|
as="article"
|
||||||
title={pane.title}
|
className={
|
||||||
Menu={pane.Menu}
|
'col-start-2 col-span-1 ' +
|
||||||
>
|
(openPanes.length === 1
|
||||||
{pane.Content instanceof Function ? (
|
? currentPane !== 'none'
|
||||||
<pane.Content />
|
? `row-start-1 row-end-3`
|
||||||
) : (
|
: `hidden`
|
||||||
pane.Content
|
: ``)
|
||||||
)}
|
}
|
||||||
</ModelingPane>
|
>
|
||||||
</Tab.Panel>
|
<Tab.Panel key="none" />
|
||||||
))}
|
{filteredPanes.map((pane) => (
|
||||||
</Tab.Panels>
|
<Tab.Panel key={pane.id} className="h-full">
|
||||||
</Tab.Group>
|
<ModelingPane
|
||||||
|
id={`${pane.id}-pane`}
|
||||||
|
title={pane.title}
|
||||||
|
Menu={pane.Menu}
|
||||||
|
>
|
||||||
|
{pane.Content instanceof Function ? (
|
||||||
|
<pane.Content />
|
||||||
|
) : (
|
||||||
|
pane.Content
|
||||||
|
)}
|
||||||
|
</ModelingPane>
|
||||||
|
</Tab.Panel>
|
||||||
|
))}
|
||||||
|
</Tab.Panels>
|
||||||
|
</Tab.Group>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { fireEvent, render, screen } from '@testing-library/react'
|
import { render, screen } from '@testing-library/react'
|
||||||
import { BrowserRouter } from 'react-router-dom'
|
import { BrowserRouter } from 'react-router-dom'
|
||||||
import ProjectSidebarMenu from './ProjectSidebarMenu'
|
import ProjectSidebarMenu from './ProjectSidebarMenu'
|
||||||
import { SettingsAuthProviderJest } from './SettingsAuthProvider'
|
import { SettingsAuthProviderJest } from './SettingsAuthProvider'
|
||||||
import { APP_NAME } from 'lib/constants'
|
|
||||||
import { CommandBarProvider } from './CommandBar/CommandBarProvider'
|
import { CommandBarProvider } from './CommandBar/CommandBarProvider'
|
||||||
import { Project } from 'wasm-lib/kcl/bindings/Project'
|
import { Project } from 'wasm-lib/kcl/bindings/Project'
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ const UserSidebarMenu = ({ user }: { user?: User }) => {
|
|||||||
<Popover className="relative">
|
<Popover className="relative">
|
||||||
{user?.image && !imageLoadFailed ? (
|
{user?.image && !imageLoadFailed ? (
|
||||||
<Popover.Button
|
<Popover.Button
|
||||||
className="border-0 rounded-full w-fit min-w-max p-0 group"
|
className="relative border-0 rounded-full w-fit min-w-max p-0 group"
|
||||||
data-testid="user-sidebar-toggle"
|
data-testid="user-sidebar-toggle"
|
||||||
>
|
>
|
||||||
<div className="rounded-full border overflow-hidden">
|
<div className="rounded-full border overflow-hidden">
|
||||||
@ -51,6 +51,9 @@ const UserSidebarMenu = ({ user }: { user?: User }) => {
|
|||||||
onError={() => setImageLoadFailed(true)}
|
onError={() => setImageLoadFailed(true)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<Tooltip position="bottom-right" delay={1000}>
|
||||||
|
User menu
|
||||||
|
</Tooltip>
|
||||||
</Popover.Button>
|
</Popover.Button>
|
||||||
) : (
|
) : (
|
||||||
<ActionButton
|
<ActionButton
|
||||||
@ -59,7 +62,7 @@ const UserSidebarMenu = ({ user }: { user?: User }) => {
|
|||||||
className="border-transparent !px-0"
|
className="border-transparent !px-0"
|
||||||
data-testid="user-sidebar-toggle"
|
data-testid="user-sidebar-toggle"
|
||||||
>
|
>
|
||||||
<Tooltip position="left" delay={1000}>
|
<Tooltip position="bottom-right" delay={1000}>
|
||||||
User menu
|
User menu
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
@ -160,9 +160,6 @@ export default class EditorManager {
|
|||||||
if (selections.codeBasedSelections.length === 0) {
|
if (selections.codeBasedSelections.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.editorView) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let codeBasedSelections = []
|
let codeBasedSelections = []
|
||||||
for (const selection of selections.codeBasedSelections) {
|
for (const selection of selections.codeBasedSelections) {
|
||||||
codeBasedSelections.push(
|
codeBasedSelections.push(
|
||||||
@ -177,6 +174,9 @@ export default class EditorManager {
|
|||||||
].range[1]
|
].range[1]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if (!this.editorView) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.editorView.dispatch({
|
this.editorView.dispatch({
|
||||||
selection: EditorSelection.create(codeBasedSelections, 1),
|
selection: EditorSelection.create(codeBasedSelections, 1),
|
||||||
})
|
})
|
||||||
|
@ -167,6 +167,7 @@ export class LanguageServerPlugin implements PluginValue {
|
|||||||
if (pos === null) return null
|
if (pos === null) return null
|
||||||
const dom = document.createElement('div')
|
const dom = document.createElement('div')
|
||||||
dom.classList.add('documentation')
|
dom.classList.add('documentation')
|
||||||
|
dom.classList.add('hover-tooltip')
|
||||||
dom.style.zIndex = '99999999'
|
dom.style.zIndex = '99999999'
|
||||||
if (this.allowHTMLContent) dom.innerHTML = formatContents(contents)
|
if (this.allowHTMLContent) dom.innerHTML = formatContents(contents)
|
||||||
else dom.textContent = formatContents(contents)
|
else dom.textContent = formatContents(contents)
|
||||||
|
@ -147,15 +147,33 @@ code {
|
|||||||
|
|
||||||
#code-mirror-override .cm-activeLine,
|
#code-mirror-override .cm-activeLine,
|
||||||
#code-mirror-override .cm-activeLineGutter {
|
#code-mirror-override .cm-activeLineGutter {
|
||||||
@apply bg-primary/10;
|
@apply bg-primary/5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark #code-mirror-override .cm-activeLine,
|
.dark #code-mirror-override .cm-activeLine,
|
||||||
.dark #code-mirror-override .cm-activeLineGutter {
|
.dark #code-mirror-override .cm-activeLineGutter {
|
||||||
@apply bg-primary/20;
|
@apply bg-chalkboard-70/20;
|
||||||
mix-blend-mode: lighten;
|
mix-blend-mode: lighten;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#code-mirror-override .cm-focused .cm-activeLine,
|
||||||
|
#code-mirror-override .cm-focused .cm-activeLineGutter {
|
||||||
|
@apply bg-primary/10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark #code-mirror-override .cm-focused .cm-activeLine,
|
||||||
|
.dark #code-mirror-override .cm-focused .cm-activeLineGutter {
|
||||||
|
@apply bg-chalkboard-70/40;
|
||||||
|
}
|
||||||
|
|
||||||
|
#code-mirror-override .cm-matchingBracket {
|
||||||
|
@apply bg-primary/20;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark #code-mirror-override .cm-matchingBracket {
|
||||||
|
@apply bg-chalkboard-70/60;
|
||||||
|
}
|
||||||
|
|
||||||
#code-mirror-override .cm-gutters {
|
#code-mirror-override .cm-gutters {
|
||||||
@apply bg-chalkboard-10/30;
|
@apply bg-chalkboard-10/30;
|
||||||
}
|
}
|
||||||
@ -171,22 +189,8 @@ code {
|
|||||||
@apply caret-chalkboard-10;
|
@apply caret-chalkboard-10;
|
||||||
}
|
}
|
||||||
|
|
||||||
#code-mirror-override .cm-focused .cm-cursor {
|
#code-mirror-override .cm-focused {
|
||||||
width: 0px;
|
outline: none;
|
||||||
}
|
|
||||||
#code-mirror-override .cm-cursor {
|
|
||||||
display: block;
|
|
||||||
width: 1ch;
|
|
||||||
@apply mix-blend-multiply;
|
|
||||||
@apply border-l-primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dark #code-mirror-override .cm-cursor {
|
|
||||||
@apply border-l-chalkboard-10;
|
|
||||||
}
|
|
||||||
|
|
||||||
#code-mirror-override.blink .cm-cursor {
|
|
||||||
animation: blink 1200ms ease-out infinite;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes blink {
|
@keyframes blink {
|
||||||
|
@ -41,7 +41,10 @@ export class KclManager {
|
|||||||
engineCommandManager: EngineCommandManager
|
engineCommandManager: EngineCommandManager
|
||||||
private _defferer = deferExecution((code: string) => {
|
private _defferer = deferExecution((code: string) => {
|
||||||
const ast = this.safeParse(code)
|
const ast = this.safeParse(code)
|
||||||
if (!ast) return
|
if (!ast) {
|
||||||
|
this.clearAst()
|
||||||
|
return
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const fmtAndStringify = (ast: Program) =>
|
const fmtAndStringify = (ast: Program) =>
|
||||||
JSON.stringify(parse(recast(ast)))
|
JSON.stringify(parse(recast(ast)))
|
||||||
@ -89,7 +92,6 @@ export class KclManager {
|
|||||||
return this._kclErrors
|
return this._kclErrors
|
||||||
}
|
}
|
||||||
set kclErrors(kclErrors) {
|
set kclErrors(kclErrors) {
|
||||||
console.log('[lsp] not lsp, actually typescript: ', kclErrors)
|
|
||||||
this._kclErrors = kclErrors
|
this._kclErrors = kclErrors
|
||||||
let diagnostics = kclErrorsToDiagnostics(kclErrors)
|
let diagnostics = kclErrorsToDiagnostics(kclErrors)
|
||||||
editorManager.addDiagnostics(diagnostics)
|
editorManager.addDiagnostics(diagnostics)
|
||||||
@ -146,6 +148,18 @@ export class KclManager {
|
|||||||
this._executeCallback = callback
|
this._executeCallback = callback
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearAst() {
|
||||||
|
this._ast = {
|
||||||
|
body: [],
|
||||||
|
start: 0,
|
||||||
|
end: 0,
|
||||||
|
nonCodeMeta: {
|
||||||
|
nonCodeNodes: {},
|
||||||
|
start: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
safeParse(code: string): Program | null {
|
safeParse(code: string): Program | null {
|
||||||
try {
|
try {
|
||||||
const ast = parse(code)
|
const ast = parse(code)
|
||||||
@ -293,14 +307,20 @@ export class KclManager {
|
|||||||
if (!force) return this._defferer(codeManager.code)
|
if (!force) return this._defferer(codeManager.code)
|
||||||
|
|
||||||
const ast = this.safeParse(codeManager.code)
|
const ast = this.safeParse(codeManager.code)
|
||||||
if (!ast) return
|
if (!ast) {
|
||||||
|
this.clearAst()
|
||||||
|
return
|
||||||
|
}
|
||||||
this.ast = { ...ast }
|
this.ast = { ...ast }
|
||||||
return this.executeAst(ast, zoomToFit)
|
return this.executeAst(ast, zoomToFit)
|
||||||
}
|
}
|
||||||
format() {
|
format() {
|
||||||
const originalCode = codeManager.code
|
const originalCode = codeManager.code
|
||||||
const ast = this.safeParse(originalCode)
|
const ast = this.safeParse(originalCode)
|
||||||
if (!ast) return
|
if (!ast) {
|
||||||
|
this.clearAst()
|
||||||
|
return
|
||||||
|
}
|
||||||
const code = recast(ast)
|
const code = recast(ast)
|
||||||
if (originalCode === code) return
|
if (originalCode === code) return
|
||||||
|
|
||||||
|
@ -51,13 +51,7 @@ const mySketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
xAxis: { x: 1, y: 0, z: 0 },
|
|
||||||
yAxis: { x: 0, y: 1, z: 0 },
|
|
||||||
zAxis: { x: 0, y: 0, z: 1 },
|
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
entityId: expect.any(String),
|
|
||||||
__meta: [{ sourceRange: [46, 71] }],
|
__meta: [{ sourceRange: [46, 71] }],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -79,8 +73,6 @@ const mySketch001 = startSketchOn('XY')
|
|||||||
value: [
|
value: [
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
faceId: expect.any(String),
|
||||||
name: '',
|
name: '',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
@ -88,42 +80,42 @@ const mySketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
faceId: expect.any(String),
|
||||||
name: '',
|
name: '',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
sourceRange: [108, 132],
|
sourceRange: [108, 132],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sketchGroupValues: [
|
sketchGroup: {
|
||||||
{
|
id: expect.any(String),
|
||||||
type: 'ToPoint',
|
__meta: expect.any(Array),
|
||||||
from: [0, 0],
|
on: expect.any(Object),
|
||||||
to: [-1.59, -1.54],
|
start: expect.any(Object),
|
||||||
name: '',
|
type: 'SketchGroup',
|
||||||
__geoMeta: {
|
value: [
|
||||||
id: expect.any(String),
|
{
|
||||||
sourceRange: [77, 102],
|
type: 'ToPoint',
|
||||||
|
from: [0, 0],
|
||||||
|
to: [-1.59, -1.54],
|
||||||
|
name: '',
|
||||||
|
__geoMeta: {
|
||||||
|
id: expect.any(String),
|
||||||
|
sourceRange: [77, 102],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [-1.59, -1.54],
|
||||||
from: [-1.59, -1.54],
|
to: [0.46, -5.82],
|
||||||
to: [0.46, -5.82],
|
name: '',
|
||||||
name: '',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [108, 132],
|
||||||
sourceRange: [108, 132],
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
height: 2,
|
height: 2,
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
xAxis: { x: 1, y: 0, z: 0 },
|
|
||||||
yAxis: { x: 0, y: 1, z: 0 },
|
|
||||||
zAxis: { x: 0, y: 0, z: 1 },
|
|
||||||
startCapId: expect.any(String),
|
startCapId: expect.any(String),
|
||||||
endCapId: expect.any(String),
|
endCapId: expect.any(String),
|
||||||
__meta: [{ sourceRange: [46, 71] }],
|
__meta: [{ sourceRange: [46, 71] }],
|
||||||
@ -162,8 +154,6 @@ const sk2 = startSketchOn('XY')
|
|||||||
value: [
|
value: [
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
faceId: expect.any(String),
|
||||||
name: '',
|
name: '',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
@ -171,8 +161,6 @@ const sk2 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
faceId: expect.any(String),
|
||||||
name: 'p',
|
name: 'p',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
@ -180,52 +168,52 @@ const sk2 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
faceId: expect.any(String),
|
||||||
name: '',
|
name: '',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
sourceRange: [124, 143],
|
sourceRange: [124, 143],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sketchGroupValues: [
|
sketchGroup: {
|
||||||
{
|
id: expect.any(String),
|
||||||
type: 'ToPoint',
|
__meta: expect.any(Array),
|
||||||
from: [0, 0],
|
on: expect.any(Object),
|
||||||
to: [-2.5, 0],
|
start: expect.any(Object),
|
||||||
name: '',
|
type: 'SketchGroup',
|
||||||
__geoMeta: {
|
value: [
|
||||||
id: expect.any(String),
|
{
|
||||||
sourceRange: [69, 89],
|
type: 'ToPoint',
|
||||||
|
from: [0, 0],
|
||||||
|
to: [-2.5, 0],
|
||||||
|
name: '',
|
||||||
|
__geoMeta: {
|
||||||
|
id: expect.any(String),
|
||||||
|
sourceRange: [69, 89],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [-2.5, 0],
|
||||||
from: [-2.5, 0],
|
to: [0, 10],
|
||||||
to: [0, 10],
|
name: 'p',
|
||||||
name: 'p',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [95, 118],
|
||||||
sourceRange: [95, 118],
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [0, 10],
|
||||||
from: [0, 10],
|
to: [2.5, 0],
|
||||||
to: [2.5, 0],
|
name: '',
|
||||||
name: '',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [124, 143],
|
||||||
sourceRange: [124, 143],
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
height: 2,
|
height: 2,
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
xAxis: { x: 1, y: 0, z: 0 },
|
|
||||||
yAxis: { x: 0, y: 1, z: 0 },
|
|
||||||
zAxis: { x: 0, y: 0, z: 1 },
|
|
||||||
startCapId: expect.any(String),
|
startCapId: expect.any(String),
|
||||||
endCapId: expect.any(String),
|
endCapId: expect.any(String),
|
||||||
__meta: [{ sourceRange: [38, 63] }],
|
__meta: [{ sourceRange: [38, 63] }],
|
||||||
@ -236,8 +224,6 @@ const sk2 = startSketchOn('XY')
|
|||||||
value: [
|
value: [
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
faceId: expect.any(String),
|
||||||
name: '',
|
name: '',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
@ -245,8 +231,6 @@ const sk2 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
faceId: expect.any(String),
|
||||||
name: 'p',
|
name: 'p',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
@ -254,52 +238,52 @@ const sk2 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'extrudePlane',
|
type: 'extrudePlane',
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
faceId: expect.any(String),
|
faceId: expect.any(String),
|
||||||
name: '',
|
name: '',
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
sourceRange: [428, 447],
|
sourceRange: [428, 447],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sketchGroupValues: [
|
sketchGroup: {
|
||||||
{
|
id: expect.any(String),
|
||||||
type: 'ToPoint',
|
__meta: expect.any(Array),
|
||||||
from: [0, 0],
|
on: expect.any(Object),
|
||||||
to: [-2.5, 0],
|
start: expect.any(Object),
|
||||||
name: '',
|
type: 'SketchGroup',
|
||||||
__geoMeta: {
|
value: [
|
||||||
id: expect.any(String),
|
{
|
||||||
sourceRange: [374, 394],
|
type: 'ToPoint',
|
||||||
|
from: [0, 0],
|
||||||
|
to: [-2.5, 0],
|
||||||
|
name: '',
|
||||||
|
__geoMeta: {
|
||||||
|
id: expect.any(String),
|
||||||
|
sourceRange: [374, 394],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [-2.5, 0],
|
||||||
from: [-2.5, 0],
|
to: [0, 3],
|
||||||
to: [0, 3],
|
name: 'p',
|
||||||
name: 'p',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [400, 422],
|
||||||
sourceRange: [400, 422],
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [0, 3],
|
||||||
from: [0, 3],
|
to: [2.5, 0],
|
||||||
to: [2.5, 0],
|
name: '',
|
||||||
name: '',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [428, 447],
|
||||||
sourceRange: [428, 447],
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
height: 2,
|
height: 2,
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
xAxis: { x: 1, y: 0, z: 0 },
|
|
||||||
yAxis: { x: 0, y: 1, z: 0 },
|
|
||||||
zAxis: { x: 0, y: 0, z: 1 },
|
|
||||||
startCapId: expect.any(String),
|
startCapId: expect.any(String),
|
||||||
endCapId: expect.any(String),
|
endCapId: expect.any(String),
|
||||||
__meta: [{ sourceRange: [343, 368] }],
|
__meta: [{ sourceRange: [343, 368] }],
|
||||||
|
@ -22,7 +22,7 @@ export default class CodeManager {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const storedCode = safeLSGetItem(PERSIST_CODE_TOKEN) || ''
|
const storedCode = safeLSGetItem(PERSIST_CODE_TOKEN)
|
||||||
// TODO #819 remove zustand persistence logic in a few months
|
// TODO #819 remove zustand persistence logic in a few months
|
||||||
// short term migration, shouldn't make a difference for tauri app users
|
// short term migration, shouldn't make a difference for tauri app users
|
||||||
// anyway since that's filesystem based.
|
// anyway since that's filesystem based.
|
||||||
@ -68,7 +68,9 @@ export default class CodeManager {
|
|||||||
this._currentFilePath = path
|
this._currentFilePath = path
|
||||||
}
|
}
|
||||||
|
|
||||||
// This updates the code state and calls the updateState function.
|
/**
|
||||||
|
* This updates the code state and calls the updateState function.
|
||||||
|
*/
|
||||||
updateCodeState(code: string): void {
|
updateCodeState(code: string): void {
|
||||||
if (this._code !== code) {
|
if (this._code !== code) {
|
||||||
this.code = code
|
this.code = code
|
||||||
@ -76,7 +78,9 @@ export default class CodeManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the code in the editor.
|
/**
|
||||||
|
* Update the code in the editor.
|
||||||
|
*/
|
||||||
updateCodeEditor(code: string): void {
|
updateCodeEditor(code: string): void {
|
||||||
this.code = code
|
this.code = code
|
||||||
if (editorManager.editorView) {
|
if (editorManager.editorView) {
|
||||||
@ -90,7 +94,9 @@ export default class CodeManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the code, state, and the code the code mirror editor sees.
|
/**
|
||||||
|
* Update the code, state, and the code the code mirror editor sees.
|
||||||
|
*/
|
||||||
updateCodeStateEditor(code: string): void {
|
updateCodeStateEditor(code: string): void {
|
||||||
if (this._code !== code) {
|
if (this._code !== code) {
|
||||||
this.code = code
|
this.code = code
|
||||||
|
@ -177,13 +177,7 @@ const newVar = myVar + 1`
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
position: [0, 0, 0],
|
|
||||||
rotation: [0, 0, 0, 1],
|
|
||||||
xAxis: { x: 1, y: 0, z: 0 },
|
|
||||||
yAxis: { x: 0, y: 1, z: 0 },
|
|
||||||
zAxis: { x: 0, y: 0, z: 1 },
|
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
entityId: expect.any(String),
|
|
||||||
__meta: [{ sourceRange: [39, 63] }],
|
__meta: [{ sourceRange: [39, 63] }],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -7,6 +7,8 @@ import {
|
|||||||
doesPipeHaveCallExp,
|
doesPipeHaveCallExp,
|
||||||
hasExtrudeSketchGroup,
|
hasExtrudeSketchGroup,
|
||||||
findUsesOfTagInPipe,
|
findUsesOfTagInPipe,
|
||||||
|
hasSketchPipeBeenExtruded,
|
||||||
|
hasExtrudableGeometry,
|
||||||
} from './queryAst'
|
} from './queryAst'
|
||||||
import { enginelessExecutor } from '../lib/testHelpers'
|
import { enginelessExecutor } from '../lib/testHelpers'
|
||||||
import {
|
import {
|
||||||
@ -396,3 +398,90 @@ describe('Testing findUsesOfTagInPipe', () => {
|
|||||||
expect(result).toHaveLength(0)
|
expect(result).toHaveLength(0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('Testing hasSketchPipeBeenExtruded', () => {
|
||||||
|
const exampleCode = `const sketch001 = startSketchOn('XZ')
|
||||||
|
|> startProfileAt([3.29, 7.86], %)
|
||||||
|
|> line([2.48, 2.44], %)
|
||||||
|
|> line([2.66, 1.17], %)
|
||||||
|
|> line([3.75, 0.46], %)
|
||||||
|
|> line([4.99, -0.46], %, 'seg01')
|
||||||
|
|> line([3.3, -2.12], %)
|
||||||
|
|> line([2.16, -3.33], %)
|
||||||
|
|> line([0.85, -3.08], %)
|
||||||
|
|> line([-0.18, -3.36], %)
|
||||||
|
|> line([-3.86, -2.73], %)
|
||||||
|
|> line([-17.67, 0.85], %)
|
||||||
|
|> close(%)
|
||||||
|
const extrude001 = extrude(10, sketch001)
|
||||||
|
const sketch002 = startSketchOn(extrude001, 'seg01')
|
||||||
|
|> startProfileAt([-12.94, 6.6], %)
|
||||||
|
|> line([2.45, -0.2], %)
|
||||||
|
|> line([-2, -1.25], %)
|
||||||
|
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||||
|
|> close(%)
|
||||||
|
`
|
||||||
|
it('finds sketch001 pipe to be extruded', async () => {
|
||||||
|
const ast = parse(exampleCode)
|
||||||
|
const lineOfInterest = `line([4.99, -0.46], %, 'seg01')`
|
||||||
|
const characterIndex =
|
||||||
|
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
|
||||||
|
const extruded = hasSketchPipeBeenExtruded(
|
||||||
|
{
|
||||||
|
range: [characterIndex, characterIndex],
|
||||||
|
type: 'default',
|
||||||
|
},
|
||||||
|
ast
|
||||||
|
)
|
||||||
|
expect(extruded).toBeTruthy()
|
||||||
|
})
|
||||||
|
it('find sketch002 NOT pipe to be extruded', async () => {
|
||||||
|
const ast = parse(exampleCode)
|
||||||
|
const lineOfInterest = `line([2.45, -0.2], %)`
|
||||||
|
const characterIndex =
|
||||||
|
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
|
||||||
|
const extruded = hasSketchPipeBeenExtruded(
|
||||||
|
{
|
||||||
|
range: [characterIndex, characterIndex],
|
||||||
|
type: 'default',
|
||||||
|
},
|
||||||
|
ast
|
||||||
|
)
|
||||||
|
expect(extruded).toBeFalsy()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('Testing hasExtrudableGeometry', () => {
|
||||||
|
it('finds sketch001 pipe to be extruded', async () => {
|
||||||
|
const exampleCode = `const sketch001 = startSketchOn('XZ')
|
||||||
|
|> startProfileAt([3.29, 7.86], %)
|
||||||
|
|> line([2.48, 2.44], %)
|
||||||
|
|> line([-3.86, -2.73], %)
|
||||||
|
|> line([-17.67, 0.85], %)
|
||||||
|
|> close(%)
|
||||||
|
const extrude001 = extrude(10, sketch001)
|
||||||
|
const sketch002 = startSketchOn(extrude001, 'seg01')
|
||||||
|
|> startProfileAt([-12.94, 6.6], %)
|
||||||
|
|> line([2.45, -0.2], %)
|
||||||
|
|> line([-2, -1.25], %)
|
||||||
|
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||||
|
|> close(%)
|
||||||
|
`
|
||||||
|
const ast = parse(exampleCode)
|
||||||
|
const extrudable = hasExtrudableGeometry(ast)
|
||||||
|
expect(extrudable).toBeTruthy()
|
||||||
|
})
|
||||||
|
it('find sketch002 NOT pipe to be extruded', async () => {
|
||||||
|
const exampleCode = `const sketch001 = startSketchOn('XZ')
|
||||||
|
|> startProfileAt([3.29, 7.86], %)
|
||||||
|
|> line([2.48, 2.44], %)
|
||||||
|
|> line([-3.86, -2.73], %)
|
||||||
|
|> line([-17.67, 0.85], %)
|
||||||
|
|> close(%)
|
||||||
|
const extrude001 = extrude(10, sketch001)
|
||||||
|
`
|
||||||
|
const ast = parse(exampleCode)
|
||||||
|
const extrudable = hasExtrudableGeometry(ast)
|
||||||
|
expect(extrudable).toBeFalsy()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
@ -661,14 +661,6 @@ export function isSingleCursorInPipe(
|
|||||||
ast: Program
|
ast: Program
|
||||||
) {
|
) {
|
||||||
if (selectionRanges.codeBasedSelections.length !== 1) return false
|
if (selectionRanges.codeBasedSelections.length !== 1) return false
|
||||||
if (
|
|
||||||
doesPipeHaveCallExp({
|
|
||||||
ast,
|
|
||||||
selection: selectionRanges.codeBasedSelections[0],
|
|
||||||
calleeName: 'extrude',
|
|
||||||
})
|
|
||||||
)
|
|
||||||
return false
|
|
||||||
const selection = selectionRanges.codeBasedSelections[0]
|
const selection = selectionRanges.codeBasedSelections[0]
|
||||||
const pathToNode = getNodePathFromSourceRange(ast, selection.range)
|
const pathToNode = getNodePathFromSourceRange(ast, selection.range)
|
||||||
const nodeTypes = pathToNode.map(([, type]) => type)
|
const nodeTypes = pathToNode.map(([, type]) => type)
|
||||||
@ -720,3 +712,78 @@ export function findUsesOfTagInPipe(
|
|||||||
})
|
})
|
||||||
return dependentRanges
|
return dependentRanges
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function hasSketchPipeBeenExtruded(selection: Selection, ast: Program) {
|
||||||
|
const path = getNodePathFromSourceRange(ast, selection.range)
|
||||||
|
const { node: pipeExpression } = getNodeFromPath<PipeExpression>(
|
||||||
|
ast,
|
||||||
|
path,
|
||||||
|
'PipeExpression'
|
||||||
|
)
|
||||||
|
if (pipeExpression.type !== 'PipeExpression') return false
|
||||||
|
const varDec = getNodeFromPath<VariableDeclarator>(
|
||||||
|
ast,
|
||||||
|
path,
|
||||||
|
'VariableDeclarator'
|
||||||
|
).node
|
||||||
|
let extruded = false
|
||||||
|
traverse(ast as any, {
|
||||||
|
enter(node) {
|
||||||
|
if (
|
||||||
|
node.type === 'CallExpression' &&
|
||||||
|
node.callee.type === 'Identifier' &&
|
||||||
|
node.callee.name === 'extrude' &&
|
||||||
|
node.arguments?.[1]?.type === 'Identifier' &&
|
||||||
|
node.arguments[1].name === varDec.id.name
|
||||||
|
) {
|
||||||
|
extruded = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return extruded
|
||||||
|
}
|
||||||
|
|
||||||
|
/** File must contain at least one sketch that has not been extruded already */
|
||||||
|
export function hasExtrudableGeometry(ast: Program) {
|
||||||
|
const theMap: any = {}
|
||||||
|
traverse(ast as any, {
|
||||||
|
enter(node) {
|
||||||
|
if (
|
||||||
|
node.type === 'VariableDeclarator' &&
|
||||||
|
node.init?.type === 'PipeExpression'
|
||||||
|
) {
|
||||||
|
let hasStartProfileAt = false
|
||||||
|
let hasStartSketchOn = false
|
||||||
|
let hasClose = false
|
||||||
|
for (const pipe of node.init.body) {
|
||||||
|
if (
|
||||||
|
pipe.type === 'CallExpression' &&
|
||||||
|
pipe.callee.name === 'startProfileAt'
|
||||||
|
) {
|
||||||
|
hasStartProfileAt = true
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
pipe.type === 'CallExpression' &&
|
||||||
|
pipe.callee.name === 'startSketchOn'
|
||||||
|
) {
|
||||||
|
hasStartSketchOn = true
|
||||||
|
}
|
||||||
|
if (pipe.type === 'CallExpression' && pipe.callee.name === 'close') {
|
||||||
|
hasClose = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hasStartProfileAt && hasStartSketchOn && hasClose) {
|
||||||
|
theMap[node.id.name] = true
|
||||||
|
}
|
||||||
|
} else if (
|
||||||
|
node.type === 'CallExpression' &&
|
||||||
|
node.callee.name === 'extrude' &&
|
||||||
|
node.arguments[1]?.type === 'Identifier' &&
|
||||||
|
theMap?.[node?.arguments?.[1]?.name]
|
||||||
|
) {
|
||||||
|
delete theMap[node.arguments[1].name]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return Object.keys(theMap).length > 0
|
||||||
|
}
|
||||||
|
@ -58,6 +58,9 @@ function isHighlightSetEntity_type(
|
|||||||
|
|
||||||
type WebSocketResponse = Models['WebSocketResponse_type']
|
type WebSocketResponse = Models['WebSocketResponse_type']
|
||||||
type OkWebSocketResponseData = Models['OkWebSocketResponseData_type']
|
type OkWebSocketResponseData = Models['OkWebSocketResponseData_type']
|
||||||
|
type BatchResponseMap = {
|
||||||
|
[key: string]: Models['BatchResponse_type']
|
||||||
|
}
|
||||||
|
|
||||||
type ResultCommand = CommandInfo & {
|
type ResultCommand = CommandInfo & {
|
||||||
type: 'result'
|
type: 'result'
|
||||||
@ -1316,7 +1319,8 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
message.success &&
|
message.success &&
|
||||||
message.resp.type === 'modeling' &&
|
(message.resp.type === 'modeling' ||
|
||||||
|
message.resp.type === 'modeling_batch') &&
|
||||||
message.request_id
|
message.request_id
|
||||||
) {
|
) {
|
||||||
this.handleModelingCommand(
|
this.handleModelingCommand(
|
||||||
@ -1380,19 +1384,60 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
id: string,
|
id: string,
|
||||||
raw: WebSocketResponse
|
raw: WebSocketResponse
|
||||||
) {
|
) {
|
||||||
if (message.type !== 'modeling') {
|
if (!(message.type === 'modeling' || message.type === 'modeling_batch')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const modelingResponse = message.data.modeling_response
|
|
||||||
const command = this.artifactMap[id]
|
const command = this.artifactMap[id]
|
||||||
|
let modelingResponse: Models['OkModelingCmdResponse_type'] = {
|
||||||
|
type: 'empty',
|
||||||
|
}
|
||||||
|
if ('modeling_response' in message.data) {
|
||||||
|
modelingResponse = message.data.modeling_response
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
command?.type === 'pending' &&
|
command?.type === 'pending' &&
|
||||||
command.commandType === 'batch' &&
|
command.commandType === 'batch' &&
|
||||||
command?.additionalData?.type === 'batch-ids'
|
command?.additionalData?.type === 'batch-ids'
|
||||||
) {
|
) {
|
||||||
command.additionalData.ids.forEach((id) => {
|
if ('responses' in message.data) {
|
||||||
this.handleModelingCommand(message, id, raw)
|
const batchResponse = message.data.responses as BatchResponseMap
|
||||||
})
|
// Iterate over the map of responses.
|
||||||
|
Object.entries(batchResponse).forEach(([key, response]) => {
|
||||||
|
// If the response is a success, we resolve the promise.
|
||||||
|
if ('response' in response && response.response) {
|
||||||
|
this.handleModelingCommand(
|
||||||
|
{
|
||||||
|
type: 'modeling',
|
||||||
|
data: {
|
||||||
|
modeling_response: response.response,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
key,
|
||||||
|
{
|
||||||
|
request_id: key,
|
||||||
|
resp: {
|
||||||
|
type: 'modeling',
|
||||||
|
data: {
|
||||||
|
modeling_response: response.response,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
success: true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else if ('errors' in response) {
|
||||||
|
this.handleFailedModelingCommand(key, {
|
||||||
|
request_id: key,
|
||||||
|
success: false,
|
||||||
|
errors: response.errors,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
command.additionalData.ids.forEach((id) => {
|
||||||
|
this.handleModelingCommand(message, id, raw)
|
||||||
|
})
|
||||||
|
}
|
||||||
// batch artifact is just a container, we don't need to keep it
|
// batch artifact is just a container, we don't need to keep it
|
||||||
// once we process all the commands inside it
|
// once we process all the commands inside it
|
||||||
const resolve = command.resolve
|
const resolve = command.resolve
|
||||||
@ -1401,7 +1446,6 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
id,
|
id,
|
||||||
commandType: command.commandType,
|
commandType: command.commandType,
|
||||||
range: command.range,
|
range: command.range,
|
||||||
data: modelingResponse,
|
|
||||||
raw,
|
raw,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@ -1422,6 +1466,9 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
|
|
||||||
if (command && command.type === 'pending') {
|
if (command && command.type === 'pending') {
|
||||||
const resolve = command.resolve
|
const resolve = command.resolve
|
||||||
|
const oldArtifact = this.artifactMap[id] as ArtifactMapCommand & {
|
||||||
|
extrusions?: string[]
|
||||||
|
}
|
||||||
const artifact = {
|
const artifact = {
|
||||||
type: 'result',
|
type: 'result',
|
||||||
range: command.range,
|
range: command.range,
|
||||||
@ -1430,7 +1477,10 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
parentId: command.parentId ? command.parentId : undefined,
|
parentId: command.parentId ? command.parentId : undefined,
|
||||||
data: modelingResponse,
|
data: modelingResponse,
|
||||||
raw,
|
raw,
|
||||||
} as const
|
} as ArtifactMapCommand & { extrusions?: string[] }
|
||||||
|
if (oldArtifact?.extrusions) {
|
||||||
|
artifact.extrusions = oldArtifact.extrusions
|
||||||
|
}
|
||||||
this.artifactMap[id] = artifact
|
this.artifactMap[id] = artifact
|
||||||
if (
|
if (
|
||||||
(command.commandType === 'entity_linear_pattern' &&
|
(command.commandType === 'entity_linear_pattern' &&
|
||||||
@ -1733,7 +1783,7 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
command: EngineCommand
|
command: EngineCommand
|
||||||
ast: Program
|
ast: Program
|
||||||
idToRangeMap?: { [key: string]: SourceRange }
|
idToRangeMap?: { [key: string]: SourceRange }
|
||||||
}): Promise<any> {
|
}): Promise<ResolveCommand | void> {
|
||||||
if (this.engineConnection === undefined) {
|
if (this.engineConnection === undefined) {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
@ -1802,11 +1852,13 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
command: Models['ModelingCmd_type'],
|
command: Models['ModelingCmd_type'],
|
||||||
ast?: Program,
|
ast?: Program,
|
||||||
range?: SourceRange
|
range?: SourceRange
|
||||||
) {
|
): Promise<ResolveCommand | void> {
|
||||||
let resolve: (val: any) => void = () => {}
|
let resolve: (val: any) => void = () => {}
|
||||||
const promise = new Promise((_resolve, reject) => {
|
const promise: Promise<ResolveCommand | void> = new Promise(
|
||||||
resolve = _resolve
|
(_resolve, reject) => {
|
||||||
})
|
resolve = _resolve
|
||||||
|
}
|
||||||
|
)
|
||||||
const getParentId = (): string | undefined => {
|
const getParentId = (): string | undefined => {
|
||||||
if (command.type === 'extend_path') return command.path
|
if (command.type === 'extend_path') return command.path
|
||||||
if (command.type === 'solid3d_get_extrusion_face_info') {
|
if (command.type === 'solid3d_get_extrusion_face_info') {
|
||||||
@ -1857,6 +1909,8 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
} else {
|
} else {
|
||||||
typedTarget.extrusions = [id]
|
typedTarget.extrusions = [id]
|
||||||
}
|
}
|
||||||
|
// Update in the map.
|
||||||
|
this.artifactMap[command.target] = typedTarget
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return promise
|
return promise
|
||||||
@ -1867,11 +1921,13 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
idToRangeMap?: { [key: string]: SourceRange },
|
idToRangeMap?: { [key: string]: SourceRange },
|
||||||
ast?: Program,
|
ast?: Program,
|
||||||
range?: SourceRange
|
range?: SourceRange
|
||||||
) {
|
): Promise<ResolveCommand | void> {
|
||||||
let resolve: (val: any) => void = () => {}
|
let resolve: (val: any) => void = () => {}
|
||||||
const promise = new Promise((_resolve, reject) => {
|
const promise: Promise<ResolveCommand | void> = new Promise(
|
||||||
resolve = _resolve
|
(_resolve, reject) => {
|
||||||
})
|
resolve = _resolve
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
if (!idToRangeMap) {
|
if (!idToRangeMap) {
|
||||||
throw new Error('idToRangeMap is required for batch commands')
|
throw new Error('idToRangeMap is required for batch commands')
|
||||||
@ -1891,7 +1947,7 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
resolve,
|
resolve,
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all(
|
Promise.all(
|
||||||
commands.map((c) =>
|
commands.map((c) =>
|
||||||
this.handlePendingCommand(c.cmd_id, c.cmd, ast, idToRangeMap[c.cmd_id])
|
this.handlePendingCommand(c.cmd_id, c.cmd, ast, idToRangeMap[c.cmd_id])
|
||||||
)
|
)
|
||||||
@ -1903,7 +1959,7 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
rangeStr: string,
|
rangeStr: string,
|
||||||
commandStr: string,
|
commandStr: string,
|
||||||
idToRangeStr: string
|
idToRangeStr: string
|
||||||
): Promise<any> {
|
): Promise<string | void> {
|
||||||
if (this.engineConnection === undefined) {
|
if (this.engineConnection === undefined) {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
@ -1932,13 +1988,13 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
command,
|
command,
|
||||||
ast: this.getAst(),
|
ast: this.getAst(),
|
||||||
idToRangeMap,
|
idToRangeMap,
|
||||||
}).then(({ raw }: { raw: WebSocketResponse | undefined | null }) => {
|
}).then((resp) => {
|
||||||
if (raw === undefined || raw === null) {
|
if (!resp) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'returning modeling cmd response to the rust side is undefined or null'
|
'returning modeling cmd response to the rust side is undefined or null'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return JSON.stringify(raw)
|
return JSON.stringify(resp.raw)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
commandResult(id: string): Promise<any> {
|
commandResult(id: string): Promise<any> {
|
||||||
|
@ -1583,7 +1583,10 @@ export function transformAstSketchLines({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const varName = varDec.id.name
|
const varName = varDec.id.name
|
||||||
const sketchGroup = programMemory.root?.[varName]
|
let sketchGroup = programMemory.root?.[varName]
|
||||||
|
if (sketchGroup.type === 'ExtrudeGroup') {
|
||||||
|
sketchGroup = sketchGroup.sketchGroup
|
||||||
|
}
|
||||||
if (!sketchGroup || sketchGroup.type !== 'SketchGroup')
|
if (!sketchGroup || sketchGroup.type !== 'SketchGroup')
|
||||||
throw new Error('not a sketch group')
|
throw new Error('not a sketch group')
|
||||||
const seg = getSketchSegmentFromPathToNode(
|
const seg = getSketchSegmentFromPathToNode(
|
||||||
|
@ -59,9 +59,11 @@ export function isCursorInSketchCommandRange(
|
|||||||
artifact.commandType === 'close_path')
|
artifact.commandType === 'close_path')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return overlapingEntries.length && overlapingEntries[0][1].parentId
|
let result =
|
||||||
? overlapingEntries[0][1].parentId
|
overlapingEntries.length && overlapingEntries[0][1].parentId
|
||||||
: overlapingEntries.find(
|
? overlapingEntries[0][1].parentId
|
||||||
([, artifact]) => artifact.commandType === 'start_path'
|
: overlapingEntries.find(
|
||||||
)?.[0] || false
|
([, artifact]) => artifact.commandType === 'start_path'
|
||||||
|
)?.[0] || false
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ import type { Program } from '../wasm-lib/kcl/bindings/Program'
|
|||||||
import type { Token } from '../wasm-lib/kcl/bindings/Token'
|
import type { Token } from '../wasm-lib/kcl/bindings/Token'
|
||||||
import { Coords2d } from './std/sketch'
|
import { Coords2d } from './std/sketch'
|
||||||
import { fileSystemManager } from 'lang/std/fileSystemManager'
|
import { fileSystemManager } from 'lang/std/fileSystemManager'
|
||||||
import { AppInfo } from 'wasm-lib/kcl/bindings/AppInfo'
|
import { CoreDumpInfo } from 'wasm-lib/kcl/bindings/CoreDumpInfo'
|
||||||
import { CoreDumpManager } from 'lib/coredump'
|
import { CoreDumpManager } from 'lib/coredump'
|
||||||
import openWindow from 'lib/openWindow'
|
import openWindow from 'lib/openWindow'
|
||||||
import { DefaultPlanes } from 'wasm-lib/kcl/bindings/DefaultPlanes'
|
import { DefaultPlanes } from 'wasm-lib/kcl/bindings/DefaultPlanes'
|
||||||
@ -74,8 +74,6 @@ export type SyntaxType =
|
|||||||
| 'UnaryExpression'
|
| 'UnaryExpression'
|
||||||
|
|
||||||
export type { SourceRange } from '../wasm-lib/kcl/bindings/SourceRange'
|
export type { SourceRange } from '../wasm-lib/kcl/bindings/SourceRange'
|
||||||
export type { Position } from '../wasm-lib/kcl/bindings/Position'
|
|
||||||
export type { Rotation } from '../wasm-lib/kcl/bindings/Rotation'
|
|
||||||
export type { Path } from '../wasm-lib/kcl/bindings/Path'
|
export type { Path } from '../wasm-lib/kcl/bindings/Path'
|
||||||
export type { SketchGroup } from '../wasm-lib/kcl/bindings/SketchGroup'
|
export type { SketchGroup } from '../wasm-lib/kcl/bindings/SketchGroup'
|
||||||
export type { ExtrudeGroup } from '../wasm-lib/kcl/bindings/ExtrudeGroup'
|
export type { ExtrudeGroup } from '../wasm-lib/kcl/bindings/ExtrudeGroup'
|
||||||
@ -335,14 +333,27 @@ export function programMemoryInit(): ProgramMemory {
|
|||||||
export async function coreDump(
|
export async function coreDump(
|
||||||
coreDumpManager: CoreDumpManager,
|
coreDumpManager: CoreDumpManager,
|
||||||
openGithubIssue: boolean = false
|
openGithubIssue: boolean = false
|
||||||
): Promise<AppInfo> {
|
): Promise<CoreDumpInfo> {
|
||||||
try {
|
try {
|
||||||
const dump: AppInfo = await coredump(coreDumpManager)
|
const dump: CoreDumpInfo = await coredump(coreDumpManager)
|
||||||
|
/* NOTE: this console output of the coredump should include the field
|
||||||
|
`github_issue_url` which is not in the uploaded coredump file.
|
||||||
|
`github_issue_url` is added after the file is uploaded
|
||||||
|
and is only needed for the openWindow operation which creates
|
||||||
|
a new GitHub issue for the user.
|
||||||
|
*/
|
||||||
if (openGithubIssue && dump.github_issue_url) {
|
if (openGithubIssue && dump.github_issue_url) {
|
||||||
openWindow(dump.github_issue_url)
|
openWindow(dump.github_issue_url)
|
||||||
|
} else {
|
||||||
|
console.error(
|
||||||
|
'github_issue_url undefined. Unable to create GitHub issue for coredump.'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
console.log('CoreDump: final coredump', dump)
|
||||||
|
console.log('CoreDump: final coredump JSON', JSON.stringify(dump))
|
||||||
return dump
|
return dump
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
console.error('CoreDump: error', e)
|
||||||
throw new Error(`Error getting core dump: ${e}`)
|
throw new Error(`Error getting core dump: ${e}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,15 @@ import screenshot from 'lib/screenshot'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { VITE_KC_API_BASE_URL } from 'env'
|
import { VITE_KC_API_BASE_URL } from 'env'
|
||||||
|
|
||||||
// This is a class for getting all the values from the JS world to pass to the Rust world
|
/**
|
||||||
// for a core dump.
|
* CoreDumpManager module
|
||||||
|
* - for getting all the values from the JS world to pass to the Rust world for a core dump.
|
||||||
|
* @module lib/coredump
|
||||||
|
* @class
|
||||||
|
*/
|
||||||
|
// CoreDumpManager is instantiated in ModelingMachineProvider and passed to coreDump() in wasm.ts
|
||||||
|
// The async function coreDump() handles any errors thrown in its Promise catch method and rethrows
|
||||||
|
// them to so the toast handler in ModelingMachineProvider can show the user an error message toast
|
||||||
export class CoreDumpManager {
|
export class CoreDumpManager {
|
||||||
engineCommandManager: EngineCommandManager
|
engineCommandManager: EngineCommandManager
|
||||||
htmlRef: React.RefObject<HTMLDivElement> | null
|
htmlRef: React.RefObject<HTMLDivElement> | null
|
||||||
@ -144,6 +151,293 @@ export class CoreDumpManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Currently just a placeholder to begin loading singleton and xstate data into
|
||||||
|
getClientState(): Promise<string> {
|
||||||
|
/**
|
||||||
|
* Deep clone a JavaScript Object
|
||||||
|
* - NOTE: this function throws on parse errors from things like circular references
|
||||||
|
* - It is also synchronous and could be more performant
|
||||||
|
* - There is a whole rabbit hole to explore here if you like.
|
||||||
|
* - This works for our use case.
|
||||||
|
* @param {object} obj - The object to clone.
|
||||||
|
*/
|
||||||
|
const deepClone = (obj: any) => JSON.parse(JSON.stringify(obj))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a function is private method
|
||||||
|
*/
|
||||||
|
const isPrivateMethod = (key: string) => {
|
||||||
|
return key.length && key[0] === '_'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Turn off verbose logging by default
|
||||||
|
const verboseLogging = false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle verbose debug logging of step-by-step client state coredump data
|
||||||
|
*/
|
||||||
|
const debugLog = verboseLogging ? console.log : () => {}
|
||||||
|
|
||||||
|
console.warn('CoreDump: Gathering client state')
|
||||||
|
|
||||||
|
// Initialize the clientState object
|
||||||
|
let clientState = {
|
||||||
|
// singletons
|
||||||
|
engine_command_manager: {
|
||||||
|
artifact_map: {},
|
||||||
|
command_logs: [],
|
||||||
|
engine_connection: { state: { type: '' } },
|
||||||
|
default_planes: {},
|
||||||
|
scene_command_artifacts: {},
|
||||||
|
},
|
||||||
|
kcl_manager: {
|
||||||
|
ast: {},
|
||||||
|
kcl_errors: [],
|
||||||
|
},
|
||||||
|
scene_infra: {},
|
||||||
|
scene_entities_manager: {},
|
||||||
|
editor_manager: {},
|
||||||
|
// xstate
|
||||||
|
auth_machine: {},
|
||||||
|
command_bar_machine: {},
|
||||||
|
file_machine: {},
|
||||||
|
home_machine: {},
|
||||||
|
modeling_machine: {},
|
||||||
|
settings_machine: {},
|
||||||
|
}
|
||||||
|
debugLog('CoreDump: initialized clientState', clientState)
|
||||||
|
debugLog('CoreDump: globalThis.window', globalThis.window)
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Singletons
|
||||||
|
|
||||||
|
// engine_command_manager
|
||||||
|
debugLog('CoreDump: engineCommandManager', this.engineCommandManager)
|
||||||
|
|
||||||
|
// artifact map - this.engineCommandManager.artifactMap
|
||||||
|
if (this.engineCommandManager?.artifactMap) {
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: Engine Command Manager artifact map',
|
||||||
|
this.engineCommandManager.artifactMap
|
||||||
|
)
|
||||||
|
clientState.engine_command_manager.artifact_map = deepClone(
|
||||||
|
this.engineCommandManager.artifactMap
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// command logs - this.engineCommandManager.commandLogs
|
||||||
|
if (this.engineCommandManager?.commandLogs) {
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: Engine Command Manager command logs',
|
||||||
|
this.engineCommandManager.commandLogs
|
||||||
|
)
|
||||||
|
clientState.engine_command_manager.command_logs = deepClone(
|
||||||
|
this.engineCommandManager.commandLogs
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// default planes - this.engineCommandManager.defaultPlanes
|
||||||
|
if (this.engineCommandManager?.defaultPlanes) {
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: Engine Command Manager default planes',
|
||||||
|
this.engineCommandManager.defaultPlanes
|
||||||
|
)
|
||||||
|
clientState.engine_command_manager.default_planes = deepClone(
|
||||||
|
this.engineCommandManager.defaultPlanes
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// engine connection state
|
||||||
|
if (this.engineCommandManager?.engineConnection?.state) {
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: Engine Command Manager engine connection state',
|
||||||
|
this.engineCommandManager.engineConnection.state
|
||||||
|
)
|
||||||
|
clientState.engine_command_manager.engine_connection.state =
|
||||||
|
this.engineCommandManager.engineConnection.state
|
||||||
|
}
|
||||||
|
|
||||||
|
// in sequence - this.engineCommandManager.inSequence
|
||||||
|
if (this.engineCommandManager?.inSequence) {
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: Engine Command Manager in sequence',
|
||||||
|
this.engineCommandManager.inSequence
|
||||||
|
)
|
||||||
|
;(clientState.engine_command_manager as any).in_sequence =
|
||||||
|
this.engineCommandManager.inSequence
|
||||||
|
}
|
||||||
|
|
||||||
|
// out sequence - this.engineCommandManager.outSequence
|
||||||
|
if (this.engineCommandManager?.outSequence) {
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: Engine Command Manager out sequence',
|
||||||
|
this.engineCommandManager.outSequence
|
||||||
|
)
|
||||||
|
;(clientState.engine_command_manager as any).out_sequence =
|
||||||
|
this.engineCommandManager.outSequence
|
||||||
|
}
|
||||||
|
|
||||||
|
// scene command artifacts - this.engineCommandManager.sceneCommandArtifacts
|
||||||
|
if (this.engineCommandManager?.sceneCommandArtifacts) {
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: Engine Command Manager scene command artifacts',
|
||||||
|
this.engineCommandManager.sceneCommandArtifacts
|
||||||
|
)
|
||||||
|
clientState.engine_command_manager.scene_command_artifacts = deepClone(
|
||||||
|
this.engineCommandManager.sceneCommandArtifacts
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// KCL Manager - globalThis?.window?.kclManager
|
||||||
|
const kclManager = (globalThis?.window as any)?.kclManager
|
||||||
|
debugLog('CoreDump: kclManager', kclManager)
|
||||||
|
|
||||||
|
if (kclManager) {
|
||||||
|
// KCL Manager AST
|
||||||
|
debugLog('CoreDump: KCL Manager AST', kclManager?.ast)
|
||||||
|
if (kclManager?.ast) {
|
||||||
|
clientState.kcl_manager.ast = deepClone(kclManager.ast)
|
||||||
|
}
|
||||||
|
|
||||||
|
// KCL Errors
|
||||||
|
debugLog('CoreDump: KCL Errors', kclManager?.kclErrors)
|
||||||
|
if (kclManager?.kclErrors) {
|
||||||
|
clientState.kcl_manager.kcl_errors = deepClone(kclManager.kclErrors)
|
||||||
|
}
|
||||||
|
|
||||||
|
// KCL isExecuting
|
||||||
|
debugLog('CoreDump: KCL isExecuting', kclManager?.isExecuting)
|
||||||
|
if (kclManager?.isExecuting) {
|
||||||
|
;(clientState.kcl_manager as any).isExecuting = kclManager.isExecuting
|
||||||
|
}
|
||||||
|
|
||||||
|
// KCL logs
|
||||||
|
debugLog('CoreDump: KCL logs', kclManager?.logs)
|
||||||
|
if (kclManager?.logs) {
|
||||||
|
;(clientState.kcl_manager as any).logs = deepClone(kclManager.logs)
|
||||||
|
}
|
||||||
|
|
||||||
|
// KCL programMemory
|
||||||
|
debugLog('CoreDump: KCL programMemory', kclManager?.programMemory)
|
||||||
|
if (kclManager?.programMemory) {
|
||||||
|
;(clientState.kcl_manager as any).programMemory = deepClone(
|
||||||
|
kclManager.programMemory
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// KCL wasmInitFailed
|
||||||
|
debugLog('CoreDump: KCL wasmInitFailed', kclManager?.wasmInitFailed)
|
||||||
|
if (kclManager?.wasmInitFailed) {
|
||||||
|
;(clientState.kcl_manager as any).wasmInitFailed =
|
||||||
|
kclManager.wasmInitFailed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Scene Infra - globalThis?.window?.sceneInfra
|
||||||
|
const sceneInfra = (globalThis?.window as any)?.sceneInfra
|
||||||
|
debugLog('CoreDump: Scene Infra', sceneInfra)
|
||||||
|
|
||||||
|
if (sceneInfra) {
|
||||||
|
const sceneInfraSkipKeys = ['camControls']
|
||||||
|
const sceneInfraKeys = Object.keys(sceneInfra)
|
||||||
|
.sort()
|
||||||
|
.filter((entry) => {
|
||||||
|
return (
|
||||||
|
typeof sceneInfra[entry] !== 'function' &&
|
||||||
|
!sceneInfraSkipKeys.includes(entry)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
debugLog('CoreDump: Scene Infra keys', sceneInfraKeys)
|
||||||
|
sceneInfraKeys.forEach((key: string) => {
|
||||||
|
debugLog('CoreDump: Scene Infra', key, sceneInfra[key])
|
||||||
|
try {
|
||||||
|
;(clientState.scene_infra as any)[key] = sceneInfra[key]
|
||||||
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
'CoreDump: unable to parse Scene Infra ' + key + ' data due to ',
|
||||||
|
error
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Scene Entities Manager - globalThis?.window?.sceneEntitiesManager
|
||||||
|
const sceneEntitiesManager = (globalThis?.window as any)
|
||||||
|
?.sceneEntitiesManager
|
||||||
|
debugLog('CoreDump: sceneEntitiesManager', sceneEntitiesManager)
|
||||||
|
|
||||||
|
if (sceneEntitiesManager) {
|
||||||
|
// Scene Entities Manager active segments
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: Scene Entities Manager active segments',
|
||||||
|
sceneEntitiesManager?.activeSegments
|
||||||
|
)
|
||||||
|
if (sceneEntitiesManager?.activeSegments) {
|
||||||
|
;(clientState.scene_entities_manager as any).activeSegments =
|
||||||
|
deepClone(sceneEntitiesManager.activeSegments)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Editor Manager - globalThis?.window?.editorManager
|
||||||
|
const editorManager = (globalThis?.window as any)?.editorManager
|
||||||
|
debugLog('CoreDump: editorManager', editorManager)
|
||||||
|
|
||||||
|
if (editorManager) {
|
||||||
|
const editorManagerSkipKeys = ['camControls']
|
||||||
|
const editorManagerKeys = Object.keys(editorManager)
|
||||||
|
.sort()
|
||||||
|
.filter((entry) => {
|
||||||
|
return (
|
||||||
|
typeof editorManager[entry] !== 'function' &&
|
||||||
|
!isPrivateMethod(entry) &&
|
||||||
|
!editorManagerSkipKeys.includes(entry)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
debugLog('CoreDump: Editor Manager keys', editorManagerKeys)
|
||||||
|
editorManagerKeys.forEach((key: string) => {
|
||||||
|
debugLog('CoreDump: Editor Manager', key, editorManager[key])
|
||||||
|
try {
|
||||||
|
;(clientState.editor_manager as any)[key] = deepClone(
|
||||||
|
editorManager[key]
|
||||||
|
)
|
||||||
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
'CoreDump: unable to parse Editor Manager ' +
|
||||||
|
key +
|
||||||
|
' data due to ',
|
||||||
|
error
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// enableMousePositionLogs - Not coredumped
|
||||||
|
// See https://github.com/KittyCAD/modeling-app/issues/2338#issuecomment-2136441998
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: enableMousePositionLogs [not coredumped]',
|
||||||
|
(globalThis?.window as any)?.enableMousePositionLogs
|
||||||
|
)
|
||||||
|
|
||||||
|
// XState Machines
|
||||||
|
debugLog(
|
||||||
|
'CoreDump: xstate services',
|
||||||
|
(globalThis?.window as any)?.__xstate__?.services
|
||||||
|
)
|
||||||
|
|
||||||
|
debugLog('CoreDump: final clientState', clientState)
|
||||||
|
|
||||||
|
const clientStateJson = JSON.stringify(clientState)
|
||||||
|
debugLog('CoreDump: final clientState JSON', clientStateJson)
|
||||||
|
|
||||||
|
return Promise.resolve(clientStateJson)
|
||||||
|
} catch (error) {
|
||||||
|
console.error('CoreDump: unable to return data due to ', error)
|
||||||
|
return Promise.reject(JSON.stringify(error))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Return a data URL (png format) of the screenshot of the current page.
|
// Return a data URL (png format) of the screenshot of the current page.
|
||||||
screenshot(): Promise<string> {
|
screenshot(): Promise<string> {
|
||||||
return screenshot(this.htmlRef)
|
return screenshot(this.htmlRef)
|
||||||
|
@ -16,6 +16,7 @@ import { Program } from 'lang/wasm'
|
|||||||
import {
|
import {
|
||||||
doesPipeHaveCallExp,
|
doesPipeHaveCallExp,
|
||||||
getNodeFromPath,
|
getNodeFromPath,
|
||||||
|
hasSketchPipeBeenExtruded,
|
||||||
isSingleCursorInPipe,
|
isSingleCursorInPipe,
|
||||||
} from 'lang/queryAst'
|
} from 'lang/queryAst'
|
||||||
import { CommandArgument } from './commandTypes'
|
import { CommandArgument } from './commandTypes'
|
||||||
@ -277,7 +278,7 @@ export function processCodeMirrorRanges({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSceneObjectColors(codeBasedSelections: Selection[]) {
|
export function updateSceneObjectColors(codeBasedSelections: Selection[]) {
|
||||||
let updated: Program
|
let updated: Program
|
||||||
try {
|
try {
|
||||||
updated = parse(recast(kclManager.ast))
|
updated = parse(recast(kclManager.ast))
|
||||||
@ -300,6 +301,7 @@ function updateSceneObjectColors(codeBasedSelections: Selection[]) {
|
|||||||
const groupHasCursor = codeBasedSelections.some((selection) => {
|
const groupHasCursor = codeBasedSelections.some((selection) => {
|
||||||
return isOverlap(selection.range, [node.start, node.end])
|
return isOverlap(selection.range, [node.start, node.end])
|
||||||
})
|
})
|
||||||
|
|
||||||
const color = groupHasCursor
|
const color = groupHasCursor
|
||||||
? 0x0000ff
|
? 0x0000ff
|
||||||
: segmentGroup?.userData?.baseColor || 0xffffff
|
: segmentGroup?.userData?.baseColor || 0xffffff
|
||||||
@ -387,6 +389,7 @@ export function canExtrudeSelection(selection: Selections) {
|
|||||||
)
|
)
|
||||||
return (
|
return (
|
||||||
!!isSketchPipe(selection) &&
|
!!isSketchPipe(selection) &&
|
||||||
|
commonNodes.every((n) => !hasSketchPipeBeenExtruded(n.selection, n.ast)) &&
|
||||||
commonNodes.every((n) => nodeHasClose(n)) &&
|
commonNodes.every((n) => nodeHasClose(n)) &&
|
||||||
commonNodes.every((n) => !nodeHasExtrude(n))
|
commonNodes.every((n) => !nodeHasExtrude(n))
|
||||||
)
|
)
|
||||||
|
@ -157,7 +157,7 @@ export function createSettings() {
|
|||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
enableSSAO: new Setting<boolean>({
|
enableSSAO: new Setting<boolean>({
|
||||||
defaultValue: true,
|
defaultValue: false,
|
||||||
description:
|
description:
|
||||||
'Whether or not Screen Space Ambient Occlusion (SSAO) is enabled',
|
'Whether or not Screen Space Ambient Occlusion (SSAO) is enabled',
|
||||||
validate: (v) => typeof v === 'boolean',
|
validate: (v) => typeof v === 'boolean',
|
||||||
|
@ -900,7 +900,10 @@ export const modelingMachine = createMachine(
|
|||||||
sceneInfra.modelingSend('Equip Line tool')
|
sceneInfra.modelingSend('Equip Line tool')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'setup client side sketch segments': ({ sketchDetails }) => {
|
'setup client side sketch segments': ({
|
||||||
|
sketchDetails,
|
||||||
|
selectionRanges,
|
||||||
|
}) => {
|
||||||
if (!sketchDetails) return
|
if (!sketchDetails) return
|
||||||
;(async () => {
|
;(async () => {
|
||||||
if (Object.keys(sceneEntitiesManager.activeSegments).length > 0) {
|
if (Object.keys(sceneEntitiesManager.activeSegments).length > 0) {
|
||||||
@ -913,6 +916,7 @@ export const modelingMachine = createMachine(
|
|||||||
up: sketchDetails.yAxis,
|
up: sketchDetails.yAxis,
|
||||||
position: sketchDetails.origin,
|
position: sketchDetails.origin,
|
||||||
maybeModdedAst: kclManager.ast,
|
maybeModdedAst: kclManager.ast,
|
||||||
|
selectionRanges,
|
||||||
})
|
})
|
||||||
sceneInfra.resetMouseListeners()
|
sceneInfra.resetMouseListeners()
|
||||||
sceneEntitiesManager.setupSketchIdleCallbacks({
|
sceneEntitiesManager.setupSketchIdleCallbacks({
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { OnboardingButtons, useDismiss, useNextClick } from '.'
|
import { OnboardingButtons, useDemoCode, useDismiss, useNextClick } from '.'
|
||||||
import { onboardingPaths } from 'routes/Onboarding/paths'
|
import { onboardingPaths } from 'routes/Onboarding/paths'
|
||||||
import { useStore } from '../../useStore'
|
import { useStore } from '../../useStore'
|
||||||
|
|
||||||
export default function CodeEditor() {
|
export default function OnboardingCodeEditor() {
|
||||||
|
useDemoCode()
|
||||||
const { buttonDownInStream } = useStore((s) => ({
|
const { buttonDownInStream } = useStore((s) => ({
|
||||||
buttonDownInStream: s.buttonDownInStream,
|
buttonDownInStream: s.buttonDownInStream,
|
||||||
}))
|
}))
|
||||||
|
@ -1,24 +1,19 @@
|
|||||||
import { OnboardingButtons, useDismiss } from '.'
|
import { OnboardingButtons, useDemoCode, useDismiss } from '.'
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { bracket } from 'lib/exampleKcl'
|
|
||||||
import { codeManager, kclManager } from 'lib/singletons'
|
|
||||||
import { useModelingContext } from 'hooks/useModelingContext'
|
import { useModelingContext } from 'hooks/useModelingContext'
|
||||||
import { APP_NAME } from 'lib/constants'
|
import { APP_NAME } from 'lib/constants'
|
||||||
import { onboardingPaths } from './paths'
|
import { onboardingPaths } from './paths'
|
||||||
|
import { sceneInfra } from 'lib/singletons'
|
||||||
|
|
||||||
export default function FutureWork() {
|
export default function FutureWork() {
|
||||||
const { send } = useModelingContext()
|
const { send } = useModelingContext()
|
||||||
const dismiss = useDismiss()
|
const dismiss = useDismiss()
|
||||||
|
|
||||||
|
// Reset the code, the camera, and the modeling state
|
||||||
|
useDemoCode()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// We do want to update both the state and editor here.
|
|
||||||
codeManager.updateCodeEditor(bracket)
|
|
||||||
if (kclManager.engineCommandManager.engineConnection?.isReady()) {
|
|
||||||
// If the engine is ready, promptly execute the loaded code
|
|
||||||
kclManager.executeCode(true, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
send({ type: 'Cancel' }) // in case the user hit 'Next' while still in sketch mode
|
send({ type: 'Cancel' }) // in case the user hit 'Next' while still in sketch mode
|
||||||
|
sceneInfra.camControls.resetCameraPosition()
|
||||||
}, [send])
|
}, [send])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
import { OnboardingButtons, kbdClasses, useDismiss, useNextClick } from '.'
|
import {
|
||||||
|
OnboardingButtons,
|
||||||
|
kbdClasses,
|
||||||
|
useDemoCode,
|
||||||
|
useDismiss,
|
||||||
|
useNextClick,
|
||||||
|
} from '.'
|
||||||
import { onboardingPaths } from 'routes/Onboarding/paths'
|
import { onboardingPaths } from 'routes/Onboarding/paths'
|
||||||
import { useStore } from '../../useStore'
|
import { useStore } from '../../useStore'
|
||||||
import { bracketWidthConstantLine } from 'lib/exampleKcl'
|
import { bracketWidthConstantLine } from 'lib/exampleKcl'
|
||||||
|
|
||||||
export default function InteractiveNumbers() {
|
export default function OnboardingInteractiveNumbers() {
|
||||||
|
useDemoCode()
|
||||||
const { buttonDownInStream } = useStore((s) => ({
|
const { buttonDownInStream } = useStore((s) => ({
|
||||||
buttonDownInStream: s.buttonDownInStream,
|
buttonDownInStream: s.buttonDownInStream,
|
||||||
}))
|
}))
|
||||||
@ -33,8 +40,10 @@ export default function InteractiveNumbers() {
|
|||||||
<kbd className={kbdClasses}>Option</kbd>) key
|
<kbd className={kbdClasses}>Option</kbd>) key
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Hover over the number assigned to <code>width</code> on line{' '}
|
Hover over the number assigned to "width" on{' '}
|
||||||
{bracketWidthConstantLine}
|
<em>
|
||||||
|
<strong>line {bracketWidthConstantLine}</strong>
|
||||||
|
</em>
|
||||||
</li>
|
</li>
|
||||||
<li>Drag the number left and right to change its value</li>
|
<li>Drag the number left and right to change its value</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { OnboardingButtons, useDismiss, useNextClick } from '.'
|
import { OnboardingButtons, useDemoCode, useDismiss, useNextClick } from '.'
|
||||||
import { onboardingPaths } from 'routes/Onboarding/paths'
|
import { onboardingPaths } from 'routes/Onboarding/paths'
|
||||||
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
||||||
import { Themes, getSystemTheme } from 'lib/theme'
|
import { Themes, getSystemTheme } from 'lib/theme'
|
||||||
@ -10,7 +10,6 @@ import {
|
|||||||
import { isTauri } from 'lib/isTauri'
|
import { isTauri } from 'lib/isTauri'
|
||||||
import { useNavigate } from 'react-router-dom'
|
import { useNavigate } from 'react-router-dom'
|
||||||
import { paths } from 'lib/paths'
|
import { paths } from 'lib/paths'
|
||||||
import { useEffect } from 'react'
|
|
||||||
import { codeManager, kclManager } from 'lib/singletons'
|
import { codeManager, kclManager } from 'lib/singletons'
|
||||||
import { join } from '@tauri-apps/api/path'
|
import { join } from '@tauri-apps/api/path'
|
||||||
import {
|
import {
|
||||||
@ -92,7 +91,7 @@ function OnboardingWithNewFile() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Introduction() {
|
export default function OnboardingIntroduction() {
|
||||||
const {
|
const {
|
||||||
settings: {
|
settings: {
|
||||||
state: {
|
state: {
|
||||||
@ -112,9 +111,7 @@ export default function Introduction() {
|
|||||||
const currentCode = codeManager.code
|
const currentCode = codeManager.code
|
||||||
const isStarterCode = currentCode === '' || currentCode === bracket
|
const isStarterCode = currentCode === '' || currentCode === bracket
|
||||||
|
|
||||||
useEffect(() => {
|
useDemoCode()
|
||||||
if (codeManager.code === '') codeManager.updateCodeEditor(bracket)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return isStarterCode ? (
|
return isStarterCode ? (
|
||||||
<div className="fixed inset-0 z-50 grid place-content-center bg-chalkboard-110/50">
|
<div className="fixed inset-0 z-50 grid place-content-center bg-chalkboard-110/50">
|
||||||
@ -159,6 +156,12 @@ export default function Introduction() {
|
|||||||
! We are trying to release as early as possible to get feedback from
|
! We are trying to release as early as possible to get feedback from
|
||||||
users like you.
|
users like you.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
As you go through the onboarding, we'll be changing and resetting
|
||||||
|
your code occasionally, so that we can reference specific code
|
||||||
|
features. So hold off on writing production KCL code until you're
|
||||||
|
done with the onboarding 😉
|
||||||
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<OnboardingButtons
|
<OnboardingButtons
|
||||||
currentSlug={onboardingPaths.INDEX}
|
currentSlug={onboardingPaths.INDEX}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { OnboardingButtons, useDismiss, useNextClick } from '.'
|
import { OnboardingButtons, useDemoCode, useDismiss, useNextClick } from '.'
|
||||||
import { onboardingPaths } from 'routes/Onboarding/paths'
|
import { onboardingPaths } from 'routes/Onboarding/paths'
|
||||||
import { useStore } from '../../useStore'
|
import { useStore } from '../../useStore'
|
||||||
import { Themes, getSystemTheme } from 'lib/theme'
|
import { Themes, getSystemTheme } from 'lib/theme'
|
||||||
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
||||||
import { bracketThicknessCalculationLine } from 'lib/exampleKcl'
|
import { bracketThicknessCalculationLine } from 'lib/exampleKcl'
|
||||||
|
|
||||||
export default function ParametricModeling() {
|
export default function OnboardingParametricModeling() {
|
||||||
|
useDemoCode()
|
||||||
const { buttonDownInStream } = useStore((s) => ({
|
const { buttonDownInStream } = useStore((s) => ({
|
||||||
buttonDownInStream: s.buttonDownInStream,
|
buttonDownInStream: s.buttonDownInStream,
|
||||||
}))
|
}))
|
||||||
@ -44,8 +45,10 @@ export default function ParametricModeling() {
|
|||||||
|
|
||||||
<p className="my-4">
|
<p className="my-4">
|
||||||
We've received this sketch from a designer highlighting an{' '}
|
We've received this sketch from a designer highlighting an{' '}
|
||||||
<em className="text-primary">aluminum bracket</em> they need for
|
<em>
|
||||||
this shelf:
|
<strong>aluminum bracket</strong>
|
||||||
|
</em>{' '}
|
||||||
|
they need for this shelf:
|
||||||
</p>
|
</p>
|
||||||
<figure className="my-4 w-2/3 mx-auto">
|
<figure className="my-4 w-2/3 mx-auto">
|
||||||
<img
|
<img
|
||||||
@ -59,8 +62,8 @@ export default function ParametricModeling() {
|
|||||||
<p className="my-4">
|
<p className="my-4">
|
||||||
We are able to easily calculate the thickness of the material based
|
We are able to easily calculate the thickness of the material based
|
||||||
on the width of the bracket to meet a set safety factor on{' '}
|
on the width of the bracket to meet a set safety factor on{' '}
|
||||||
<em className="text-primary">
|
<em>
|
||||||
line {bracketThicknessCalculationLine}
|
<strong>line {bracketThicknessCalculationLine}</strong>
|
||||||
</em>
|
</em>
|
||||||
.
|
.
|
||||||
</p>
|
</p>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { OnboardingButtons, useDismiss, useNextClick } from '.'
|
import { OnboardingButtons, useDismiss, useNextClick } from '.'
|
||||||
import { onboardingPaths } from 'routes/Onboarding/paths'
|
import { onboardingPaths } from 'routes/Onboarding/paths'
|
||||||
import { useStore } from '../../useStore'
|
import { useStore } from '../../useStore'
|
||||||
|
import { useEffect, useState } from 'react'
|
||||||
|
|
||||||
export default function UserMenu() {
|
export default function UserMenu() {
|
||||||
const { buttonDownInStream } = useStore((s) => ({
|
const { buttonDownInStream } = useStore((s) => ({
|
||||||
@ -8,6 +9,20 @@ export default function UserMenu() {
|
|||||||
}))
|
}))
|
||||||
const dismiss = useDismiss()
|
const dismiss = useDismiss()
|
||||||
const next = useNextClick(onboardingPaths.PROJECT_MENU)
|
const next = useNextClick(onboardingPaths.PROJECT_MENU)
|
||||||
|
const [avatarErrored, setAvatarErrored] = useState(false)
|
||||||
|
const buttonDescription = !avatarErrored ? 'your avatar' : 'the menu button'
|
||||||
|
|
||||||
|
// Set up error handling for the user's avatar image,
|
||||||
|
// so the onboarding text can be updated if it fails to load.
|
||||||
|
useEffect(() => {
|
||||||
|
const element = globalThis.document.querySelector(
|
||||||
|
'[data-testid="user-sidebar-toggle"] img'
|
||||||
|
)
|
||||||
|
|
||||||
|
if (element?.tagName === 'IMG') {
|
||||||
|
element.addEventListener('error', () => setAvatarErrored(true))
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed grid justify-center items-start inset-0 z-50 pointer-events-none">
|
<div className="fixed grid justify-center items-start inset-0 z-50 pointer-events-none">
|
||||||
@ -20,8 +35,8 @@ export default function UserMenu() {
|
|||||||
<section className="flex-1">
|
<section className="flex-1">
|
||||||
<h2 className="text-2xl font-bold">User Menu</h2>
|
<h2 className="text-2xl font-bold">User Menu</h2>
|
||||||
<p className="my-4">
|
<p className="my-4">
|
||||||
Click your avatar on the upper right to open the user menu. You can
|
Click {buttonDescription} in the upper right to open the user menu.
|
||||||
change your settings, sign out, or request a feature.
|
You can change your settings, sign out, or request a feature.
|
||||||
</p>
|
</p>
|
||||||
<p className="my-4">
|
<p className="my-4">
|
||||||
We only support global settings at the moment, but we are working to
|
We only support global settings at the moment, but we are working to
|
||||||
|