Compare commits
47 Commits
v0.22.2
...
wip-multi-
Author | SHA1 | Date | |
---|---|---|---|
0e02e95c55 | |||
3f343698a8 | |||
0bd9f42e17 | |||
aad29fca9f | |||
a8c1a14d48 | |||
8194f8b70b | |||
03e4f457d4 | |||
a94f0191b5 | |||
99655d623e | |||
4d7cac6c1d | |||
59ed422907 | |||
3b30ac7d39 | |||
226ed37c5f | |||
41a6ddd769 | |||
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 | |||
e42a891df8 | |||
98200565bf | |||
570fd827ed |
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
|
||||||
|
1
.gitignore
vendored
@ -17,6 +17,7 @@
|
|||||||
.env.development.local
|
.env.development.local
|
||||||
.env.test.local
|
.env.test.local
|
||||||
.env.production.local
|
.env.production.local
|
||||||
|
.direnv
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
|
@ -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
|
||||||
|
@ -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,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -405,17 +405,16 @@ test('Draft segments should look right', async ({ page, context }) => {
|
|||||||
// select a plane
|
// select a plane
|
||||||
await page.mouse.click(700, 200)
|
await page.mouse.click(700, 200)
|
||||||
|
|
||||||
await expect(page.locator('.cm-content')).toHaveText(
|
let code = `const sketch001 = startSketchOn('XZ')`
|
||||||
`const sketch001 = startSketchOn('XZ')`
|
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||||
)
|
|
||||||
|
|
||||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
await page.waitForTimeout(700) // TODO detect animation ending, or disable animation
|
||||||
|
|
||||||
const startXPx = 600
|
const startXPx = 600
|
||||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||||
await expect(page.locator('.cm-content'))
|
code += `
|
||||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
|> startProfileAt([7.19, -9.7], %)`
|
||||||
|> startProfileAt([9.06, -12.22], %)`)
|
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await u.closeDebugPanel()
|
await u.closeDebugPanel()
|
||||||
@ -427,10 +426,9 @@ test('Draft segments should look right', async ({ page, context }) => {
|
|||||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await expect(page.locator('.cm-content'))
|
code += `
|
||||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
|> line([7.25, 0], %)`
|
||||||
|> startProfileAt([9.06, -12.22], %)
|
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||||
|> line([9.14, 0], %)`)
|
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||||
|
|
||||||
@ -513,17 +511,16 @@ test.describe('Client side scene scale should match engine scale', () => {
|
|||||||
// select a plane
|
// select a plane
|
||||||
await page.mouse.click(700, 200)
|
await page.mouse.click(700, 200)
|
||||||
|
|
||||||
await expect(page.locator('.cm-content')).toHaveText(
|
let code = `const sketch001 = startSketchOn('XZ')`
|
||||||
`const sketch001 = startSketchOn('XZ')`
|
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||||
)
|
|
||||||
|
|
||||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
await page.waitForTimeout(600) // TODO detect animation ending, or disable animation
|
||||||
|
|
||||||
const startXPx = 600
|
const startXPx = 600
|
||||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||||
await expect(page.locator('.cm-content'))
|
code += `
|
||||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
|> startProfileAt([7.19, -9.7], %)`
|
||||||
|> startProfileAt([9.06, -12.22], %)`)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await u.closeDebugPanel()
|
await u.closeDebugPanel()
|
||||||
@ -531,21 +528,18 @@ test.describe('Client side scene scale should match engine scale', () => {
|
|||||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await expect(page.locator('.cm-content'))
|
code += `
|
||||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
|> line([7.25, 0], %)`
|
||||||
|> startProfileAt([9.06, -12.22], %)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
|> line([9.14, 0], %)`)
|
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
|
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
|
||||||
|
|
||||||
await expect(page.locator('.cm-content'))
|
code += `
|
||||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
|> tangentialArcTo([21.7, -2.44], %)`
|
||||||
|> startProfileAt([9.06, -12.22], %)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
|> line([9.14, 0], %)
|
|
||||||
|> tangentialArcTo([27.34, -3.08], %)`)
|
|
||||||
|
|
||||||
// click tangential arc tool again to unequip it
|
// click tangential arc tool again to unequip it
|
||||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||||
@ -616,17 +610,16 @@ test.describe('Client side scene scale should match engine scale', () => {
|
|||||||
// select a plane
|
// select a plane
|
||||||
await page.mouse.click(700, 200)
|
await page.mouse.click(700, 200)
|
||||||
|
|
||||||
await expect(page.locator('.cm-content')).toHaveText(
|
let code = `const sketch001 = startSketchOn('XZ')`
|
||||||
`const sketch001 = startSketchOn('XZ')`
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
)
|
|
||||||
|
|
||||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
await page.waitForTimeout(600) // TODO detect animation ending, or disable animation
|
||||||
|
|
||||||
const startXPx = 600
|
const startXPx = 600
|
||||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||||
await expect(page.locator('.cm-content'))
|
code += `
|
||||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
|> startProfileAt([182.59, -246.32], %)`
|
||||||
|> startProfileAt([230.03, -310.32], %)`)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await u.closeDebugPanel()
|
await u.closeDebugPanel()
|
||||||
@ -634,21 +627,18 @@ test.describe('Client side scene scale should match engine scale', () => {
|
|||||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await expect(page.locator('.cm-content'))
|
code += `
|
||||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
|> line([184.3, 0], %)`
|
||||||
|> startProfileAt([230.03, -310.32], %)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
|> line([232.2, 0], %)`)
|
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
|
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
|
||||||
|
|
||||||
await expect(page.locator('.cm-content'))
|
code += `
|
||||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
|> tangentialArcTo([551.2, -62.01], %)`
|
||||||
|> startProfileAt([230.03, -310.32], %)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
|> line([232.2, 0], %)
|
|
||||||
|> tangentialArcTo([694.43, -78.12], %)`)
|
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 36 KiB |
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()
|
||||||
@ -132,8 +139,8 @@ export const getMovementUtils = (opts: any) => {
|
|||||||
// NOTE: these pretty much can't be perfect because of screen scaling.
|
// NOTE: these pretty much can't be perfect because of screen scaling.
|
||||||
// Handle on a case-by-case.
|
// Handle on a case-by-case.
|
||||||
const toU = (x: number, y: number) => [
|
const toU = (x: number, y: number) => [
|
||||||
kcRound(x * 0.0854),
|
kcRound(x * 0.0678),
|
||||||
kcRound(-y * 0.0854), // Y is inverted in our coordinate system
|
kcRound(-y * 0.0678), // Y is inverted in our coordinate system
|
||||||
]
|
]
|
||||||
|
|
||||||
// Turn the array into a string with specific formatting
|
// Turn the array into a string with specific formatting
|
||||||
@ -226,6 +233,7 @@ export async function getUtils(page: Page) {
|
|||||||
.boundingBox()
|
.boundingBox()
|
||||||
.then((box) => ({ ...box, x: box?.x || 0, y: box?.y || 0 })),
|
.then((box) => ({ ...box, x: box?.x || 0, y: box?.y || 0 })),
|
||||||
codeLocator: page.locator('.cm-content'),
|
codeLocator: page.locator('.cm-content'),
|
||||||
|
canvasLocator: page.getByTestId('client-side-scene'),
|
||||||
doAndWaitForCmd: async (
|
doAndWaitForCmd: async (
|
||||||
fn: () => Promise<void>,
|
fn: () => Promise<void>,
|
||||||
commandType: string,
|
commandType: string,
|
||||||
|
@ -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)
|
||||||
|
}
|
62
flake.lock
generated
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1718470082,
|
||||||
|
"narHash": "sha256-u2F0MMYE+Efc+ocruTbtU/wWHuYHWcJafp5zJ++n/YE=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "3027ba73dfef68eb555fc2fa97aed4e999e74f97",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1718428119,
|
||||||
|
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1718681902,
|
||||||
|
"narHash": "sha256-E/T7Ge6ayEQe7FVKMJqDBoHyLhRhjc6u9CmU8MyYfy0=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "16c8ad83297c278eebe740dea5491c1708960dd1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
70
flake.nix
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
description = "modeling-app development environment";
|
||||||
|
|
||||||
|
# Flake inputs
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix
|
||||||
|
};
|
||||||
|
|
||||||
|
# Flake outputs
|
||||||
|
outputs = { self, nixpkgs, rust-overlay }:
|
||||||
|
let
|
||||||
|
# Overlays enable you to customize the Nixpkgs attribute set
|
||||||
|
overlays = [
|
||||||
|
# Makes a `rust-bin` attribute available in Nixpkgs
|
||||||
|
(import rust-overlay)
|
||||||
|
# Provides a `rustToolchain` attribute for Nixpkgs that we can use to
|
||||||
|
# create a Rust environment
|
||||||
|
(self: super: {
|
||||||
|
rustToolchain = super. rust-bin.stable.latest.default.override {
|
||||||
|
targets = [ "wasm32-unknown-unknown" ];
|
||||||
|
extensions = [ "rustfmt" "llvm-tools-preview" ];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
# Systems supported
|
||||||
|
allSystems = [
|
||||||
|
"x86_64-linux" # 64-bit Intel/AMD Linux
|
||||||
|
"aarch64-linux" # 64-bit ARM Linux
|
||||||
|
"x86_64-darwin" # 64-bit Intel macOS
|
||||||
|
"aarch64-darwin" # 64-bit ARM macOS
|
||||||
|
];
|
||||||
|
|
||||||
|
# Helper to provide system-specific attributes
|
||||||
|
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
|
||||||
|
pkgs = import nixpkgs { inherit overlays system; };
|
||||||
|
});
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Development environment output
|
||||||
|
devShells = forAllSystems ({ pkgs }: {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
# The Nix packages provided in the environment
|
||||||
|
packages = (with pkgs; [
|
||||||
|
# The package provided by our custom overlay. Includes cargo, Clippy, cargo-fmt,
|
||||||
|
# rustdoc, rustfmt, and other tools.
|
||||||
|
rustToolchain
|
||||||
|
|
||||||
|
cargo-llvm-cov
|
||||||
|
cargo-nextest
|
||||||
|
|
||||||
|
just
|
||||||
|
postgresql.lib
|
||||||
|
openssl
|
||||||
|
pkg-config
|
||||||
|
|
||||||
|
nodejs_22
|
||||||
|
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
|
||||||
|
libiconv
|
||||||
|
darwin.apple_sdk.frameworks.Security
|
||||||
|
]);
|
||||||
|
|
||||||
|
TARGET_CC = "${pkgs.stdenv.cc}/bin/${pkgs.stdenv.cc.targetPrefix}cc";
|
||||||
|
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "untitled-app",
|
"name": "untitled-app",
|
||||||
"version": "0.22.2",
|
"version": "0.22.5",
|
||||||
"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.5"
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ export function App() {
|
|||||||
/>
|
/>
|
||||||
<ModalContainer />
|
<ModalContainer />
|
||||||
<ModelingSidebar paneOpacity={paneOpacity} />
|
<ModelingSidebar paneOpacity={paneOpacity} />
|
||||||
<Stream className="absolute inset-0 z-0" />
|
<Stream />
|
||||||
{/* <CamToggle /> */}
|
{/* <CamToggle /> */}
|
||||||
<LowerRightControls>
|
<LowerRightControls>
|
||||||
<Gizmo />
|
<Gizmo />
|
||||||
|
@ -174,41 +174,6 @@ export class CameraControls {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throttledUpdateEngineFov = throttle(
|
|
||||||
(vals: {
|
|
||||||
position: Vector3
|
|
||||||
quaternion: Quaternion
|
|
||||||
zoom: number
|
|
||||||
fov: number
|
|
||||||
target: Vector3
|
|
||||||
}) => {
|
|
||||||
const cmd: EngineCommand = {
|
|
||||||
type: 'modeling_cmd_req',
|
|
||||||
cmd_id: uuidv4(),
|
|
||||||
cmd: {
|
|
||||||
type: 'default_camera_perspective_settings',
|
|
||||||
...convertThreeCamValuesToEngineCam({
|
|
||||||
...vals,
|
|
||||||
isPerspective: true,
|
|
||||||
}),
|
|
||||||
fov_y: vals.fov,
|
|
||||||
...calculateNearFarFromFOV(vals.fov),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
this.engineCommandManager.sendSceneCommand(cmd)
|
|
||||||
this.lastPerspectiveCmd = cmd
|
|
||||||
this.lastPerspectiveCmdTime = Date.now()
|
|
||||||
if (this.lastPerspectiveCmdTimeoutId !== null) {
|
|
||||||
clearTimeout(this.lastPerspectiveCmdTimeoutId)
|
|
||||||
}
|
|
||||||
this.lastPerspectiveCmdTimeoutId = setTimeout(
|
|
||||||
this.sendLastPerspectiveReliableChannel,
|
|
||||||
lastCmdDelay
|
|
||||||
) as any as number
|
|
||||||
},
|
|
||||||
1000 / 30
|
|
||||||
)
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
isOrtho = false,
|
isOrtho = false,
|
||||||
domElement: HTMLCanvasElement,
|
domElement: HTMLCanvasElement,
|
||||||
@ -534,26 +499,28 @@ export class CameraControls {
|
|||||||
direction.normalize()
|
direction.normalize()
|
||||||
this.camera.position.copy(this.target).addScaledVector(direction, distance)
|
this.camera.position.copy(this.target).addScaledVector(direction, distance)
|
||||||
}
|
}
|
||||||
usePerspectiveCamera = () => {
|
usePerspectiveCamera = async () => {
|
||||||
this._usePerspectiveCamera()
|
this._usePerspectiveCamera()
|
||||||
this.engineCommandManager.sendSceneCommand({
|
if (this.syncDirection === 'clientToEngine') {
|
||||||
type: 'modeling_cmd_req',
|
await this.engineCommandManager.sendSceneCommand({
|
||||||
cmd_id: uuidv4(),
|
type: 'modeling_cmd_req',
|
||||||
cmd: {
|
cmd_id: uuidv4(),
|
||||||
type: 'default_camera_set_perspective',
|
cmd: {
|
||||||
parameters: {
|
type: 'default_camera_set_perspective',
|
||||||
fov_y:
|
parameters: {
|
||||||
this.camera instanceof PerspectiveCamera ? this.camera.fov : 45,
|
fov_y:
|
||||||
...calculateNearFarFromFOV(this.lastPerspectiveFov),
|
this.camera instanceof PerspectiveCamera ? this.camera.fov : 45,
|
||||||
|
...calculateNearFarFromFOV(this.lastPerspectiveFov),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
})
|
||||||
})
|
}
|
||||||
this.onCameraChange()
|
this.onCameraChange()
|
||||||
this.update()
|
this.update()
|
||||||
return this.camera
|
return this.camera
|
||||||
}
|
}
|
||||||
|
|
||||||
dollyZoom = (newFov: number) => {
|
dollyZoom = async (newFov: number, splitEngineCalls = false) => {
|
||||||
if (!(this.camera instanceof PerspectiveCamera)) {
|
if (!(this.camera instanceof PerspectiveCamera)) {
|
||||||
console.warn('Dolly zoom is only applicable to perspective cameras.')
|
console.warn('Dolly zoom is only applicable to perspective cameras.')
|
||||||
return
|
return
|
||||||
@ -604,13 +571,52 @@ export class CameraControls {
|
|||||||
this.camera.near = z_near
|
this.camera.near = z_near
|
||||||
this.camera.far = z_far
|
this.camera.far = z_far
|
||||||
|
|
||||||
this.throttledUpdateEngineFov({
|
if (splitEngineCalls) {
|
||||||
fov: newFov,
|
await this.engineCommandManager.sendSceneCommand({
|
||||||
position: newPosition,
|
type: 'modeling_cmd_req',
|
||||||
quaternion: this.camera.quaternion,
|
cmd_id: uuidv4(),
|
||||||
zoom: this.camera.zoom,
|
cmd: {
|
||||||
target: this.target,
|
type: 'default_camera_look_at',
|
||||||
})
|
...convertThreeCamValuesToEngineCam({
|
||||||
|
isPerspective: true,
|
||||||
|
position: newPosition,
|
||||||
|
quaternion: this.camera.quaternion,
|
||||||
|
zoom: this.camera.zoom,
|
||||||
|
target: this.target,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
await this.engineCommandManager.sendSceneCommand({
|
||||||
|
type: 'modeling_cmd_req',
|
||||||
|
cmd_id: uuidv4(),
|
||||||
|
cmd: {
|
||||||
|
type: 'default_camera_set_perspective',
|
||||||
|
parameters: {
|
||||||
|
fov_y: newFov,
|
||||||
|
z_near: 0.01,
|
||||||
|
z_far: 1000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
await this.engineCommandManager.sendSceneCommand({
|
||||||
|
type: 'modeling_cmd_req',
|
||||||
|
cmd_id: uuidv4(),
|
||||||
|
cmd: {
|
||||||
|
type: 'default_camera_perspective_settings',
|
||||||
|
...convertThreeCamValuesToEngineCam({
|
||||||
|
isPerspective: true,
|
||||||
|
position: newPosition,
|
||||||
|
quaternion: this.camera.quaternion,
|
||||||
|
zoom: this.camera.zoom,
|
||||||
|
target: this.target,
|
||||||
|
}),
|
||||||
|
fov_y: newFov,
|
||||||
|
z_near: 0.01,
|
||||||
|
z_far: 1000,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update = (forceUpdate = false) => {
|
update = (forceUpdate = false) => {
|
||||||
@ -1015,6 +1021,29 @@ export class CameraControls {
|
|||||||
.onComplete(onComplete)
|
.onComplete(onComplete)
|
||||||
.start()
|
.start()
|
||||||
})
|
})
|
||||||
|
snapToPerspectiveBeforeHandingBackControlToEngine = async (
|
||||||
|
targetCamUp = new Vector3(0, 0, 1)
|
||||||
|
) => {
|
||||||
|
if (this.syncDirection === 'engineToClient') {
|
||||||
|
console.warn(
|
||||||
|
'animate To Perspective not design to work with engineToClient syncDirection.'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
this.isFovAnimationInProgress = true
|
||||||
|
const targetFov = this.fovBeforeOrtho // Target FOV for perspective
|
||||||
|
this.lastPerspectiveFov = 4
|
||||||
|
let currentFov = 4
|
||||||
|
const initialCameraUp = this.camera.up.clone()
|
||||||
|
this.usePerspectiveCamera()
|
||||||
|
const tempVec = new Vector3()
|
||||||
|
|
||||||
|
currentFov = this.lastPerspectiveFov + (targetFov - this.lastPerspectiveFov)
|
||||||
|
const currentUp = tempVec.lerpVectors(initialCameraUp, targetCamUp, 1)
|
||||||
|
this.camera.up.copy(currentUp)
|
||||||
|
await this.dollyZoom(currentFov, true)
|
||||||
|
|
||||||
|
this.isFovAnimationInProgress = false
|
||||||
|
}
|
||||||
|
|
||||||
get reactCameraProperties(): ReactCameraProperties {
|
get reactCameraProperties(): ReactCameraProperties {
|
||||||
return {
|
return {
|
||||||
@ -1087,7 +1116,7 @@ function calculateNearFarFromFOV(fov: number) {
|
|||||||
// const nearFarRatio = (fov - 3) / (45 - 3)
|
// const nearFarRatio = (fov - 3) / (45 - 3)
|
||||||
// const z_near = 0.1 + nearFarRatio * (5 - 0.1)
|
// const z_near = 0.1 + nearFarRatio * (5 - 0.1)
|
||||||
// const z_far = 1000 + nearFarRatio * (100000 - 1000)
|
// const z_far = 1000 + nearFarRatio * (100000 - 1000)
|
||||||
return { z_near: 0.1, z_far: 1000 }
|
return { z_near: 0.01, z_far: 1000 }
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertThreeCamValuesToEngineCam({
|
function convertThreeCamValuesToEngineCam({
|
||||||
@ -1106,11 +1135,6 @@ function convertThreeCamValuesToEngineCam({
|
|||||||
// leaving for now since it's working but maybe revisit later
|
// leaving for now since it's working but maybe revisit later
|
||||||
const euler = new Euler().setFromQuaternion(quaternion, 'XYZ')
|
const euler = new Euler().setFromQuaternion(quaternion, 'XYZ')
|
||||||
|
|
||||||
const lookAtVector = new Vector3(0, 0, -1)
|
|
||||||
.applyEuler(euler)
|
|
||||||
.normalize()
|
|
||||||
.add(position)
|
|
||||||
|
|
||||||
const upVector = new Vector3(0, 1, 0).applyEuler(euler).normalize()
|
const upVector = new Vector3(0, 1, 0).applyEuler(euler).normalize()
|
||||||
if (isPerspective) {
|
if (isPerspective) {
|
||||||
return {
|
return {
|
||||||
@ -1119,6 +1143,10 @@ function convertThreeCamValuesToEngineCam({
|
|||||||
vantage: position,
|
vantage: position,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const lookAtVector = new Vector3(0, 0, -1)
|
||||||
|
.applyEuler(euler)
|
||||||
|
.normalize()
|
||||||
|
.add(position)
|
||||||
const fudgeFactor2 = zoom * 0.9979224466814468 - 0.03473692325839295
|
const fudgeFactor2 = zoom * 0.9979224466814468 - 0.03473692325839295
|
||||||
const zoomFactor = (-ZOOM_MAGIC_NUMBER + fudgeFactor2) / zoom
|
const zoomFactor = (-ZOOM_MAGIC_NUMBER + fudgeFactor2) / zoom
|
||||||
const direction = lookAtVector.clone().sub(position).normalize()
|
const direction = lookAtVector.clone().sub(position).normalize()
|
||||||
|
@ -136,6 +136,7 @@ export const ClientSideScene = ({
|
|||||||
<div
|
<div
|
||||||
ref={canvasRef}
|
ref={canvasRef}
|
||||||
style={{ cursor: cursor }}
|
style={{ cursor: cursor }}
|
||||||
|
data-testid="client-side-scene"
|
||||||
className={`absolute inset-0 h-full w-full transition-all duration-300 ${
|
className={`absolute inset-0 h-full w-full transition-all duration-300 ${
|
||||||
hideClient ? 'opacity-0' : 'opacity-100'
|
hideClient ? 'opacity-0' : 'opacity-100'
|
||||||
} ${hideServer ? 'bg-chalkboard-10 dark:bg-chalkboard-100' : ''} ${
|
} ${hideServer ? 'bg-chalkboard-10 dark:bg-chalkboard-100' : ''} ${
|
||||||
|
@ -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({
|
||||||
@ -1329,13 +1335,6 @@ export class SceneEntities {
|
|||||||
to,
|
to,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
async animateAfterSketch() {
|
|
||||||
// if (isReducedMotion()) {
|
|
||||||
// sceneInfra.camControls.usePerspectiveCamera()
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
await sceneInfra.camControls.animateToPerspective()
|
|
||||||
}
|
|
||||||
removeSketchGrid() {
|
removeSketchGrid() {
|
||||||
if (this.axisGroup) this.scene.remove(this.axisGroup)
|
if (this.axisGroup) this.scene.remove(this.axisGroup)
|
||||||
}
|
}
|
||||||
@ -1399,114 +1398,133 @@ export class SceneEntities {
|
|||||||
selected.material.color = defaultPlaneColor(type)
|
selected.material.color = defaultPlaneColor(type)
|
||||||
},
|
},
|
||||||
onClick: async (args) => {
|
onClick: async (args) => {
|
||||||
const checkExtrudeFaceClick = async (): Promise<
|
const { streamDimensions } = useStore.getState()
|
||||||
['face' | 'plane' | 'other', string]
|
const { entity_id } = await sendSelectEventToEngine(
|
||||||
> => {
|
args?.mouseEvent,
|
||||||
const { streamDimensions } = useStore.getState()
|
document.getElementById('video-stream') as HTMLVideoElement,
|
||||||
const { entity_id } = await sendSelectEventToEngine(
|
streamDimensions
|
||||||
args?.mouseEvent,
|
)
|
||||||
document.getElementById('video-stream') as HTMLVideoElement,
|
|
||||||
streamDimensions
|
let _entity_id = entity_id
|
||||||
)
|
if (!_entity_id) return
|
||||||
if (!entity_id) return ['other', '']
|
if (
|
||||||
if (
|
engineCommandManager.defaultPlanes?.xy === _entity_id ||
|
||||||
engineCommandManager.defaultPlanes?.xy === entity_id ||
|
engineCommandManager.defaultPlanes?.xz === _entity_id ||
|
||||||
engineCommandManager.defaultPlanes?.xz === entity_id ||
|
engineCommandManager.defaultPlanes?.yz === _entity_id ||
|
||||||
engineCommandManager.defaultPlanes?.yz === entity_id
|
engineCommandManager.defaultPlanes?.negXy === _entity_id ||
|
||||||
) {
|
engineCommandManager.defaultPlanes?.negXz === _entity_id ||
|
||||||
return ['plane', entity_id]
|
engineCommandManager.defaultPlanes?.negYz === _entity_id
|
||||||
|
) {
|
||||||
|
const defaultPlaneStrMap: Record<string, DefaultPlaneStr> = {
|
||||||
|
[engineCommandManager.defaultPlanes.xy]: 'XY',
|
||||||
|
[engineCommandManager.defaultPlanes.xz]: 'XZ',
|
||||||
|
[engineCommandManager.defaultPlanes.yz]: 'YZ',
|
||||||
|
[engineCommandManager.defaultPlanes.negXy]: '-XY',
|
||||||
|
[engineCommandManager.defaultPlanes.negXz]: '-XZ',
|
||||||
|
[engineCommandManager.defaultPlanes.negYz]: '-YZ',
|
||||||
}
|
}
|
||||||
const artifact = this.engineCommandManager.artifactMap[entity_id]
|
// TODO can we get this information from rust land when it creates the default planes?
|
||||||
// If we clicked on an extrude wall, we climb up the parent Id
|
// maybe returned from make_default_planes (src/wasm-lib/src/wasm.rs)
|
||||||
// to get the sketch profile's face ID. If we clicked on an endcap,
|
let zAxis: [number, number, number] = [0, 0, 1]
|
||||||
// we already have it.
|
let yAxis: [number, number, number] = [0, 1, 0]
|
||||||
const targetId =
|
|
||||||
'additionalData' in artifact &&
|
|
||||||
artifact.additionalData?.type === 'cap'
|
|
||||||
? entity_id
|
|
||||||
: artifact.parentId
|
|
||||||
|
|
||||||
// tsc cannot infer that target can have extrusions
|
// get unit vector from camera position to target
|
||||||
// from the commandType (why?) so we need to cast it
|
const camVector = sceneInfra.camControls.camera.position
|
||||||
const target = this.engineCommandManager.artifactMap?.[
|
.clone()
|
||||||
targetId || ''
|
.sub(sceneInfra.camControls.target)
|
||||||
] as ArtifactMapCommand & { extrusions?: string[] }
|
|
||||||
|
|
||||||
// TODO: We get the first extrusion command ID,
|
if (engineCommandManager.defaultPlanes?.xy === _entity_id) {
|
||||||
// which is fine while backend systems only support one extrusion.
|
zAxis = [0, 0, 1]
|
||||||
// but we need to more robustly handle resolving to the correct extrusion
|
yAxis = [0, 1, 0]
|
||||||
// if there are multiple.
|
if (camVector.z < 0) {
|
||||||
const extrusions =
|
zAxis = [0, 0, -1]
|
||||||
this.engineCommandManager.artifactMap?.[
|
_entity_id = engineCommandManager.defaultPlanes?.negXy || ''
|
||||||
target?.extrusions?.[0] || ''
|
}
|
||||||
]
|
} else if (engineCommandManager.defaultPlanes?.yz === _entity_id) {
|
||||||
|
zAxis = [1, 0, 0]
|
||||||
if (artifact?.commandType !== 'solid3d_get_extrusion_face_info')
|
yAxis = [0, 0, 1]
|
||||||
return ['other', entity_id]
|
if (camVector.x < 0) {
|
||||||
|
zAxis = [-1, 0, 0]
|
||||||
const faceInfo = await getFaceDetails(entity_id)
|
_entity_id = engineCommandManager.defaultPlanes?.negYz || ''
|
||||||
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis)
|
}
|
||||||
return ['other', entity_id]
|
} else if (engineCommandManager.defaultPlanes?.xz === _entity_id) {
|
||||||
const { z_axis, y_axis, origin } = faceInfo
|
zAxis = [0, 1, 0]
|
||||||
const sketchPathToNode = getNodePathFromSourceRange(
|
yAxis = [0, 0, 1]
|
||||||
kclManager.ast,
|
_entity_id = engineCommandManager.defaultPlanes?.negXz || ''
|
||||||
artifact.range
|
if (camVector.y < 0) {
|
||||||
)
|
zAxis = [0, -1, 0]
|
||||||
const extrudePathToNode = extrusions?.range
|
_entity_id = engineCommandManager.defaultPlanes?.xz || ''
|
||||||
? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
|
}
|
||||||
: []
|
}
|
||||||
|
|
||||||
sceneInfra.modelingSend({
|
sceneInfra.modelingSend({
|
||||||
type: 'Select default plane',
|
type: 'Select default plane',
|
||||||
data: {
|
data: {
|
||||||
type: 'extrudeFace',
|
type: 'defaultPlane',
|
||||||
zAxis: [z_axis.x, z_axis.y, z_axis.z],
|
planeId: _entity_id,
|
||||||
yAxis: [y_axis.x, y_axis.y, y_axis.z],
|
plane: defaultPlaneStrMap[_entity_id],
|
||||||
position: [origin.x, origin.y, origin.z].map(
|
zAxis,
|
||||||
(num) => num / sceneInfra._baseUnitMultiplier
|
yAxis,
|
||||||
) as [number, number, number],
|
|
||||||
sketchPathToNode,
|
|
||||||
extrudePathToNode,
|
|
||||||
cap:
|
|
||||||
artifact?.additionalData?.type === 'cap'
|
|
||||||
? artifact.additionalData.info
|
|
||||||
: 'none',
|
|
||||||
faceId: entity_id,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return ['face', entity_id]
|
return
|
||||||
}
|
}
|
||||||
|
const artifact = this.engineCommandManager.artifactMap[_entity_id]
|
||||||
|
// If we clicked on an extrude wall, we climb up the parent Id
|
||||||
|
// to get the sketch profile's face ID. If we clicked on an endcap,
|
||||||
|
// we already have it.
|
||||||
|
const targetId =
|
||||||
|
'additionalData' in artifact &&
|
||||||
|
artifact.additionalData?.type === 'cap'
|
||||||
|
? _entity_id
|
||||||
|
: artifact.parentId
|
||||||
|
|
||||||
const faceResult = await checkExtrudeFaceClick()
|
// tsc cannot infer that target can have extrusions
|
||||||
if (faceResult[0] === 'face') return
|
// from the commandType (why?) so we need to cast it
|
||||||
|
const target = this.engineCommandManager.artifactMap?.[
|
||||||
|
targetId || ''
|
||||||
|
] as ArtifactMapCommand & { extrusions?: string[] }
|
||||||
|
|
||||||
|
// TODO: We get the first extrusion command ID,
|
||||||
|
// which is fine while backend systems only support one extrusion.
|
||||||
|
// but we need to more robustly handle resolving to the correct extrusion
|
||||||
|
// if there are multiple.
|
||||||
|
const extrusions =
|
||||||
|
this.engineCommandManager.artifactMap?.[target?.extrusions?.[0] || '']
|
||||||
|
|
||||||
|
if (artifact?.commandType !== 'solid3d_get_extrusion_face_info') return
|
||||||
|
|
||||||
|
const faceInfo = await getFaceDetails(_entity_id)
|
||||||
|
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis) return
|
||||||
|
const { z_axis, y_axis, origin } = faceInfo
|
||||||
|
const sketchPathToNode = getNodePathFromSourceRange(
|
||||||
|
kclManager.ast,
|
||||||
|
artifact.range
|
||||||
|
)
|
||||||
|
|
||||||
|
const extrudePathToNode = extrusions?.range
|
||||||
|
? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
|
||||||
|
: []
|
||||||
|
|
||||||
if (!args || !args.intersects?.[0]) return
|
|
||||||
if (args.mouseEvent.which !== 1) return
|
|
||||||
const { intersects } = args
|
|
||||||
const type = intersects?.[0].object.name || ''
|
|
||||||
const posNorm = Number(intersects?.[0]?.normal?.z) > 0
|
|
||||||
let planeString: DefaultPlaneStr = posNorm ? 'XY' : '-XY'
|
|
||||||
let zAxis: [number, number, number] = posNorm ? [0, 0, 1] : [0, 0, -1]
|
|
||||||
let yAxis: [number, number, number] = [0, 1, 0]
|
|
||||||
if (type === YZ_PLANE) {
|
|
||||||
planeString = posNorm ? 'YZ' : '-YZ'
|
|
||||||
zAxis = posNorm ? [1, 0, 0] : [-1, 0, 0]
|
|
||||||
yAxis = [0, 0, 1]
|
|
||||||
} else if (type === XZ_PLANE) {
|
|
||||||
planeString = posNorm ? '-XZ' : 'XZ'
|
|
||||||
zAxis = posNorm ? [0, 1, 0] : [0, -1, 0]
|
|
||||||
yAxis = [0, 0, 1]
|
|
||||||
}
|
|
||||||
sceneInfra.modelingSend({
|
sceneInfra.modelingSend({
|
||||||
type: 'Select default plane',
|
type: 'Select default plane',
|
||||||
data: {
|
data: {
|
||||||
type: 'defaultPlane',
|
type: 'extrudeFace',
|
||||||
plane: planeString,
|
zAxis: [z_axis.x, z_axis.y, z_axis.z],
|
||||||
zAxis,
|
yAxis: [y_axis.x, y_axis.y, y_axis.z],
|
||||||
yAxis,
|
position: [origin.x, origin.y, origin.z].map(
|
||||||
planeId: faceResult[1],
|
(num) => num / sceneInfra._baseUnitMultiplier
|
||||||
|
) as [number, number, number],
|
||||||
|
sketchPathToNode,
|
||||||
|
extrudePathToNode,
|
||||||
|
cap:
|
||||||
|
artifact?.additionalData?.type === 'cap'
|
||||||
|
? artifact.additionalData.info
|
||||||
|
: 'none',
|
||||||
|
faceId: _entity_id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
return
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1756,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) {
|
||||||
@ -1792,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(
|
||||||
@ -1807,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')
|
||||||
@ -1836,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(
|
||||||
|
@ -6,6 +6,8 @@ import CommandComboBox from '../CommandComboBox'
|
|||||||
import CommandBarReview from './CommandBarReview'
|
import CommandBarReview from './CommandBarReview'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import useHotkeyWrapper from 'lib/hotkeyWrapper'
|
import useHotkeyWrapper from 'lib/hotkeyWrapper'
|
||||||
|
import { CustomIcon } from 'components/CustomIcon'
|
||||||
|
import Tooltip from 'components/Tooltip'
|
||||||
|
|
||||||
export const CommandBar = () => {
|
export const CommandBar = () => {
|
||||||
const { pathname } = useLocation()
|
const { pathname } = useLocation()
|
||||||
@ -103,7 +105,7 @@ export const CommandBar = () => {
|
|||||||
leaveTo="opacity-0 scale-95"
|
leaveTo="opacity-0 scale-95"
|
||||||
>
|
>
|
||||||
<WrapperComponent.Panel
|
<WrapperComponent.Panel
|
||||||
className="relative z-50 pointer-events-auto w-full max-w-xl py-2 mx-auto border rounded shadow-lg bg-chalkboard-10 dark:bg-chalkboard-100 dark:border-chalkboard-70"
|
className="relative z-50 pointer-events-auto w-full max-w-xl py-2 mx-auto border rounded rounded-tl-none shadow-lg bg-chalkboard-10 dark:bg-chalkboard-100 dark:border-chalkboard-70"
|
||||||
as="div"
|
as="div"
|
||||||
data-testid="command-bar"
|
data-testid="command-bar"
|
||||||
>
|
>
|
||||||
@ -116,6 +118,19 @@ export const CommandBar = () => {
|
|||||||
<CommandBarReview stepBack={stepBack} />
|
<CommandBarReview stepBack={stepBack} />
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
|
<button
|
||||||
|
onClick={() => commandBarSend({ type: 'Close' })}
|
||||||
|
className="group block !absolute left-auto right-full top-[-3px] m-2.5 p-0 border-none bg-transparent hover:bg-transparent"
|
||||||
|
>
|
||||||
|
<CustomIcon
|
||||||
|
name="close"
|
||||||
|
className="w-5 h-5 rounded-sm bg-destroy-10 text-destroy-80 dark:bg-destroy-80 dark:text-destroy-10 group-hover:brightness-110"
|
||||||
|
/>
|
||||||
|
<Tooltip position="bottom" delay={500}>
|
||||||
|
Cancel{' '}
|
||||||
|
<kbd className="hotkey ml-4 dark:!bg-chalkboard-80">esc</kbd>
|
||||||
|
</Tooltip>
|
||||||
|
</button>
|
||||||
</WrapperComponent.Panel>
|
</WrapperComponent.Panel>
|
||||||
</Transition.Child>
|
</Transition.Child>
|
||||||
</WrapperComponent>
|
</WrapperComponent>
|
||||||
|
@ -7,10 +7,8 @@ import {
|
|||||||
getSelectionType,
|
getSelectionType,
|
||||||
getSelectionTypeDisplayText,
|
getSelectionTypeDisplayText,
|
||||||
} from 'lib/selections'
|
} from 'lib/selections'
|
||||||
import { kclManager } from 'lib/singletons'
|
|
||||||
import { modelingMachine } from 'machines/modelingMachine'
|
import { modelingMachine } from 'machines/modelingMachine'
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import { useHotkeys } from 'react-hotkeys-hook'
|
|
||||||
import { StateFrom } from 'xstate'
|
import { StateFrom } from 'xstate'
|
||||||
|
|
||||||
const selectionSelector = (snapshot: StateFrom<typeof modelingMachine>) =>
|
const selectionSelector = (snapshot: StateFrom<typeof modelingMachine>) =>
|
||||||
@ -41,12 +39,6 @@ function CommandBarSelectionInput({
|
|||||||
canSubmitSelectionArg(selectionsByType, arg)
|
canSubmitSelectionArg(selectionsByType, arg)
|
||||||
)
|
)
|
||||||
|
|
||||||
useHotkeys('tab', () => onSubmit(selection), {
|
|
||||||
enableOnFormTags: true,
|
|
||||||
enableOnContentEditable: true,
|
|
||||||
keyup: true,
|
|
||||||
})
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
inputRef.current?.focus()
|
inputRef.current?.focus()
|
||||||
}, [selection, inputRef])
|
}, [selection, inputRef])
|
||||||
|
@ -74,8 +74,8 @@ const CustomIconMap = {
|
|||||||
bug: (
|
bug: (
|
||||||
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path
|
<path
|
||||||
fill-rule="evenodd"
|
fillRule="evenodd"
|
||||||
clip-rule="evenodd"
|
clipRule="evenodd"
|
||||||
d="M10.8209 5.99884C10.6403 5.73962 10.3399 5.57001 10 5.57001C9.65984 5.57001 9.35936 5.73984 9.17871 5.99935C9.43724 5.95129 9.71142 5.92578 10.0012 5.92578C10.29 5.92578 10.5633 5.95111 10.8209 5.99884ZM10 4.57001C8.9459 4.57001 8.08227 5.38548 8.00554 6.41997C7.58916 6.65398 7.23724 6.95989 6.95014 7.31304L5.85355 6.21645L5.14645 6.92356L6.40931 8.18642C6.20774 8.62503 6.08043 9.09624 6.0278 9.57001H5V10.57H6.01946C6.06396 11.1581 6.1867 11.8173 6.4071 12.4558L5.14645 13.7165L5.85355 14.4236L6.8408 13.4363C7.46354 14.555 8.47307 15.4258 10.0012 15.4258C11.529 15.4258 12.5378 14.5554 13.16 13.4371L14.1464 14.4236L14.8536 13.7165L13.5934 12.4563C13.8136 11.8177 13.9362 11.1583 13.9806 10.57H15V9.57001H13.9722C13.9197 9.0961 13.7925 8.62474 13.5911 8.18602L14.8536 6.92356L14.1464 6.21645L13.0505 7.31239C12.7633 6.95894 12.4112 6.65285 11.9944 6.41883C11.9171 5.38488 11.0537 4.57001 10 4.57001ZM10.5 14.3801V8.57001H9.5V14.3796C8.72105 14.2298 8.15885 13.7245 7.7428 12.9999C7.22316 12.095 7 10.937 7 10.07C7 8.46381 8.04281 6.92578 10.0012 6.92578C11.9589 6.92578 13 8.4629 13 10.07C13 10.9373 12.7773 12.0954 12.2582 13.0003C11.8422 13.7254 11.2799 14.2309 10.5 14.3801Z"
|
d="M10.8209 5.99884C10.6403 5.73962 10.3399 5.57001 10 5.57001C9.65984 5.57001 9.35936 5.73984 9.17871 5.99935C9.43724 5.95129 9.71142 5.92578 10.0012 5.92578C10.29 5.92578 10.5633 5.95111 10.8209 5.99884ZM10 4.57001C8.9459 4.57001 8.08227 5.38548 8.00554 6.41997C7.58916 6.65398 7.23724 6.95989 6.95014 7.31304L5.85355 6.21645L5.14645 6.92356L6.40931 8.18642C6.20774 8.62503 6.08043 9.09624 6.0278 9.57001H5V10.57H6.01946C6.06396 11.1581 6.1867 11.8173 6.4071 12.4558L5.14645 13.7165L5.85355 14.4236L6.8408 13.4363C7.46354 14.555 8.47307 15.4258 10.0012 15.4258C11.529 15.4258 12.5378 14.5554 13.16 13.4371L14.1464 14.4236L14.8536 13.7165L13.5934 12.4563C13.8136 11.8177 13.9362 11.1583 13.9806 10.57H15V9.57001H13.9722C13.9197 9.0961 13.7925 8.62474 13.5911 8.18602L14.8536 6.92356L14.1464 6.21645L13.0505 7.31239C12.7633 6.95894 12.4112 6.65285 11.9944 6.41883C11.9171 5.38488 11.0537 4.57001 10 4.57001ZM10.5 14.3801V8.57001H9.5V14.3796C8.72105 14.2298 8.15885 13.7245 7.7428 12.9999C7.22316 12.095 7 10.937 7 10.07C7 8.46381 8.04281 6.92578 10.0012 6.92578C11.9589 6.92578 13 8.4629 13 10.07C13 10.9373 12.7773 12.0954 12.2582 13.0003C11.8422 13.7254 11.2799 14.2309 10.5 14.3801Z"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
/>
|
/>
|
||||||
|
@ -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'
|
||||||
@ -76,6 +76,7 @@ import { useSearchParams } from 'react-router-dom'
|
|||||||
import { letEngineAnimateAndSyncCamAfter } from 'clientSideScene/CameraControls'
|
import { letEngineAnimateAndSyncCamAfter } from 'clientSideScene/CameraControls'
|
||||||
import { getVarNameModal } from 'hooks/useToolbarGuards'
|
import { getVarNameModal } from 'hooks/useToolbarGuards'
|
||||||
import useHotkeyWrapper from 'lib/hotkeyWrapper'
|
import useHotkeyWrapper from 'lib/hotkeyWrapper'
|
||||||
|
import { uuidv4 } from 'lib/utils'
|
||||||
|
|
||||||
type MachineContext<T extends AnyStateMachine> = {
|
type MachineContext<T extends AnyStateMachine> = {
|
||||||
state: StateFrom<T>
|
state: StateFrom<T>
|
||||||
@ -121,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(
|
||||||
@ -141,7 +159,41 @@ export const ModelingMachineProvider = ({
|
|||||||
{
|
{
|
||||||
actions: {
|
actions: {
|
||||||
'sketch exit execute': () => {
|
'sketch exit execute': () => {
|
||||||
kclManager.executeCode(true)
|
;(async () => {
|
||||||
|
await sceneInfra.camControls.snapToPerspectiveBeforeHandingBackControlToEngine()
|
||||||
|
|
||||||
|
sceneInfra.camControls.syncDirection = 'engineToClient'
|
||||||
|
|
||||||
|
const settings: Models['CameraSettings_type'] = (
|
||||||
|
await engineCommandManager.sendSceneCommand({
|
||||||
|
type: 'modeling_cmd_req',
|
||||||
|
cmd_id: uuidv4(),
|
||||||
|
cmd: {
|
||||||
|
type: 'default_camera_get_settings',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
)?.data?.data?.settings
|
||||||
|
if (settings.up.z !== 1) {
|
||||||
|
// workaround for gimbal lock situation
|
||||||
|
await engineCommandManager.sendSceneCommand({
|
||||||
|
type: 'modeling_cmd_req',
|
||||||
|
cmd_id: uuidv4(),
|
||||||
|
cmd: {
|
||||||
|
type: 'default_camera_look_at',
|
||||||
|
center: settings.center,
|
||||||
|
vantage: {
|
||||||
|
...settings.pos,
|
||||||
|
y:
|
||||||
|
settings.pos.y +
|
||||||
|
(settings.center.z - settings.pos.z > 0 ? 2 : -2),
|
||||||
|
},
|
||||||
|
up: { x: 0, y: 0, z: 1 },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
kclManager.executeCode(true)
|
||||||
|
})()
|
||||||
},
|
},
|
||||||
'Set mouse state': assign({
|
'Set mouse state': assign({
|
||||||
mouseState: (_, event) => event.data,
|
mouseState: (_, event) => event.data,
|
||||||
@ -223,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) {
|
||||||
@ -396,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)
|
||||||
@ -464,7 +521,7 @@ export const ModelingMachineProvider = ({
|
|||||||
engineCommandManager,
|
engineCommandManager,
|
||||||
data.faceId
|
data.faceId
|
||||||
)
|
)
|
||||||
|
sceneInfra.camControls.syncDirection = 'clientToEngine'
|
||||||
return {
|
return {
|
||||||
sketchPathToNode: pathToNewSketchNode,
|
sketchPathToNode: pathToNewSketchNode,
|
||||||
zAxis: data.zAxis,
|
zAxis: data.zAxis,
|
||||||
@ -478,8 +535,10 @@ export const ModelingMachineProvider = ({
|
|||||||
)
|
)
|
||||||
await kclManager.updateAst(modifiedAst, false)
|
await kclManager.updateAst(modifiedAst, false)
|
||||||
sceneInfra.camControls.syncDirection = 'clientToEngine'
|
sceneInfra.camControls.syncDirection = 'clientToEngine'
|
||||||
const quat = await getSketchQuaternion(pathToNode, data.zAxis)
|
await letEngineAnimateAndSyncCamAfter(
|
||||||
await sceneInfra.camControls.tweenCameraToQuaternion(quat)
|
engineCommandManager,
|
||||||
|
data.planeId
|
||||||
|
)
|
||||||
return {
|
return {
|
||||||
sketchPathToNode: pathToNode,
|
sketchPathToNode: pathToNode,
|
||||||
zAxis: data.zAxis,
|
zAxis: data.zAxis,
|
||||||
|
@ -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'
|
||||||
|
|
||||||
|
@ -126,8 +126,8 @@ export const Stream = ({ className = '' }: { className?: string }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
id="stream"
|
className="absolute inset-0 z-0"
|
||||||
className={className}
|
data-testid="stream"
|
||||||
onMouseUp={handleMouseUp}
|
onMouseUp={handleMouseUp}
|
||||||
onMouseDown={handleMouseDown}
|
onMouseDown={handleMouseDown}
|
||||||
onContextMenu={(e) => e.preventDefault()}
|
onContextMenu={(e) => e.preventDefault()}
|
||||||
@ -142,7 +142,6 @@ export const Stream = ({ className = '' }: { className?: string }) => {
|
|||||||
onMouseMoveCapture={handleMouseMove}
|
onMouseMoveCapture={handleMouseMove}
|
||||||
className="w-full cursor-pointer h-full"
|
className="w-full cursor-pointer h-full"
|
||||||
disablePictureInPicture
|
disablePictureInPicture
|
||||||
style={{ transitionDuration: '200ms', transitionProperty: 'filter' }}
|
|
||||||
id="video-stream"
|
id="video-stream"
|
||||||
/>
|
/>
|
||||||
<ClientSideScene
|
<ClientSideScene
|
||||||
|
@ -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),
|
||||||
})
|
})
|
||||||
|
@ -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 {
|
||||||
@ -249,3 +253,10 @@ code {
|
|||||||
.cm-ghostText * {
|
.cm-ghostText * {
|
||||||
color: rgb(120, 120, 120, 0.8) !important;
|
color: rgb(120, 120, 120, 0.8) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
kbd.hotkey {
|
||||||
|
@apply font-mono text-xs inline-block px-1 py-0.5 rounded-sm;
|
||||||
|
@apply bg-chalkboard-20 dark:bg-chalkboard-90;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -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
|
||||||
|
|
||||||
@ -364,18 +384,55 @@ export class KclManager {
|
|||||||
return this?.engineCommandManager?.defaultPlanes
|
return this?.engineCommandManager?.defaultPlanes
|
||||||
}
|
}
|
||||||
|
|
||||||
showPlanes() {
|
showPlanes(all = false) {
|
||||||
if (!this.defaultPlanes) return
|
if (!this.defaultPlanes) return Promise.all([])
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, false)
|
const thePromises = [
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, false)
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, false),
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, false)
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, false),
|
||||||
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, false),
|
||||||
|
]
|
||||||
|
if (all) {
|
||||||
|
thePromises.push(
|
||||||
|
this.engineCommandManager.setPlaneHidden(
|
||||||
|
this.defaultPlanes.negXy,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
thePromises.push(
|
||||||
|
this.engineCommandManager.setPlaneHidden(
|
||||||
|
this.defaultPlanes.negYz,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
thePromises.push(
|
||||||
|
this.engineCommandManager.setPlaneHidden(
|
||||||
|
this.defaultPlanes.negXz,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return Promise.all(thePromises)
|
||||||
}
|
}
|
||||||
|
|
||||||
hidePlanes() {
|
hidePlanes(all = false) {
|
||||||
if (!this.defaultPlanes) return
|
if (!this.defaultPlanes) return Promise.all([])
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, true)
|
const thePromises = [
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true)
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, true),
|
||||||
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true)
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true),
|
||||||
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true),
|
||||||
|
]
|
||||||
|
if (all) {
|
||||||
|
thePromises.push(
|
||||||
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.negXy, true)
|
||||||
|
)
|
||||||
|
thePromises.push(
|
||||||
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.negYz, true)
|
||||||
|
)
|
||||||
|
thePromises.push(
|
||||||
|
this.engineCommandManager.setPlaneHidden(this.defaultPlanes.negXz, true)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return Promise.all(thePromises)
|
||||||
}
|
}
|
||||||
defaultSelectionFilter() {
|
defaultSelectionFilter() {
|
||||||
defaultSelectionFilter(this.programMemory, this.engineCommandManager)
|
defaultSelectionFilter(this.programMemory, this.engineCommandManager)
|
||||||
|
@ -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
|
||||||
|