Compare commits
18 Commits
achalmers/
...
wip-multi-
Author | SHA1 | Date | |
---|---|---|---|
0e02e95c55 | |||
3f343698a8 | |||
0bd9f42e17 | |||
aad29fca9f | |||
a8c1a14d48 | |||
8194f8b70b | |||
03e4f457d4 | |||
a94f0191b5 | |||
99655d623e | |||
4d7cac6c1d | |||
59ed422907 | |||
3b30ac7d39 | |||
226ed37c5f | |||
41a6ddd769 | |||
0f3f923019 | |||
bf8fb0d127 | |||
4a275c2ff7 | |||
baf5509f1d |
@ -36,8 +36,6 @@ const extrusion = extrude(5, sketch001)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -101,10 +97,6 @@ const extrusion = extrude(5, sketch001)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -179,24 +171,6 @@ const extrusion = extrude(5, sketch001)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -102,10 +98,6 @@ const extrusion = extrude(5, sketch001)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -180,24 +172,6 @@ const extrusion = extrude(5, sketch001)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -108,10 +104,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -186,24 +178,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -213,8 +187,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -278,10 +248,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -356,24 +322,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -107,10 +103,6 @@ const extrusion = extrude(10, sketch001)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -185,24 +177,6 @@ const extrusion = extrude(10, sketch001)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -212,8 +186,6 @@ const extrusion = extrude(10, sketch001)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -277,10 +247,6 @@ const extrusion = extrude(10, sketch001)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -355,24 +321,6 @@ const extrusion = extrude(10, sketch001)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -109,10 +105,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -187,24 +179,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -214,8 +188,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -279,10 +249,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -357,24 +323,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -113,10 +109,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -191,24 +183,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -218,8 +192,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -283,10 +253,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -361,24 +327,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -106,10 +102,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -184,24 +176,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -211,8 +185,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -276,10 +246,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -354,24 +320,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -106,10 +102,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -184,24 +176,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -211,8 +185,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -276,10 +246,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -354,24 +320,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -117,10 +113,6 @@ const exampleSketch = startSketchOn('XZ')
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -195,24 +187,6 @@ const exampleSketch = startSketchOn('XZ')
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -222,8 +196,6 @@ const exampleSketch = startSketchOn('XZ')
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -287,10 +257,6 @@ const exampleSketch = startSketchOn('XZ')
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -365,24 +331,6 @@ const exampleSketch = startSketchOn('XZ')
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -112,10 +108,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -190,24 +182,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -217,8 +191,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -282,10 +252,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -360,24 +326,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -62,12 +62,80 @@ string],
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -131,6 +199,7 @@ string],
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -141,10 +210,6 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -156,32 +221,10 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -265,6 +376,7 @@ string],
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -275,10 +387,6 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -290,32 +398,10 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -170,10 +164,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -248,24 +238,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -339,10 +307,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -417,24 +381,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -107,10 +103,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -185,24 +177,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -212,8 +186,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -277,10 +247,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -355,24 +321,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -132,10 +128,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -211,24 +203,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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",
|
||||
@ -246,12 +220,80 @@ const example = extrude(10, exampleSketch)
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -315,6 +357,7 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
type: "extrudeGroup",
|
||||
@ -326,10 +369,6 @@ const example = extrude(10, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -341,32 +380,10 @@ const example = extrude(10, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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",
|
||||
|
@ -62,12 +62,80 @@ string],
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -131,6 +199,7 @@ string],
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -141,10 +210,6 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -156,32 +221,10 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -265,6 +376,7 @@ string],
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -275,10 +387,6 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -290,32 +398,10 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -118,6 +186,7 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -128,10 +197,6 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -143,32 +208,10 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -116,6 +184,7 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -126,10 +195,6 @@ const example = extrude(5, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -141,32 +206,10 @@ const example = extrude(5, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -114,6 +182,7 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -124,10 +193,6 @@ const example = extrude(5, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -139,32 +204,10 @@ const example = extrude(5, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -116,6 +184,7 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -126,10 +195,6 @@ const example = extrude(5, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -141,32 +206,10 @@ const example = extrude(5, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -121,6 +189,7 @@ const part001 = startSketchOn('XY')
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -131,10 +200,6 @@ const part001 = startSketchOn('XY')
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -146,32 +211,10 @@ const part001 = startSketchOn('XY')
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -255,6 +366,7 @@ const part001 = startSketchOn('XY')
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -265,10 +377,6 @@ const part001 = startSketchOn('XY')
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -280,32 +388,10 @@ const part001 = startSketchOn('XY')
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -118,10 +114,6 @@ const example = extrude(1, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -197,24 +189,6 @@ const example = extrude(1, exampleSketch)
|
||||
to: [number, number],
|
||||
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",
|
||||
@ -223,8 +197,6 @@ const example = extrude(1, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -288,10 +258,6 @@ const example = extrude(1, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -366,24 +332,6 @@ const example = extrude(1, exampleSketch)
|
||||
to: [number, number],
|
||||
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.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -457,10 +401,6 @@ const example = extrude(1, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -535,24 +475,6 @@ const example = extrude(1, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -98,10 +94,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -176,24 +168,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -98,10 +94,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -176,24 +168,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -111,10 +107,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -189,24 +181,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -216,8 +190,6 @@ const example = extrude(5, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -281,10 +251,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -359,24 +325,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -98,10 +94,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -176,24 +168,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -203,8 +177,6 @@ const example = extrude(5, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -268,10 +238,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -346,24 +312,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -116,10 +112,6 @@ const example = extrude(1, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -195,24 +187,6 @@ const example = extrude(1, exampleSketch)
|
||||
to: [number, number],
|
||||
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",
|
||||
|
@ -56,12 +56,80 @@ const example = extrude(-5, exampleSketch)
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -125,6 +193,7 @@ const example = extrude(-5, exampleSketch)
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
type: "extrudeGroup",
|
||||
@ -136,10 +205,6 @@ const example = extrude(-5, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -151,32 +216,10 @@ const example = extrude(-5, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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",
|
||||
|
@ -44,8 +44,6 @@ const example = extrude(1, exampleSketch)
|
||||
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -109,10 +105,6 @@ const example = extrude(1, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -188,24 +180,6 @@ const example = extrude(1, exampleSketch)
|
||||
to: [number, number],
|
||||
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",
|
||||
|
@ -54,12 +54,80 @@ const example = extrude(1, exampleSketch)
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -123,6 +191,7 @@ const example = extrude(1, exampleSketch)
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
type: "extrudeGroup",
|
||||
@ -134,10 +203,6 @@ const example = extrude(1, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -149,32 +214,10 @@ const example = extrude(1, exampleSketch)
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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",
|
||||
|
@ -34,8 +34,6 @@ const sketch001 = startSketchOn('XY')
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -99,10 +95,6 @@ const sketch001 = startSketchOn('XY')
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -177,24 +169,6 @@ const sketch001 = startSketchOn('XY')
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -94,10 +90,6 @@ const sketch001 = startSketchOn('XY')
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -172,24 +164,6 @@ const sketch001 = startSketchOn('XY')
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -93,10 +89,6 @@ const sketch001 = startSketchOn('XY')
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -171,24 +163,6 @@ const sketch001 = startSketchOn('XY')
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -227,10 +223,6 @@ string,
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -305,24 +297,6 @@ string,
|
||||
to: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -406,6 +448,7 @@ string,
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -416,10 +459,6 @@ string,
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -431,32 +470,10 @@ string,
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -101,10 +97,6 @@ const example = extrude(4, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -179,24 +171,6 @@ const example = extrude(4, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -99,10 +95,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -177,24 +169,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -100,10 +96,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -178,24 +170,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -101,10 +97,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -179,24 +171,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -119,6 +187,7 @@ string],
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -129,10 +198,6 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -144,32 +209,10 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -253,6 +364,7 @@ string],
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -263,10 +375,6 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -278,32 +386,10 @@ string],
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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.
|
||||
id: uuid,
|
||||
// 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.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -191,10 +185,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -269,24 +259,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -124,10 +120,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -202,24 +194,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the 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.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
@ -236,6 +304,7 @@ const a1 = startSketchOn({
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -246,10 +315,6 @@ const a1 = startSketchOn({
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
type: "extrudePlane",
|
||||
@ -261,32 +326,10 @@ const a1 = startSketchOn({
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
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)
|
||||
@ -331,8 +374,6 @@ string
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
faceId: uuid,
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
|
50070
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -107,10 +103,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -185,24 +177,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -212,8 +186,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -277,10 +247,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -355,24 +321,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -98,10 +94,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -176,24 +168,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -203,8 +177,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -268,10 +238,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -346,24 +312,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -101,10 +97,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -179,24 +171,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -206,8 +180,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -271,10 +241,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -349,24 +315,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -101,10 +97,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -179,24 +171,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -206,8 +180,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -271,10 +241,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -349,24 +315,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -99,10 +95,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -177,24 +169,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -204,8 +178,6 @@ const example = extrude(10, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -269,10 +239,6 @@ const example = extrude(10, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -347,24 +313,6 @@ const example = extrude(10, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -97,10 +93,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -175,24 +167,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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)
|
||||
@ -202,8 +176,6 @@ const example = extrude(5, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// 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.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
@ -267,10 +237,6 @@ const example = extrude(5, exampleSketch)
|
||||
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.
|
||||
start: {
|
||||
// The from point.
|
||||
@ -345,24 +311,6 @@ const example = extrude(5, exampleSketch)
|
||||
to: [number, number],
|
||||
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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
wiggleMove,
|
||||
doExport,
|
||||
metaModifier,
|
||||
TEST_COLORS,
|
||||
} from './test-utils'
|
||||
import waitOn from 'wait-on'
|
||||
import { XOR, roundOff, uuidv4 } from 'lib/utils'
|
||||
@ -77,7 +78,7 @@ test.beforeEach(async ({ context, page }) => {
|
||||
|
||||
test.setTimeout(60000)
|
||||
|
||||
test('Basic sketch', async ({ page }) => {
|
||||
async function doBasicSketch(page: Page, openPanes: string[]) {
|
||||
const u = await getUtils(page)
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||
@ -85,6 +86,14 @@ test('Basic sketch', async ({ page }) => {
|
||||
await u.waitForAuthSkipAppStart()
|
||||
await u.openDebugPanel()
|
||||
|
||||
// If we have the code pane open, we should see the code.
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator).toHaveText(``)
|
||||
} else {
|
||||
// Ensure we don't see the code.
|
||||
await expect(u.codeLocator).not.toBeVisible()
|
||||
}
|
||||
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Start Sketch' })
|
||||
).not.toBeDisabled()
|
||||
@ -98,51 +107,72 @@ test('Basic sketch', async ({ page }) => {
|
||||
// select a plane
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
await expect(u.codeLocator).toHaveText(
|
||||
`const sketch001 = startSketchOn('XZ')`
|
||||
)
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator).toHaveText(
|
||||
`const sketch001 = startSketchOn('XZ')`
|
||||
)
|
||||
}
|
||||
await u.closeDebugPanel()
|
||||
|
||||
await page.waitForTimeout(500) // TODO detect animation ending, or disable animation
|
||||
await page.waitForTimeout(1000) // TODO detect animation ending, or disable animation
|
||||
|
||||
const startXPx = 600
|
||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||
await expect(u.codeLocator).toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt(${commonPoints.startAt}, %)`)
|
||||
await page.waitForTimeout(100)
|
||||
}
|
||||
await page.waitForTimeout(500)
|
||||
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
await page.waitForTimeout(500)
|
||||
|
||||
await expect(u.codeLocator).toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt(${commonPoints.startAt}, %)
|
||||
|> line([${commonPoints.num1}, 0], %)`)
|
||||
}
|
||||
await page.waitForTimeout(500)
|
||||
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
|
||||
await expect(u.codeLocator).toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt(${commonPoints.startAt}, %)
|
||||
|> line([${commonPoints.num1}, 0], %)
|
||||
|> line([0, ${commonPoints.num1 + 0.01}], %)`)
|
||||
await page.waitForTimeout(100)
|
||||
}
|
||||
await page.waitForTimeout(500)
|
||||
await page.mouse.click(startXPx, 500 - PUR * 20)
|
||||
await expect(u.codeLocator).toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt(${commonPoints.startAt}, %)
|
||||
|> line([${commonPoints.num1}, 0], %)
|
||||
|> line([0, ${commonPoints.num1 + 0.01}], %)
|
||||
|> line([-${commonPoints.num2}, 0], %)`)
|
||||
}
|
||||
|
||||
// deselect line tool
|
||||
await page.getByRole('button', { name: 'Line' }).click()
|
||||
await page.waitForTimeout(100)
|
||||
await page.waitForTimeout(500)
|
||||
|
||||
const line1 = await u.getSegmentBodyCoords(`[data-overlay-index="${0}"]`, 0)
|
||||
await expect(await u.getGreatestPixDiff(line1, [249, 249, 249])).toBeLessThan(
|
||||
3
|
||||
)
|
||||
if (openPanes.includes('code')) {
|
||||
expect(await u.getGreatestPixDiff(line1, TEST_COLORS.WHITE)).toBeLessThan(3)
|
||||
await expect(
|
||||
await u.getGreatestPixDiff(line1, [249, 249, 249])
|
||||
).toBeLessThan(3)
|
||||
}
|
||||
// click between first two clicks to get center of the line
|
||||
await page.mouse.click(startXPx + PUR * 15, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
await expect(await u.getGreatestPixDiff(line1, [0, 0, 255])).toBeLessThan(3)
|
||||
if (openPanes.includes('code')) {
|
||||
expect(await u.getGreatestPixDiff(line1, TEST_COLORS.BLUE)).toBeLessThan(3)
|
||||
await expect(await u.getGreatestPixDiff(line1, [0, 0, 255])).toBeLessThan(3)
|
||||
}
|
||||
|
||||
// hold down shift
|
||||
await page.keyboard.down('Shift')
|
||||
@ -150,16 +180,55 @@ test('Basic sketch', async ({ page }) => {
|
||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 20)
|
||||
|
||||
// selected two lines therefore there should be two cursors
|
||||
await expect(page.locator('.cm-cursor')).toHaveCount(2)
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(page.locator('.cm-cursor')).toHaveCount(2)
|
||||
}
|
||||
|
||||
await page.getByRole('button', { name: 'Constrain' }).click()
|
||||
await page.getByRole('button', { name: 'Equal Length' }).click()
|
||||
|
||||
// Open the code pane.
|
||||
await u.openKclCodePanel()
|
||||
await expect(u.codeLocator).toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt(${commonPoints.startAt}, %)
|
||||
|> line([${commonPoints.num1}, 0], %, 'seg01')
|
||||
|> line([0, ${commonPoints.num1 + 0.01}], %)
|
||||
|> angledLine([180, segLen('seg01', %)], %)`)
|
||||
}
|
||||
|
||||
test.describe('Basic sketch', () => {
|
||||
test('code pane open at start', async ({ page }) => {
|
||||
// Load the app with the code panes
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'store',
|
||||
JSON.stringify({
|
||||
state: {
|
||||
openPanes: ['code'],
|
||||
},
|
||||
version: 0,
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
await doBasicSketch(page, ['code'])
|
||||
})
|
||||
|
||||
test('code pane closed at start', async ({ page }) => {
|
||||
// Load the app with the code panes
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'store',
|
||||
JSON.stringify({
|
||||
state: {
|
||||
openPanes: [],
|
||||
},
|
||||
version: 0,
|
||||
})
|
||||
)
|
||||
})
|
||||
await doBasicSketch(page, [])
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Testing Camera Movement', () => {
|
||||
@ -990,6 +1059,59 @@ test.describe('Can create sketches on all planes and their back sides', () => {
|
||||
})
|
||||
})
|
||||
|
||||
test('Position _ Is Out Of Range... regression test', async ({ page }) => {
|
||||
const u = await getUtils(page)
|
||||
// const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`const exampleSketch = startSketchOn("XZ")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({ angle: 50, length: 45 }, %)
|
||||
|> yLineTo(0, %)
|
||||
|> close(%)
|
||||
|>
|
||||
|
||||
const example = extrude(5, exampleSketch)
|
||||
shell({ faces: ['end'], thickness: 0.25 }, exampleSketch)`
|
||||
)
|
||||
})
|
||||
const lspStartPromise = page.waitForEvent('console', async (message) => {
|
||||
// it would be better to wait for a message that the kcl lsp has started by looking for the message message.text().includes('[lsp] [window/logMessage]')
|
||||
// but that doesn't seem to make it to the console for macos/safari :(
|
||||
if (message.text().includes('start kcl lsp')) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 200))
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
await page.goto('/')
|
||||
await u.waitForAuthSkipAppStart()
|
||||
await lspStartPromise
|
||||
|
||||
// error in guter
|
||||
await expect(page.locator('.cm-lint-marker-error')).toBeVisible()
|
||||
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
await expect(page.getByText('Unexpected token').first()).toBeVisible()
|
||||
|
||||
// Okay execution finished, let's start editing text below the error.
|
||||
await u.codeLocator.click()
|
||||
// Go to the end of the editor
|
||||
await page.keyboard.press('End')
|
||||
|
||||
// Get to the area where we want to type.
|
||||
for (let i = 0; i < 20; i++) {
|
||||
await page.keyboard.press('ArrowLeft')
|
||||
}
|
||||
|
||||
await page.keyboard.press('Enter')
|
||||
await page.keyboard.type('thing: "blah"', { delay: 100 })
|
||||
await page.keyboard.press('Enter')
|
||||
})
|
||||
|
||||
test('Auto complete works', async ({ page }) => {
|
||||
const u = await getUtils(page)
|
||||
// const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||
@ -2506,7 +2628,173 @@ const part002 = startSketchOn('-XZ')
|
||||
await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeVisible()
|
||||
})
|
||||
|
||||
test('Can edit segments by dragging their handles', async ({ page }) => {
|
||||
async function doEditSegmentsByDraggingHandle(page: Page, openPanes: string[]) {
|
||||
// Load the app with the code panes
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)`
|
||||
)
|
||||
})
|
||||
|
||||
const u = await getUtils(page)
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
await u.waitForAuthSkipAppStart()
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Start Sketch' })
|
||||
).not.toBeDisabled()
|
||||
|
||||
await page.waitForTimeout(100)
|
||||
await u.openAndClearDebugPanel()
|
||||
await u.sendCustomCmd({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: {
|
||||
type: 'default_camera_look_at',
|
||||
vantage: { x: 0, y: -1250, z: 580 },
|
||||
center: { x: 0, y: 0, z: 0 },
|
||||
up: { x: 0, y: 0, z: 1 },
|
||||
},
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
await u.sendCustomCmd({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: {
|
||||
type: 'default_camera_get_settings',
|
||||
},
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
await u.closeDebugPanel()
|
||||
|
||||
// If we have the code pane open, we should see the code.
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)`)
|
||||
} else {
|
||||
// Ensure we don't see the code.
|
||||
await expect(u.codeLocator).not.toBeVisible()
|
||||
}
|
||||
|
||||
const startPX = [665, 458]
|
||||
|
||||
const dragPX = 30
|
||||
let prevContent = ''
|
||||
|
||||
if (openPanes.includes('code')) {
|
||||
await page.getByText('startProfileAt([4.61, -14.01], %)').click()
|
||||
} else {
|
||||
// Wait for the render.
|
||||
await page.waitForTimeout(1000)
|
||||
// Select the sketch
|
||||
await page.mouse.click(700, 370)
|
||||
}
|
||||
await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeVisible()
|
||||
await page.getByRole('button', { name: 'Edit Sketch' }).click()
|
||||
await page.waitForTimeout(400)
|
||||
if (openPanes.includes('code')) {
|
||||
prevContent = await page.locator('.cm-content').innerText()
|
||||
}
|
||||
|
||||
const step5 = { steps: 5 }
|
||||
|
||||
await expect(page.getByTestId('segment-overlay')).toHaveCount(2)
|
||||
|
||||
// drag startProfieAt handle
|
||||
await page.mouse.move(startPX[0], startPX[1])
|
||||
await page.mouse.down()
|
||||
await page.mouse.move(startPX[0] + dragPX, startPX[1] - dragPX, step5)
|
||||
await page.mouse.up()
|
||||
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
|
||||
prevContent = await page.locator('.cm-content').innerText()
|
||||
}
|
||||
|
||||
// drag line handle
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
const lineEnd = await u.getBoundingBox('[data-overlay-index="0"]')
|
||||
await page.mouse.move(lineEnd.x - 5, lineEnd.y)
|
||||
await page.mouse.down()
|
||||
await page.mouse.move(lineEnd.x + dragPX, lineEnd.y - dragPX, step5)
|
||||
await page.mouse.up()
|
||||
await page.waitForTimeout(100)
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
|
||||
prevContent = await page.locator('.cm-content').innerText()
|
||||
}
|
||||
|
||||
// drag tangentialArcTo handle
|
||||
const tangentEnd = await u.getBoundingBox('[data-overlay-index="1"]')
|
||||
await page.mouse.move(tangentEnd.x, tangentEnd.y - 5)
|
||||
await page.mouse.down()
|
||||
await page.mouse.move(tangentEnd.x + dragPX, tangentEnd.y - dragPX, step5)
|
||||
await page.mouse.up()
|
||||
await page.waitForTimeout(100)
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
|
||||
}
|
||||
|
||||
// Open the code pane
|
||||
await u.openKclCodePanel()
|
||||
|
||||
// expect the code to have changed
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([6.44, -12.07], %)
|
||||
|> line([14.72, 1.97], %)
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> line([1.97, 2.06], %)
|
||||
|> close(%)`)
|
||||
}
|
||||
|
||||
test.describe('Can edit segments by dragging their handles', () => {
|
||||
test('code pane open at start', async ({ page }) => {
|
||||
// Load the app with the code panes
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'store',
|
||||
JSON.stringify({
|
||||
state: {
|
||||
openPanes: ['code'],
|
||||
},
|
||||
version: 0,
|
||||
})
|
||||
)
|
||||
})
|
||||
await doEditSegmentsByDraggingHandle(page, ['code'])
|
||||
})
|
||||
|
||||
test('code pane closed at start', async ({ page }) => {
|
||||
// Load the app with the code panes
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'store',
|
||||
JSON.stringify({
|
||||
state: {
|
||||
openPanes: [],
|
||||
},
|
||||
version: 0,
|
||||
})
|
||||
)
|
||||
})
|
||||
await doEditSegmentsByDraggingHandle(page, [])
|
||||
})
|
||||
})
|
||||
|
||||
test('Can edit a sketch that has been extruded in the same pipe', async ({
|
||||
page,
|
||||
}) => {
|
||||
const u = await getUtils(page)
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
@ -2514,7 +2802,9 @@ test('Can edit segments by dragging their handles', async ({ page }) => {
|
||||
`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> tangentialArcTo([24.95, -5.38], %)`
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)`
|
||||
)
|
||||
})
|
||||
|
||||
@ -2595,8 +2885,111 @@ test('Can edit segments by dragging their handles', async ({ page }) => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([6.44, -12.07], %)
|
||||
|> line([14.72, 1.97], %)
|
||||
|> tangentialArcTo([26.92, -3.32], %)`)
|
||||
|> line([14.72, 2.01], %)
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> line([1.97, 2.06], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)`)
|
||||
})
|
||||
|
||||
test('Can edit a sketch that has been revolved in the same pipe', async ({
|
||||
page,
|
||||
}) => {
|
||||
const u = await getUtils(page)
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)
|
||||
|> revolve({ axis: "X",}, %)`
|
||||
)
|
||||
})
|
||||
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
await u.waitForAuthSkipAppStart()
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Start Sketch' })
|
||||
).not.toBeDisabled()
|
||||
|
||||
await page.waitForTimeout(100)
|
||||
await u.openAndClearDebugPanel()
|
||||
await u.sendCustomCmd({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: {
|
||||
type: 'default_camera_look_at',
|
||||
vantage: { x: 0, y: -1250, z: 580 },
|
||||
center: { x: 0, y: 0, z: 0 },
|
||||
up: { x: 0, y: 0, z: 1 },
|
||||
},
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
await u.sendCustomCmd({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: {
|
||||
type: 'default_camera_get_settings',
|
||||
},
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
const startPX = [665, 458]
|
||||
|
||||
const dragPX = 30
|
||||
|
||||
await page.getByText('startProfileAt([4.61, -14.01], %)').click()
|
||||
await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeVisible()
|
||||
await page.getByRole('button', { name: 'Edit Sketch' }).click()
|
||||
await page.waitForTimeout(400)
|
||||
let prevContent = await page.locator('.cm-content').innerText()
|
||||
|
||||
const step5 = { steps: 5 }
|
||||
|
||||
await expect(page.getByTestId('segment-overlay')).toHaveCount(2)
|
||||
|
||||
// drag startProfieAt handle
|
||||
await page.mouse.move(startPX[0], startPX[1])
|
||||
await page.mouse.down()
|
||||
await page.mouse.move(startPX[0] + dragPX, startPX[1] - dragPX, step5)
|
||||
await page.mouse.up()
|
||||
|
||||
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
|
||||
prevContent = await page.locator('.cm-content').innerText()
|
||||
|
||||
// drag line handle
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
const lineEnd = await u.getBoundingBox('[data-overlay-index="0"]')
|
||||
await page.mouse.move(lineEnd.x - 5, lineEnd.y)
|
||||
await page.mouse.down()
|
||||
await page.mouse.move(lineEnd.x + dragPX, lineEnd.y - dragPX, step5)
|
||||
await page.mouse.up()
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
|
||||
prevContent = await page.locator('.cm-content').innerText()
|
||||
|
||||
// drag tangentialArcTo handle
|
||||
const tangentEnd = await u.getBoundingBox('[data-overlay-index="1"]')
|
||||
await page.mouse.move(tangentEnd.x, tangentEnd.y - 5)
|
||||
await page.mouse.down()
|
||||
await page.mouse.move(tangentEnd.x + dragPX, tangentEnd.y - dragPX, step5)
|
||||
await page.mouse.up()
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
|
||||
|
||||
// expect the code to have changed
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([6.44, -12.07], %)
|
||||
|> line([14.72, 2.01], %)
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> line([1.97, 2.06], %)
|
||||
|> close(%)
|
||||
|> revolve({ axis: "X" }, %)`)
|
||||
})
|
||||
|
||||
const doSnapAtDifferentScales = async (
|
||||
@ -3716,6 +4109,81 @@ const part002 = startSketchOn('XZ')
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
test('Horizontally constrained line remains selected after applying constraint', async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`const sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-1.05, -1.07], %)
|
||||
|> line([3.79, 2.68], %, 'seg01')
|
||||
|> line([3.13, -2.4], %)`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
await page.getByText("line([3.79, 2.68], %, 'seg01')").click()
|
||||
await page.getByRole('button', { name: 'Edit Sketch' }).click()
|
||||
|
||||
await page.waitForTimeout(100)
|
||||
const lineBefore = await u.getSegmentBodyCoords(
|
||||
`[data-overlay-index="1"]`,
|
||||
0
|
||||
)
|
||||
expect(
|
||||
await u.getGreatestPixDiff(lineBefore, TEST_COLORS.WHITE)
|
||||
).toBeLessThan(3)
|
||||
await page.mouse.move(lineBefore.x, lineBefore.y)
|
||||
await page.waitForTimeout(50)
|
||||
await page.mouse.click(lineBefore.x, lineBefore.y)
|
||||
expect(
|
||||
await u.getGreatestPixDiff(lineBefore, TEST_COLORS.BLUE)
|
||||
).toBeLessThan(3)
|
||||
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: 'Constrain',
|
||||
})
|
||||
.click()
|
||||
await page.getByRole('button', { name: 'horizontal', exact: true }).click()
|
||||
|
||||
let activeLinesContent = await page.locator('.cm-activeLine').all()
|
||||
await expect(activeLinesContent[0]).toHaveText(`|> xLine(3.13, %)`)
|
||||
|
||||
// If the overlay-angle is updated the THREE.js scene is in a good state
|
||||
await expect(
|
||||
await page.locator('[data-overlay-index="1"]')
|
||||
).toHaveAttribute('data-overlay-angle', '0')
|
||||
|
||||
const lineAfter = await u.getSegmentBodyCoords(
|
||||
`[data-overlay-index="1"]`,
|
||||
0
|
||||
)
|
||||
expect(
|
||||
await u.getGreatestPixDiff(lineAfter, TEST_COLORS.BLUE)
|
||||
).toBeLessThan(3)
|
||||
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: 'Constrain',
|
||||
})
|
||||
.click()
|
||||
await page.getByRole('button', { name: 'length', exact: true }).click()
|
||||
|
||||
await page.getByLabel('length Value').fill('10')
|
||||
await page.getByRole('button', { name: 'Add constraining value' }).click()
|
||||
|
||||
activeLinesContent = await page.locator('.cm-activeLine').all()
|
||||
await expect(activeLinesContent[0]).toHaveText(`|> xLine(length001, %)`)
|
||||
|
||||
// checking the count of the overlays is a good proxy check that the client sketch scene is in a good state
|
||||
await expect(page.getByTestId('segment-overlay')).toHaveCount(2)
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Testing segment overlays', () => {
|
||||
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 43 KiB |
@ -8,6 +8,13 @@ import { Protocol } from 'playwright-core/types/protocol'
|
||||
import type { Models } from '@kittycad/lib'
|
||||
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) {
|
||||
// wait for 'Loading stream...' spinner
|
||||
await page.getByTestId('loading-stream').waitFor()
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "untitled-app",
|
||||
"version": "0.22.3",
|
||||
"version": "0.22.5",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.16.0",
|
||||
|
1480
src-tauri/Cargo.lock
generated
@ -20,7 +20,7 @@ kittycad = "0.3.5"
|
||||
log = "0.4.21"
|
||||
oauth2 = "4.4.2"
|
||||
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-deep-link = { version = "2.0.0-beta.3" }
|
||||
tauri-plugin-dialog = { version = "2.0.0-beta.6" }
|
||||
|
@ -63,17 +63,16 @@
|
||||
"subcommands": {}
|
||||
},
|
||||
"deep-link": {
|
||||
"mobile": [],
|
||||
"desktop": {
|
||||
"schemes": [
|
||||
"app.zoo.dev"
|
||||
]
|
||||
}
|
||||
"domains": [
|
||||
{
|
||||
"host": "app.zoo.dev"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shell": {
|
||||
"open": true
|
||||
}
|
||||
},
|
||||
"productName": "Zoo Modeling App",
|
||||
"version": "0.22.3"
|
||||
"version": "0.22.5"
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ import {
|
||||
changeSketchArguments,
|
||||
updateStartProfileAtArgs,
|
||||
} from 'lang/std/sketch'
|
||||
import { normaliseAngle, roundOff, throttle } from 'lib/utils'
|
||||
import { isOverlap, normaliseAngle, roundOff, throttle } from 'lib/utils'
|
||||
import {
|
||||
createArrayExpression,
|
||||
createCallExpressionStdLib,
|
||||
@ -83,6 +83,7 @@ import {
|
||||
findUniqueName,
|
||||
} from 'lang/modifyAst'
|
||||
import {
|
||||
Selections,
|
||||
getEventForSegmentSelection,
|
||||
sendSelectEventToEngine,
|
||||
} from 'lib/selections'
|
||||
@ -300,6 +301,7 @@ export class SceneEntities {
|
||||
position,
|
||||
maybeModdedAst,
|
||||
draftExpressionsIndices,
|
||||
selectionRanges,
|
||||
}: {
|
||||
sketchPathToNode: PathToNode
|
||||
maybeModdedAst: Program
|
||||
@ -307,6 +309,7 @@ export class SceneEntities {
|
||||
forward: [number, number, number]
|
||||
up: [number, number, number]
|
||||
position?: [number, number, number]
|
||||
selectionRanges?: Selections
|
||||
}): Promise<{
|
||||
truncatedAst: Program
|
||||
programMemoryOverride: ProgramMemory
|
||||
@ -343,11 +346,8 @@ export class SceneEntities {
|
||||
pathToNode: sketchPathToNode,
|
||||
}
|
||||
const dummy = new Mesh()
|
||||
dummy.position.set(
|
||||
sketchGroup.position[0],
|
||||
sketchGroup.position[1],
|
||||
sketchGroup.position[2]
|
||||
)
|
||||
// TODO: When we actually have sketch positions and rotations we can use them here.
|
||||
dummy.position.set(0, 0, 0)
|
||||
const orthoFactor = orthoScale(sceneInfra.camControls.camera)
|
||||
const factor =
|
||||
(sceneInfra.camControls.camera instanceof OrthographicCamera
|
||||
@ -399,6 +399,12 @@ export class SceneEntities {
|
||||
draftExpressionsIndices &&
|
||||
index <= draftExpressionsIndices.end &&
|
||||
index >= draftExpressionsIndices.start
|
||||
const isSelected = selectionRanges?.codeBasedSelections.some(
|
||||
(selection) => {
|
||||
return isOverlap(selection.range, segment.__geoMeta.sourceRange)
|
||||
}
|
||||
)
|
||||
|
||||
let seg
|
||||
const callExpName = getNodeFromPath<CallExpression>(
|
||||
maybeModdedAst,
|
||||
@ -416,6 +422,7 @@ export class SceneEntities {
|
||||
scale: factor,
|
||||
texture: sceneInfra.extraSegmentTexture,
|
||||
theme: sceneInfra._theme,
|
||||
isSelected,
|
||||
})
|
||||
callbacks.push(
|
||||
this.updateTangentialArcToSegment({
|
||||
@ -437,6 +444,7 @@ export class SceneEntities {
|
||||
callExpName,
|
||||
texture: sceneInfra.extraSegmentTexture,
|
||||
theme: sceneInfra._theme,
|
||||
isSelected,
|
||||
})
|
||||
callbacks.push(
|
||||
this.updateStraightSegment({
|
||||
@ -1391,13 +1399,13 @@ export class SceneEntities {
|
||||
},
|
||||
onClick: async (args) => {
|
||||
const { streamDimensions } = useStore.getState()
|
||||
const { entity_id, ...rest } = await sendSelectEventToEngine(
|
||||
const { entity_id } = await sendSelectEventToEngine(
|
||||
args?.mouseEvent,
|
||||
document.getElementById('video-stream') as HTMLVideoElement,
|
||||
streamDimensions
|
||||
)
|
||||
|
||||
let _entity_id = entity_id
|
||||
console.log('things', _entity_id, rest)
|
||||
if (!_entity_id) return
|
||||
if (
|
||||
engineCommandManager.defaultPlanes?.xy === _entity_id ||
|
||||
@ -1426,7 +1434,6 @@ export class SceneEntities {
|
||||
.sub(sceneInfra.camControls.target)
|
||||
|
||||
if (engineCommandManager.defaultPlanes?.xy === _entity_id) {
|
||||
console.log('XY')
|
||||
zAxis = [0, 0, 1]
|
||||
yAxis = [0, 1, 0]
|
||||
if (camVector.z < 0) {
|
||||
@ -1434,7 +1441,6 @@ export class SceneEntities {
|
||||
_entity_id = engineCommandManager.defaultPlanes?.negXy || ''
|
||||
}
|
||||
} else if (engineCommandManager.defaultPlanes?.yz === _entity_id) {
|
||||
console.log('YZ')
|
||||
zAxis = [1, 0, 0]
|
||||
yAxis = [0, 0, 1]
|
||||
if (camVector.x < 0) {
|
||||
@ -1442,7 +1448,6 @@ export class SceneEntities {
|
||||
_entity_id = engineCommandManager.defaultPlanes?.negYz || ''
|
||||
}
|
||||
} else if (engineCommandManager.defaultPlanes?.xz === _entity_id) {
|
||||
console.log('XZ')
|
||||
zAxis = [0, 1, 0]
|
||||
yAxis = [0, 0, 1]
|
||||
_entity_id = engineCommandManager.defaultPlanes?.negXz || ''
|
||||
@ -1496,6 +1501,7 @@ export class SceneEntities {
|
||||
kclManager.ast,
|
||||
artifact.range
|
||||
)
|
||||
|
||||
const extrudePathToNode = extrusions?.range
|
||||
? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
|
||||
: []
|
||||
@ -1768,7 +1774,11 @@ export function sketchGroupFromPathToNode({
|
||||
pathToNode,
|
||||
'VariableDeclarator'
|
||||
).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) {
|
||||
@ -1804,7 +1814,7 @@ export function getSketchQuaternion(
|
||||
ast: kclManager.ast,
|
||||
programMemory: kclManager.programMemory,
|
||||
})
|
||||
const zAxis = sketchGroup?.zAxis || sketchNormalBackUp
|
||||
const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp
|
||||
return getQuaternionFromZAxis(massageFormats(zAxis))
|
||||
}
|
||||
export async function getSketchOrientationDetails(
|
||||
@ -1819,20 +1829,24 @@ export async function getSketchOrientationDetails(
|
||||
programMemory: kclManager.programMemory,
|
||||
})
|
||||
if (sketchGroup.on.type === 'plane') {
|
||||
const zAxis = sketchGroup?.zAxis
|
||||
const zAxis = sketchGroup?.on.zAxis
|
||||
return {
|
||||
quat: getQuaternionFromZAxis(massageFormats(zAxis)),
|
||||
sketchDetails: {
|
||||
sketchPathToNode,
|
||||
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],
|
||||
faceId: sketchGroup.on.id,
|
||||
},
|
||||
}
|
||||
}
|
||||
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)
|
||||
throw new Error('faceInfo')
|
||||
@ -1848,7 +1862,7 @@ export async function getSketchOrientationDetails(
|
||||
zAxis: [z_axis.x, z_axis.y, z_axis.z],
|
||||
yAxis: [y_axis.x, y_axis.y, y_axis.z],
|
||||
origin: [origin.x, origin.y, origin.z],
|
||||
faceId: sketchGroup.on.faceId,
|
||||
faceId: sketchGroup.on.id,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -45,18 +45,21 @@ export function profileStart({
|
||||
pathToNode,
|
||||
scale = 1,
|
||||
theme,
|
||||
isSelected,
|
||||
}: {
|
||||
from: Coords2d
|
||||
id: string
|
||||
pathToNode: PathToNode
|
||||
scale?: number
|
||||
theme: Themes
|
||||
isSelected?: boolean
|
||||
}) {
|
||||
const group = new Group()
|
||||
|
||||
const geometry = new BoxGeometry(12, 12, 12) // in pixels scaled later
|
||||
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)
|
||||
|
||||
group.add(mesh)
|
||||
@ -66,7 +69,8 @@ export function profileStart({
|
||||
id,
|
||||
from,
|
||||
pathToNode,
|
||||
isSelected: false,
|
||||
isSelected,
|
||||
baseColor,
|
||||
}
|
||||
group.name = PROFILE_START
|
||||
group.position.set(from[0], from[1], 0)
|
||||
@ -84,6 +88,7 @@ export function straightSegment({
|
||||
callExpName,
|
||||
texture,
|
||||
theme,
|
||||
isSelected = false,
|
||||
}: {
|
||||
from: Coords2d
|
||||
to: Coords2d
|
||||
@ -94,6 +99,7 @@ export function straightSegment({
|
||||
callExpName: string
|
||||
texture: Texture
|
||||
theme: Themes
|
||||
isSelected?: boolean
|
||||
}): Group {
|
||||
const group = new Group()
|
||||
|
||||
@ -119,7 +125,8 @@ export function straightSegment({
|
||||
|
||||
const baseColor =
|
||||
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)
|
||||
mesh.userData.type = isDraftSegment
|
||||
? STRAIGHT_SEGMENT_DASH
|
||||
@ -132,7 +139,7 @@ export function straightSegment({
|
||||
from,
|
||||
to,
|
||||
pathToNode,
|
||||
isSelected: false,
|
||||
isSelected,
|
||||
callExpName,
|
||||
baseColor,
|
||||
}
|
||||
@ -141,7 +148,7 @@ export function straightSegment({
|
||||
const length = Math.sqrt(
|
||||
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)
|
||||
const dir = new Vector3()
|
||||
.subVectors(new Vector3(to[0], to[1], 0), new Vector3(from[0], from[1], 0))
|
||||
@ -169,9 +176,10 @@ export function straightSegment({
|
||||
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({
|
||||
color: getThemeColorForThreeJs(theme),
|
||||
color: color || baseColor,
|
||||
})
|
||||
// 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
|
||||
@ -232,6 +240,7 @@ export function tangentialArcToSegment({
|
||||
scale = 1,
|
||||
texture,
|
||||
theme,
|
||||
isSelected,
|
||||
}: {
|
||||
prevSegment: SketchGroup['value'][number]
|
||||
from: Coords2d
|
||||
@ -242,6 +251,7 @@ export function tangentialArcToSegment({
|
||||
scale?: number
|
||||
texture: Texture
|
||||
theme: Themes
|
||||
isSelected?: boolean
|
||||
}): Group {
|
||||
const group = new Group()
|
||||
|
||||
@ -273,7 +283,8 @@ export function tangentialArcToSegment({
|
||||
})
|
||||
|
||||
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)
|
||||
mesh.userData.type = isDraftSegment
|
||||
? TANGENTIAL_ARC_TO__SEGMENT_DASH
|
||||
@ -286,12 +297,12 @@ export function tangentialArcToSegment({
|
||||
to,
|
||||
prevSegment,
|
||||
pathToNode,
|
||||
isSelected: false,
|
||||
isSelected,
|
||||
baseColor,
|
||||
}
|
||||
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)
|
||||
const arrowheadAngle = endAngle + (Math.PI / 2) * (ccw ? 1 : -1)
|
||||
arrowGroup.quaternion.setFromUnitVectors(
|
||||
|
@ -275,9 +275,9 @@ export const ModelingMachineProvider = ({
|
||||
),
|
||||
'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
|
||||
if (!editorManager.editorView) return {}
|
||||
const dispatchSelection = (selection?: EditorSelection) => {
|
||||
if (!selection) return // TODO less of hack for the below please
|
||||
if (!editorManager.editorView) return
|
||||
editorManager.lastSelectionEvent = Date.now()
|
||||
setTimeout(() => {
|
||||
if (editorManager.editorView) {
|
||||
|
@ -43,20 +43,16 @@ describe('processMemory', () => {
|
||||
theExtrude: [
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: '',
|
||||
id: expect.any(String),
|
||||
faceId: expect.any(String),
|
||||
sourceRange: [170, 194],
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: '',
|
||||
id: expect.any(String),
|
||||
faceId: expect.any(String),
|
||||
sourceRange: [202, 230],
|
||||
},
|
||||
],
|
||||
|
@ -160,9 +160,6 @@ export default class EditorManager {
|
||||
if (selections.codeBasedSelections.length === 0) {
|
||||
return
|
||||
}
|
||||
if (!this.editorView) {
|
||||
return
|
||||
}
|
||||
let codeBasedSelections = []
|
||||
for (const selection of selections.codeBasedSelections) {
|
||||
codeBasedSelections.push(
|
||||
@ -177,6 +174,9 @@ export default class EditorManager {
|
||||
].range[1]
|
||||
)
|
||||
)
|
||||
if (!this.editorView) {
|
||||
return
|
||||
}
|
||||
this.editorView.dispatch({
|
||||
selection: EditorSelection.create(codeBasedSelections, 1),
|
||||
})
|
||||
|
@ -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),
|
||||
entityId: expect.any(String),
|
||||
__meta: [{ sourceRange: [46, 71] }],
|
||||
})
|
||||
})
|
||||
@ -79,8 +73,6 @@ const mySketch001 = startSketchOn('XY')
|
||||
value: [
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: '',
|
||||
id: expect.any(String),
|
||||
@ -88,42 +80,42 @@ const mySketch001 = startSketchOn('XY')
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: '',
|
||||
id: expect.any(String),
|
||||
sourceRange: [108, 132],
|
||||
},
|
||||
],
|
||||
sketchGroupValues: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-1.59, -1.54],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [77, 102],
|
||||
sketchGroup: {
|
||||
id: expect.any(String),
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'SketchGroup',
|
||||
value: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-1.59, -1.54],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [77, 102],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-1.59, -1.54],
|
||||
to: [0.46, -5.82],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [108, 132],
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-1.59, -1.54],
|
||||
to: [0.46, -5.82],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [108, 132],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
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),
|
||||
endCapId: expect.any(String),
|
||||
__meta: [{ sourceRange: [46, 71] }],
|
||||
@ -162,8 +154,6 @@ const sk2 = startSketchOn('XY')
|
||||
value: [
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: '',
|
||||
id: expect.any(String),
|
||||
@ -171,8 +161,6 @@ const sk2 = startSketchOn('XY')
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: 'p',
|
||||
id: expect.any(String),
|
||||
@ -180,52 +168,52 @@ const sk2 = startSketchOn('XY')
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: '',
|
||||
id: expect.any(String),
|
||||
sourceRange: [124, 143],
|
||||
},
|
||||
],
|
||||
sketchGroupValues: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-2.5, 0],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [69, 89],
|
||||
sketchGroup: {
|
||||
id: expect.any(String),
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'SketchGroup',
|
||||
value: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-2.5, 0],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [69, 89],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-2.5, 0],
|
||||
to: [0, 10],
|
||||
name: 'p',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [95, 118],
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-2.5, 0],
|
||||
to: [0, 10],
|
||||
name: 'p',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [95, 118],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 10],
|
||||
to: [2.5, 0],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [124, 143],
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 10],
|
||||
to: [2.5, 0],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [124, 143],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
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),
|
||||
endCapId: expect.any(String),
|
||||
__meta: [{ sourceRange: [38, 63] }],
|
||||
@ -236,8 +224,6 @@ const sk2 = startSketchOn('XY')
|
||||
value: [
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: '',
|
||||
id: expect.any(String),
|
||||
@ -245,8 +231,6 @@ const sk2 = startSketchOn('XY')
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: 'p',
|
||||
id: expect.any(String),
|
||||
@ -254,52 +238,52 @@ const sk2 = startSketchOn('XY')
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
faceId: expect.any(String),
|
||||
name: '',
|
||||
id: expect.any(String),
|
||||
sourceRange: [428, 447],
|
||||
},
|
||||
],
|
||||
sketchGroupValues: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-2.5, 0],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [374, 394],
|
||||
sketchGroup: {
|
||||
id: expect.any(String),
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'SketchGroup',
|
||||
value: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-2.5, 0],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [374, 394],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-2.5, 0],
|
||||
to: [0, 3],
|
||||
name: 'p',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [400, 422],
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-2.5, 0],
|
||||
to: [0, 3],
|
||||
name: 'p',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [400, 422],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 3],
|
||||
to: [2.5, 0],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [428, 447],
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 3],
|
||||
to: [2.5, 0],
|
||||
name: '',
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [428, 447],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
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),
|
||||
endCapId: expect.any(String),
|
||||
__meta: [{ sourceRange: [343, 368] }],
|
||||
|
@ -177,13 +177,7 @@ const newVar = myVar + 1`
|
||||
},
|
||||
},
|
||||
],
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0, 1],
|
||||
xAxis: { x: 1, y: 0, z: 0 },
|
||||
yAxis: { x: 0, y: 1, z: 0 },
|
||||
zAxis: { x: 0, y: 0, z: 1 },
|
||||
id: expect.any(String),
|
||||
entityId: expect.any(String),
|
||||
__meta: [{ sourceRange: [39, 63] }],
|
||||
})
|
||||
})
|
||||
|
@ -317,7 +317,8 @@ describe('testing sketchOnExtrudedFace', () => {
|
||||
|> line([8.62, -9.57], %)
|
||||
|> close(%)
|
||||
|> extrude(5 + 7, %)
|
||||
const sketch001 = startSketchOn(part001, 'seg01')`)
|
||||
const surface001 = startSketchOn(part001, 'seg01')
|
||||
const sketch001 = surface001`)
|
||||
})
|
||||
test('it should be able to extrude on close segments', async () => {
|
||||
const code = `const part001 = startSketchOn('-XZ')
|
||||
@ -354,7 +355,8 @@ const sketch001 = startSketchOn(part001, 'seg01')`)
|
||||
|> line([8.62, -9.57], %)
|
||||
|> close(%, 'seg01')
|
||||
|> extrude(5 + 7, %)
|
||||
const sketch001 = startSketchOn(part001, 'seg01')`)
|
||||
const surface001 = startSketchOn(part001, 'seg01')
|
||||
const sketch001 = surface001`)
|
||||
})
|
||||
test('it should be able to extrude on start-end caps', async () => {
|
||||
const code = `const part001 = startSketchOn('-XZ')
|
||||
@ -392,7 +394,8 @@ const sketch001 = startSketchOn(part001, 'seg01')`)
|
||||
|> line([8.62, -9.57], %)
|
||||
|> close(%)
|
||||
|> extrude(5 + 7, %)
|
||||
const sketch001 = startSketchOn(part001, 'END')`)
|
||||
const surface001 = startSketchOn(part001, 'END')
|
||||
const sketch001 = surface001`)
|
||||
})
|
||||
test('it should ensure that the new sketch is inserted after the extrude', async () => {
|
||||
const code = `const sketch001 = startSketchOn('-XZ')
|
||||
@ -432,7 +435,8 @@ const sketch001 = startSketchOn(part001, 'END')`)
|
||||
)
|
||||
const newCode = recast(modifiedAst)
|
||||
expect(newCode).toContain(`const part001 = extrude(5 + 7, sketch001)
|
||||
const sketch002 = startSketchOn(part001, 'seg01')`)
|
||||
const surface001 = startSketchOn(part001, 'seg01')
|
||||
const sketch002 = surface001`)
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -43,15 +43,27 @@ export function startSketchOnDefault(
|
||||
name = ''
|
||||
): { modifiedAst: Program; id: string; pathToNode: PathToNode } {
|
||||
const _node = { ...node }
|
||||
const _name =
|
||||
name || findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH)
|
||||
const surfaceName =
|
||||
name || findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SURFACE)
|
||||
|
||||
const startSketchOn = createCallExpressionStdLib('startSketchOn', [
|
||||
createLiteral(axis),
|
||||
])
|
||||
|
||||
const variableDeclaration = createVariableDeclaration(_name, startSketchOn)
|
||||
_node.body = [...node.body, variableDeclaration]
|
||||
const surfaceVariableDeclaration = createVariableDeclaration(
|
||||
surfaceName,
|
||||
startSketchOn
|
||||
)
|
||||
_node.body = [..._node.body, surfaceVariableDeclaration]
|
||||
|
||||
// Create the variable for the sketch.
|
||||
const sketchName =
|
||||
name || findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH)
|
||||
const sketchVariableDeclaration = createVariableDeclaration(
|
||||
sketchName,
|
||||
createIdentifier(surfaceName)
|
||||
)
|
||||
_node.body = [..._node.body, sketchVariableDeclaration]
|
||||
const sketchIndex = _node.body.length - 1
|
||||
|
||||
let pathToNode: PathToNode = [
|
||||
@ -64,7 +76,7 @@ export function startSketchOnDefault(
|
||||
|
||||
return {
|
||||
modifiedAst: _node,
|
||||
id: _name,
|
||||
id: sketchName,
|
||||
pathToNode,
|
||||
}
|
||||
}
|
||||
@ -333,10 +345,11 @@ export function sketchOnExtrudedFace(
|
||||
cap: 'none' | 'start' | 'end' = 'none'
|
||||
): { modifiedAst: Program; pathToNode: PathToNode } {
|
||||
let _node = { ...node }
|
||||
const newSketchName = findUniqueName(
|
||||
const newSurfaceName = findUniqueName(
|
||||
node,
|
||||
KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH
|
||||
KCL_DEFAULT_CONSTANT_PREFIXES.SURFACE
|
||||
)
|
||||
|
||||
const { node: oldSketchNode } = getNodeFromPath<VariableDeclarator>(
|
||||
_node,
|
||||
sketchPathToNode,
|
||||
@ -372,8 +385,8 @@ export function sketchOnExtrudedFace(
|
||||
_tag = cap.toUpperCase()
|
||||
}
|
||||
|
||||
const newSketch = createVariableDeclaration(
|
||||
newSketchName,
|
||||
const newSurface = createVariableDeclaration(
|
||||
newSurfaceName,
|
||||
createCallExpressionStdLib('startSketchOn', [
|
||||
createIdentifier(extrudeName ? extrudeName : oldSketchName),
|
||||
createLiteral(_tag),
|
||||
@ -385,18 +398,31 @@ export function sketchOnExtrudedFace(
|
||||
sketchPathToNode[1][0] as number,
|
||||
extrudePathToNode[1][0] as number
|
||||
)
|
||||
_node.body.splice(expressionIndex + 1, 0, newSketch)
|
||||
const newpathToNode: PathToNode = [
|
||||
_node.body.splice(expressionIndex + 1, 0, newSurface)
|
||||
|
||||
// Create the variable for the sketch.
|
||||
const newSketchName = findUniqueName(
|
||||
node,
|
||||
KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH
|
||||
)
|
||||
const sketchVariableDeclaration = createVariableDeclaration(
|
||||
newSketchName,
|
||||
createIdentifier(newSurfaceName)
|
||||
)
|
||||
const sketchIndex = expressionIndex + 2
|
||||
_node.body.splice(sketchIndex, 0, sketchVariableDeclaration)
|
||||
|
||||
let newPathToNode: PathToNode = [
|
||||
['body', ''],
|
||||
[expressionIndex + 1, 'index'],
|
||||
[sketchIndex, 'index'],
|
||||
['declarations', 'VariableDeclaration'],
|
||||
[0, 'index'],
|
||||
['0', 'index'],
|
||||
['init', 'VariableDeclarator'],
|
||||
]
|
||||
|
||||
return {
|
||||
modifiedAst: _node,
|
||||
pathToNode: newpathToNode,
|
||||
pathToNode: newPathToNode,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -661,14 +661,6 @@ export function isSingleCursorInPipe(
|
||||
ast: Program
|
||||
) {
|
||||
if (selectionRanges.codeBasedSelections.length !== 1) return false
|
||||
if (
|
||||
doesPipeHaveCallExp({
|
||||
ast,
|
||||
selection: selectionRanges.codeBasedSelections[0],
|
||||
calleeName: 'extrude',
|
||||
})
|
||||
)
|
||||
return false
|
||||
const selection = selectionRanges.codeBasedSelections[0]
|
||||
const pathToNode = getNodePathFromSourceRange(ast, selection.range)
|
||||
const nodeTypes = pathToNode.map(([, type]) => type)
|
||||
|
@ -1466,6 +1466,9 @@ export class EngineCommandManager extends EventTarget {
|
||||
|
||||
if (command && command.type === 'pending') {
|
||||
const resolve = command.resolve
|
||||
const oldArtifact = this.artifactMap[id] as ArtifactMapCommand & {
|
||||
extrusions?: string[]
|
||||
}
|
||||
const artifact = {
|
||||
type: 'result',
|
||||
range: command.range,
|
||||
@ -1474,7 +1477,10 @@ export class EngineCommandManager extends EventTarget {
|
||||
parentId: command.parentId ? command.parentId : undefined,
|
||||
data: modelingResponse,
|
||||
raw,
|
||||
} as const
|
||||
} as ArtifactMapCommand & { extrusions?: string[] }
|
||||
if (oldArtifact?.extrusions) {
|
||||
artifact.extrusions = oldArtifact.extrusions
|
||||
}
|
||||
this.artifactMap[id] = artifact
|
||||
if (
|
||||
(command.commandType === 'entity_linear_pattern' &&
|
||||
@ -1903,6 +1909,8 @@ export class EngineCommandManager extends EventTarget {
|
||||
} else {
|
||||
typedTarget.extrusions = [id]
|
||||
}
|
||||
// Update in the map.
|
||||
this.artifactMap[command.target] = typedTarget
|
||||
}
|
||||
}
|
||||
return promise
|
||||
|
@ -1583,7 +1583,10 @@ export function transformAstSketchLines({
|
||||
})
|
||||
|
||||
const varName = varDec.id.name
|
||||
const sketchGroup = programMemory.root?.[varName]
|
||||
let sketchGroup = programMemory.root?.[varName]
|
||||
if (sketchGroup.type === 'ExtrudeGroup') {
|
||||
sketchGroup = sketchGroup.sketchGroup
|
||||
}
|
||||
if (!sketchGroup || sketchGroup.type !== 'SketchGroup')
|
||||
throw new Error('not a sketch group')
|
||||
const seg = getSketchSegmentFromPathToNode(
|
||||
|
@ -59,9 +59,11 @@ export function isCursorInSketchCommandRange(
|
||||
artifact.commandType === 'close_path')
|
||||
)
|
||||
)
|
||||
return overlapingEntries.length && overlapingEntries[0][1].parentId
|
||||
? overlapingEntries[0][1].parentId
|
||||
: overlapingEntries.find(
|
||||
([, artifact]) => artifact.commandType === 'start_path'
|
||||
)?.[0] || false
|
||||
let result =
|
||||
overlapingEntries.length && overlapingEntries[0][1].parentId
|
||||
? overlapingEntries[0][1].parentId
|
||||
: overlapingEntries.find(
|
||||
([, artifact]) => artifact.commandType === 'start_path'
|
||||
)?.[0] || false
|
||||
return result
|
||||
}
|
||||
|
@ -74,8 +74,6 @@ export type SyntaxType =
|
||||
| 'UnaryExpression'
|
||||
|
||||
export type { SourceRange } from '../wasm-lib/kcl/bindings/SourceRange'
|
||||
export type { Position } from '../wasm-lib/kcl/bindings/Position'
|
||||
export type { Rotation } from '../wasm-lib/kcl/bindings/Rotation'
|
||||
export type { Path } from '../wasm-lib/kcl/bindings/Path'
|
||||
export type { SketchGroup } from '../wasm-lib/kcl/bindings/SketchGroup'
|
||||
export type { ExtrudeGroup } from '../wasm-lib/kcl/bindings/ExtrudeGroup'
|
||||
|
@ -49,6 +49,8 @@ export const ONBOARDING_PROJECT_NAME = 'Tutorial Project $nn'
|
||||
* These are used to generate unique names for new objects.
|
||||
* */
|
||||
export const KCL_DEFAULT_CONSTANT_PREFIXES = {
|
||||
SURFACE: 'surface',
|
||||
PROFILE: 'profile',
|
||||
SKETCH: 'sketch',
|
||||
EXTRUDE: 'extrude',
|
||||
} as const
|
||||
|
@ -278,7 +278,7 @@ export function processCodeMirrorRanges({
|
||||
}
|
||||
}
|
||||
|
||||
function updateSceneObjectColors(codeBasedSelections: Selection[]) {
|
||||
export function updateSceneObjectColors(codeBasedSelections: Selection[]) {
|
||||
let updated: Program
|
||||
try {
|
||||
updated = parse(recast(kclManager.ast))
|
||||
@ -301,6 +301,7 @@ function updateSceneObjectColors(codeBasedSelections: Selection[]) {
|
||||
const groupHasCursor = codeBasedSelections.some((selection) => {
|
||||
return isOverlap(selection.range, [node.start, node.end])
|
||||
})
|
||||
|
||||
const color = groupHasCursor
|
||||
? 0x0000ff
|
||||
: segmentGroup?.userData?.baseColor || 0xffffff
|
||||
|
@ -900,7 +900,10 @@ export const modelingMachine = createMachine(
|
||||
sceneInfra.modelingSend('Equip Line tool')
|
||||
}
|
||||
},
|
||||
'setup client side sketch segments': ({ sketchDetails }) => {
|
||||
'setup client side sketch segments': ({
|
||||
sketchDetails,
|
||||
selectionRanges,
|
||||
}) => {
|
||||
if (!sketchDetails) return
|
||||
;(async () => {
|
||||
if (Object.keys(sceneEntitiesManager.activeSegments).length > 0) {
|
||||
@ -913,6 +916,7 @@ export const modelingMachine = createMachine(
|
||||
up: sketchDetails.yAxis,
|
||||
position: sketchDetails.origin,
|
||||
maybeModdedAst: kclManager.ast,
|
||||
selectionRanges,
|
||||
})
|
||||
sceneInfra.resetMouseListeners()
|
||||
sceneEntitiesManager.setupSketchIdleCallbacks({
|
||||
|
74
src/wasm-lib/Cargo.lock
generated
@ -169,7 +169,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -180,7 +180,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -197,7 +197,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -437,7 +437,7 @@ dependencies = [
|
||||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -635,7 +635,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim 0.10.0",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -646,7 +646,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -687,7 +687,7 @@ checksum = "4078275de501a61ceb9e759d37bdd3d7210e654dbc167ac1a3678ef4435ed57b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
@ -716,7 +716,7 @@ dependencies = [
|
||||
"rustfmt-wrapper",
|
||||
"serde",
|
||||
"serde_tokenstream",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -727,7 +727,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -754,7 +754,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -926,7 +926,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1016,7 +1016,7 @@ dependencies = [
|
||||
"inflections",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1375,7 +1375,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-lib"
|
||||
version = "0.1.60"
|
||||
version = "0.1.62"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"approx",
|
||||
@ -1438,7 +1438,7 @@ dependencies = [
|
||||
"pretty_assertions",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1814,7 +1814,7 @@ dependencies = [
|
||||
"regex",
|
||||
"regex-syntax 0.8.3",
|
||||
"structmeta",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1867,7 +1867,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2031,7 +2031,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"pyo3-macros-backend",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2044,7 +2044,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"pyo3-build-config",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2506,7 +2506,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde_derive_internals",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2580,7 +2580,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2591,7 +2591,7 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2614,7 +2614,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2635,7 +2635,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2772,7 +2772,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"structmeta-derive",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2783,7 +2783,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2827,9 +2827,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.66"
|
||||
version = "2.0.67"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
|
||||
checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2850,7 +2850,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2933,7 +2933,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3029,7 +3029,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3182,7 +3182,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3210,7 +3210,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3287,7 +3287,7 @@ checksum = "cbdee324e50a7402416d9c25270d3df4241ed528af5d36dda18b6f219551c577"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
"termcolor",
|
||||
]
|
||||
|
||||
@ -3446,7 +3446,7 @@ dependencies = [
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3507,7 +3507,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
@ -3542,7 +3542,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
@ -3867,7 +3867,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.66",
|
||||
"syn 2.0.67",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -20,7 +20,7 @@ quote = "1"
|
||||
regex = "1.10"
|
||||
serde = { version = "1.0.203", features = ["derive"] }
|
||||
serde_tokenstream = "0.2"
|
||||
syn = { version = "2.0.66", features = ["full"] }
|
||||
syn = { version = "2.0.67", features = ["full"] }
|
||||
|
||||
[dev-dependencies]
|
||||
anyhow = "1.0.86"
|
||||
|
@ -15,7 +15,7 @@ databake = "0.1.8"
|
||||
kcl-lib = { path = "../kcl" }
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = { version = "2.0.66", features = ["full"] }
|
||||
syn = { version = "2.0.67", features = ["full"] }
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "1.4.0"
|
||||
|
@ -1,12 +1,14 @@
|
||||
[package]
|
||||
name = "kcl-test-server"
|
||||
description = "A test server for KCL"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.86"
|
||||
hyper = { version = "0.14.29", features = ["server"] }
|
||||
kcl-lib = { path = "../kcl" }
|
||||
kcl-lib = { version = "0.1.62", path = "../kcl" }
|
||||
pico-args = "0.5.0"
|
||||
serde = { version = "1.0.203", features = ["derive"] }
|
||||
serde_json = "1.0.117"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "kcl-lib"
|
||||
description = "KittyCAD Language implementation and tools"
|
||||
version = "0.1.60"
|
||||
version = "0.1.62"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
|
@ -153,6 +153,34 @@ pub enum MemoryItem {
|
||||
},
|
||||
}
|
||||
|
||||
impl MemoryItem {
|
||||
pub fn get_sketch_group_set(&self) -> Result<SketchGroupSet> {
|
||||
match self {
|
||||
MemoryItem::SketchGroup(s) => Ok(SketchGroupSet::SketchGroup(s.clone())),
|
||||
MemoryItem::SketchGroups { value } => Ok(SketchGroupSet::SketchGroups(value.clone())),
|
||||
MemoryItem::UserVal(value) => {
|
||||
let sg: Vec<Box<SketchGroup>> = serde_json::from_value(value.value.clone())
|
||||
.map_err(|e| anyhow::anyhow!("Failed to deserialize array of sketch groups from JSON: {}", e))?;
|
||||
Ok(SketchGroupSet::SketchGroups(sg.clone()))
|
||||
}
|
||||
_ => anyhow::bail!("Not a sketch group or sketch groups: {:?}", self),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_extrude_group_set(&self) -> Result<ExtrudeGroupSet> {
|
||||
match self {
|
||||
MemoryItem::ExtrudeGroup(e) => Ok(ExtrudeGroupSet::ExtrudeGroup(e.clone())),
|
||||
MemoryItem::ExtrudeGroups { value } => Ok(ExtrudeGroupSet::ExtrudeGroups(value.clone())),
|
||||
MemoryItem::UserVal(value) => {
|
||||
let eg: Vec<Box<ExtrudeGroup>> = serde_json::from_value(value.value.clone())
|
||||
.map_err(|e| anyhow::anyhow!("Failed to deserialize array of extrude groups from JSON: {}", e))?;
|
||||
Ok(ExtrudeGroupSet::ExtrudeGroups(eg.clone()))
|
||||
}
|
||||
_ => anyhow::bail!("Not a extrude group or extrude groups: {:?}", self),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A geometry.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
@ -261,8 +289,6 @@ pub struct Face {
|
||||
pub y_axis: Point3d,
|
||||
/// The z-axis (normal).
|
||||
pub z_axis: Point3d,
|
||||
/// the face id the sketch is on
|
||||
pub face_id: uuid::Uuid,
|
||||
#[serde(rename = "__meta")]
|
||||
pub meta: Vec<Metadata>,
|
||||
}
|
||||
@ -428,18 +454,6 @@ pub struct SketchGroup {
|
||||
pub on: SketchSurface,
|
||||
/// The starting path.
|
||||
pub start: BasePath,
|
||||
/// The position of the sketch group.
|
||||
pub position: Position,
|
||||
/// The rotation of the sketch group base plane.
|
||||
pub rotation: Rotation,
|
||||
/// The x-axis of the sketch group base plane in the 3D space
|
||||
pub x_axis: Point3d,
|
||||
/// The y-axis of the sketch group base plane in the 3D space
|
||||
pub y_axis: Point3d,
|
||||
/// The z-axis of the sketch group base plane in the 3D space
|
||||
pub z_axis: Point3d,
|
||||
/// The plane id or face id of the sketch group.
|
||||
pub entity_id: Option<uuid::Uuid>,
|
||||
/// Metadata.
|
||||
#[serde(rename = "__meta")]
|
||||
pub meta: Vec<Metadata>,
|
||||
@ -556,20 +570,10 @@ pub struct ExtrudeGroup {
|
||||
pub id: uuid::Uuid,
|
||||
/// The extrude surfaces.
|
||||
pub value: Vec<ExtrudeSurface>,
|
||||
/// The sketch group paths.
|
||||
pub sketch_group_values: Vec<Path>,
|
||||
/// The sketch group.
|
||||
pub sketch_group: SketchGroup,
|
||||
/// The height of the extrude group.
|
||||
pub height: f64,
|
||||
/// The position of the extrude group.
|
||||
pub position: Position,
|
||||
/// The rotation of the extrude group.
|
||||
pub rotation: Rotation,
|
||||
/// The x-axis of the extrude group base plane in the 3D space
|
||||
pub x_axis: Point3d,
|
||||
/// The y-axis of the extrude group base plane in the 3D space
|
||||
pub y_axis: Point3d,
|
||||
/// The z-axis of the extrude group base plane in the 3D space
|
||||
pub z_axis: Point3d,
|
||||
/// The id of the extrusion start cap
|
||||
pub start_cap_id: Option<uuid::Uuid>,
|
||||
/// The id of the extrusion end cap
|
||||
@ -598,24 +602,6 @@ pub enum BodyType {
|
||||
Block,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
pub struct Position(#[ts(type = "[number, number, number]")] pub [f64; 3]);
|
||||
|
||||
impl From<Position> for Point3d {
|
||||
fn from(p: Position) -> Self {
|
||||
Self {
|
||||
x: p.0[0],
|
||||
y: p.0[1],
|
||||
z: p.0[2],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
pub struct Rotation(#[ts(type = "[number, number, number, number]")] pub [f64; 4]);
|
||||
|
||||
#[derive(Debug, Default, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS, JsonSchema, Hash, Eq)]
|
||||
#[cfg_attr(feature = "pyo3", pyo3::pyclass)]
|
||||
#[ts(export)]
|
||||
@ -645,7 +631,7 @@ impl SourceRange {
|
||||
pub fn start_to_lsp_position(&self, code: &str) -> LspPosition {
|
||||
// Calculate the line and column of the error from the source range.
|
||||
// Lines are zero indexed in vscode so we need to subtract 1.
|
||||
let mut line = code[..self.start()].lines().count();
|
||||
let mut line = code.get(..self.start()).unwrap_or_default().lines().count();
|
||||
if line > 0 {
|
||||
line = line.saturating_sub(1);
|
||||
}
|
||||
@ -658,7 +644,7 @@ impl SourceRange {
|
||||
}
|
||||
|
||||
pub fn end_to_lsp_position(&self, code: &str) -> LspPosition {
|
||||
let lines = code[..self.end()].lines();
|
||||
let lines = code.get(..self.end()).unwrap_or_default().lines();
|
||||
if lines.clone().count() == 0 {
|
||||
return LspPosition { line: 0, character: 0 };
|
||||
}
|
||||
@ -896,10 +882,6 @@ pub enum ExtrudeSurface {
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExtrudePlane {
|
||||
/// The position.
|
||||
pub position: Position,
|
||||
/// The rotation.
|
||||
pub rotation: Rotation,
|
||||
/// The face id for the extrude plane.
|
||||
pub face_id: uuid::Uuid,
|
||||
/// The name.
|
||||
@ -914,10 +896,6 @@ pub struct ExtrudePlane {
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExtrudeArc {
|
||||
/// The position.
|
||||
pub position: Position,
|
||||
/// The rotation.
|
||||
pub rotation: Rotation,
|
||||
/// The face id for the extrude plane.
|
||||
pub face_id: uuid::Uuid,
|
||||
/// The name.
|
||||
@ -941,20 +919,6 @@ impl ExtrudeSurface {
|
||||
ExtrudeSurface::ExtrudeArc(ea) => ea.name.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_position(&self) -> Position {
|
||||
match self {
|
||||
ExtrudeSurface::ExtrudePlane(ep) => ep.position,
|
||||
ExtrudeSurface::ExtrudeArc(ea) => ea.position,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_rotation(&self) -> Rotation {
|
||||
match self {
|
||||
ExtrudeSurface::ExtrudePlane(ep) => ep.rotation,
|
||||
ExtrudeSurface::ExtrudeArc(ea) => ea.rotation,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
|
@ -3,6 +3,7 @@
|
||||
//! KCL is written in Rust. This crate contains the compiler tooling (e.g. parser, lexer, code generation),
|
||||
//! the standard library implementation, a LSP implementation, generator for the docs, and more.
|
||||
#![recursion_limit = "1024"]
|
||||
#![allow(clippy::boxed_local)]
|
||||
|
||||
macro_rules! println {
|
||||
($($rest:tt)*) => {
|
||||
|
@ -94,7 +94,8 @@ async fn inner_chamfer(
|
||||
EdgeReference::Uuid(uuid) => uuid,
|
||||
EdgeReference::Tag(tag) => {
|
||||
extrude_group
|
||||
.sketch_group_values
|
||||
.sketch_group
|
||||
.value
|
||||
.iter()
|
||||
.find(|p| p.get_name() == tag)
|
||||
.ok_or_else(|| {
|
||||
|
@ -150,7 +150,7 @@ pub(crate) async fn do_post_extrude(
|
||||
let mut sketch_group = *sketch_group.clone();
|
||||
|
||||
// If we were sketching on a face, we need the original face id.
|
||||
if let SketchSurface::Face(face) = sketch_group.on {
|
||||
if let SketchSurface::Face(ref face) = sketch_group.on {
|
||||
sketch_group.id = face.sketch_group_id;
|
||||
}
|
||||
|
||||
@ -198,8 +198,6 @@ pub(crate) async fn do_post_extrude(
|
||||
match path {
|
||||
Path::TangentialArc { .. } | Path::TangentialArcTo { .. } => {
|
||||
let extrude_surface = ExtrudeSurface::ExtrudeArc(crate::executor::ExtrudeArc {
|
||||
position: sketch_group.position, // TODO should be for the extrude surface
|
||||
rotation: sketch_group.rotation, // TODO should be for the extrude surface
|
||||
face_id: *actual_face_id,
|
||||
name: path.get_base().name.clone(),
|
||||
geo_meta: GeoMeta {
|
||||
@ -211,8 +209,6 @@ pub(crate) async fn do_post_extrude(
|
||||
}
|
||||
Path::Base { .. } | Path::ToPoint { .. } | Path::Horizontal { .. } | Path::AngledLineTo { .. } => {
|
||||
let extrude_surface = ExtrudeSurface::ExtrudePlane(crate::executor::ExtrudePlane {
|
||||
position: sketch_group.position, // TODO should be for the extrude surface
|
||||
rotation: sketch_group.rotation, // TODO should be for the extrude surface
|
||||
face_id: *actual_face_id,
|
||||
name: path.get_base().name.clone(),
|
||||
geo_meta: GeoMeta {
|
||||
@ -226,8 +222,6 @@ pub(crate) async fn do_post_extrude(
|
||||
} else if args.ctx.is_mock {
|
||||
// Only pre-populate the extrude surface if we are in mock mode.
|
||||
new_value.push(ExtrudeSurface::ExtrudePlane(crate::executor::ExtrudePlane {
|
||||
position: sketch_group.position, // TODO should be for the extrude surface
|
||||
rotation: sketch_group.rotation, // TODO should be for the extrude surface
|
||||
// pushing this values with a fake face_id to make extrudes mock-execute safe
|
||||
face_id: Uuid::new_v4(),
|
||||
name: path.get_base().name.clone(),
|
||||
@ -245,13 +239,8 @@ pub(crate) async fn do_post_extrude(
|
||||
// sketch group.
|
||||
id: sketch_group.id,
|
||||
value: new_value,
|
||||
sketch_group_values: sketch_group.value.clone(),
|
||||
sketch_group: sketch_group.clone(),
|
||||
height: length,
|
||||
position: sketch_group.position,
|
||||
rotation: sketch_group.rotation,
|
||||
x_axis: sketch_group.x_axis,
|
||||
y_axis: sketch_group.y_axis,
|
||||
z_axis: sketch_group.z_axis,
|
||||
start_cap_id,
|
||||
end_cap_id,
|
||||
meta: sketch_group.meta,
|
||||
|
@ -95,7 +95,8 @@ async fn inner_fillet(
|
||||
EdgeReference::Uuid(uuid) => uuid,
|
||||
EdgeReference::Tag(tag) => {
|
||||
extrude_group
|
||||
.sketch_group_values
|
||||
.sketch_group
|
||||
.value
|
||||
.iter()
|
||||
.find(|p| p.get_name() == tag)
|
||||
.ok_or_else(|| {
|
||||
@ -177,7 +178,8 @@ async fn inner_get_opposite_edge(tag: String, extrude_group: Box<ExtrudeGroup>,
|
||||
return Ok(Uuid::new_v4());
|
||||
}
|
||||
let tagged_path = extrude_group
|
||||
.sketch_group_values
|
||||
.sketch_group
|
||||
.value
|
||||
.iter()
|
||||
.find(|p| p.get_name() == tag)
|
||||
.ok_or_else(|| {
|
||||
@ -268,7 +270,8 @@ async fn inner_get_next_adjacent_edge(
|
||||
return Ok(Uuid::new_v4());
|
||||
}
|
||||
let tagged_path = extrude_group
|
||||
.sketch_group_values
|
||||
.sketch_group
|
||||
.value
|
||||
.iter()
|
||||
.find(|p| p.get_name() == tag)
|
||||
.ok_or_else(|| {
|
||||
@ -364,7 +367,8 @@ async fn inner_get_previous_adjacent_edge(
|
||||
return Ok(Uuid::new_v4());
|
||||
}
|
||||
let tagged_path = extrude_group
|
||||
.sketch_group_values
|
||||
.sketch_group
|
||||
.value
|
||||
.iter()
|
||||
.find(|p| p.get_name() == tag)
|
||||
.ok_or_else(|| {
|
||||
|
@ -437,18 +437,14 @@ impl Args {
|
||||
})
|
||||
})?;
|
||||
|
||||
let sketch_set = if let MemoryItem::SketchGroup(sg) = first_value {
|
||||
SketchGroupSet::SketchGroup(sg.clone())
|
||||
} else if let MemoryItem::SketchGroups { value } = first_value {
|
||||
SketchGroupSet::SketchGroups(value.clone())
|
||||
} else {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
message: format!(
|
||||
"Expected a SketchGroup or Vector of SketchGroups as the first argument, found `{:?}`",
|
||||
self.args
|
||||
),
|
||||
source_ranges: vec![self.source_range],
|
||||
}));
|
||||
let sketch_set = match first_value.get_sketch_group_set() {
|
||||
Ok(set) => set,
|
||||
Err(err) => {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
message: format!("Expected an SketchGroupSet as the first argument: {}", err),
|
||||
source_ranges: vec![self.source_range],
|
||||
}))
|
||||
}
|
||||
};
|
||||
|
||||
let second_value = self.args.get(1).ok_or_else(|| {
|
||||
@ -672,18 +668,14 @@ impl Args {
|
||||
})
|
||||
})?;
|
||||
|
||||
let sketch_set = if let MemoryItem::SketchGroup(sg) = second_value {
|
||||
SketchGroupSet::SketchGroup(sg.clone())
|
||||
} else if let MemoryItem::SketchGroups { value } = second_value {
|
||||
SketchGroupSet::SketchGroups(value.clone())
|
||||
} else {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
message: format!(
|
||||
"Expected a SketchGroup or Vector of SketchGroups as the second argument, found `{:?}`",
|
||||
self.args
|
||||
),
|
||||
source_ranges: vec![self.source_range],
|
||||
}));
|
||||
let sketch_set = match second_value.get_sketch_group_set() {
|
||||
Ok(set) => set,
|
||||
Err(err) => {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
message: format!("Expected an SketchGroupSet as the second argument: {}", err),
|
||||
source_ranges: vec![self.source_range],
|
||||
}))
|
||||
}
|
||||
};
|
||||
|
||||
Ok((data, sketch_set))
|
||||
@ -813,18 +805,14 @@ impl Args {
|
||||
})
|
||||
})?;
|
||||
|
||||
let extrude_set = if let MemoryItem::ExtrudeGroup(eg) = second_value {
|
||||
ExtrudeGroupSet::ExtrudeGroup(eg.clone())
|
||||
} else if let MemoryItem::ExtrudeGroups { value } = second_value {
|
||||
ExtrudeGroupSet::ExtrudeGroups(value.clone())
|
||||
} else {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
message: format!(
|
||||
"Expected a ExtrudeGroup or Vector of ExtrudeGroups as the second argument, found `{:?}`",
|
||||
self.args
|
||||
),
|
||||
source_ranges: vec![self.source_range],
|
||||
}));
|
||||
let extrude_set = match second_value.get_extrude_group_set() {
|
||||
Ok(set) => set,
|
||||
Err(err) => {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
message: format!("Expected an ExtrudeGroupSet as the second argument: {}", err),
|
||||
source_ranges: vec![self.source_range],
|
||||
}))
|
||||
}
|
||||
};
|
||||
|
||||
Ok((data, extrude_set))
|
||||
@ -953,18 +941,14 @@ impl Args {
|
||||
})
|
||||
})?;
|
||||
|
||||
let sketch_set = if let MemoryItem::SketchGroup(sg) = second_value {
|
||||
SketchGroupSet::SketchGroup(sg.clone())
|
||||
} else if let MemoryItem::SketchGroups { value } = second_value {
|
||||
SketchGroupSet::SketchGroups(value.clone())
|
||||
} else {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
message: format!(
|
||||
"Expected a SketchGroup or Vector of SketchGroups as the second argument, found `{:?}`",
|
||||
self.args
|
||||
),
|
||||
source_ranges: vec![self.source_range],
|
||||
}));
|
||||
let sketch_set = match second_value.get_sketch_group_set() {
|
||||
Ok(set) => set,
|
||||
Err(err) => {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
message: format!("Expected an SketchGroupSet as the second argument: {}", err),
|
||||
source_ranges: vec![self.source_range],
|
||||
}))
|
||||
}
|
||||
};
|
||||
|
||||
Ok((number, sketch_set))
|
||||
|
@ -336,7 +336,8 @@ async fn inner_get_edge(tag: String, extrude_group: Box<ExtrudeGroup>, args: Arg
|
||||
return Ok(Uuid::new_v4());
|
||||
}
|
||||
let tagged_path = extrude_group
|
||||
.sketch_group_values
|
||||
.sketch_group
|
||||
.value
|
||||
.iter()
|
||||
.find(|p| p.get_name() == tag)
|
||||
.ok_or_else(|| {
|
||||
|
@ -11,7 +11,7 @@ use crate::{
|
||||
errors::{KclError, KclErrorDetails},
|
||||
executor::{
|
||||
BasePath, ExtrudeGroup, ExtrudeSurface, Face, GeoMeta, MemoryItem, Path, Plane, PlaneType, Point2d, Point3d,
|
||||
Position, Rotation, SketchGroup, SketchGroupSet, SketchSurface, SourceRange, UserVal,
|
||||
SketchGroup, SketchGroupSet, SketchSurface, SourceRange, UserVal,
|
||||
},
|
||||
std::{
|
||||
utils::{
|
||||
@ -1069,30 +1069,15 @@ async fn start_sketch_on_face(
|
||||
})?,
|
||||
};
|
||||
|
||||
// Enter sketch mode on the face.
|
||||
let id = uuid::Uuid::new_v4();
|
||||
args.batch_modeling_cmd(
|
||||
id,
|
||||
ModelingCmd::EnableSketchMode {
|
||||
animated: false,
|
||||
ortho: false,
|
||||
entity_id: extrude_plane_id,
|
||||
adjust_camera: false,
|
||||
planar_normal: None,
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(Box::new(Face {
|
||||
id,
|
||||
id: extrude_plane_id,
|
||||
value: tag.to_string(),
|
||||
sketch_group_id: extrude_group.id,
|
||||
// TODO: get this from the extrude plane data.
|
||||
x_axis: extrude_group.x_axis,
|
||||
y_axis: extrude_group.y_axis,
|
||||
z_axis: extrude_group.z_axis,
|
||||
x_axis: extrude_group.sketch_group.on.x_axis(),
|
||||
y_axis: extrude_group.sketch_group.on.y_axis(),
|
||||
z_axis: extrude_group.sketch_group.on.z_axis(),
|
||||
meta: vec![args.source_range.into()],
|
||||
face_id: extrude_plane_id,
|
||||
}))
|
||||
}
|
||||
|
||||
@ -1134,20 +1119,6 @@ async fn start_sketch_on_plane(data: PlaneData, args: Args) -> Result<Box<Plane>
|
||||
}
|
||||
};
|
||||
|
||||
// Enter sketch mode on the plane.
|
||||
args.batch_modeling_cmd(
|
||||
uuid::Uuid::new_v4(),
|
||||
ModelingCmd::EnableSketchMode {
|
||||
animated: false,
|
||||
ortho: false,
|
||||
entity_id: plane.id,
|
||||
// We pass in the normal for the plane here.
|
||||
planar_normal: Some(plane.z_axis.clone().into()),
|
||||
adjust_camera: false,
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(Box::new(plane))
|
||||
}
|
||||
|
||||
@ -1202,6 +1173,26 @@ pub(crate) async fn inner_start_profile_at(
|
||||
tag: Option<String>,
|
||||
args: Args,
|
||||
) -> Result<Box<SketchGroup>, KclError> {
|
||||
// Enter sketch mode on the surface.
|
||||
// We call this here so you can reuse the sketch surface for multiple sketches.
|
||||
let id = uuid::Uuid::new_v4();
|
||||
args.batch_modeling_cmd(
|
||||
id,
|
||||
ModelingCmd::EnableSketchMode {
|
||||
animated: false,
|
||||
ortho: false,
|
||||
entity_id: sketch_surface.id(),
|
||||
adjust_camera: false,
|
||||
planar_normal: if let SketchSurface::Plane(plane) = &sketch_surface {
|
||||
// We pass in the normal for the plane here.
|
||||
Some(plane.z_axis.clone().into())
|
||||
} else {
|
||||
None
|
||||
},
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
|
||||
let id = uuid::Uuid::new_v4();
|
||||
let path_id = uuid::Uuid::new_v4();
|
||||
|
||||
@ -1232,12 +1223,6 @@ pub(crate) async fn inner_start_profile_at(
|
||||
let sketch_group = SketchGroup {
|
||||
id: path_id,
|
||||
on: sketch_surface.clone(),
|
||||
position: Position([0.0, 0.0, 0.0]),
|
||||
rotation: Rotation([0.0, 0.0, 0.0, 1.0]),
|
||||
x_axis: sketch_surface.x_axis(),
|
||||
y_axis: sketch_surface.y_axis(),
|
||||
z_axis: sketch_surface.z_axis(),
|
||||
entity_id: Some(sketch_surface.id()),
|
||||
value: vec![],
|
||||
start: current_path,
|
||||
meta: vec![args.source_range.into()],
|
||||
|
@ -2009,3 +2009,68 @@ const pattn2 = patternCircular3d({axis: [0,0, 1], center: [-20, -20, -20], repet
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm).await.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/circular_pattern3d_a_pattern.png", &result, 1.0);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_array_of_sketches() {
|
||||
let code = r#"const plane001 = startSketchOn('XZ')
|
||||
|
||||
const profile001 = plane001
|
||||
|> startProfileAt([40.82, 240.82], %)
|
||||
|> line([235.72, -8.16], %)
|
||||
|> line([13.27, -253.07], %)
|
||||
|> line([-247.97, -19.39], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> close(%)
|
||||
|
||||
const profile002 = plane001
|
||||
|> startProfileAt([47.17, -71.91], %)
|
||||
|> line([247.96, -4.03], %)
|
||||
|> line([-17.26, -116.79], %)
|
||||
|> line([-235.87, 12.66], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> close(%)
|
||||
|
||||
const sketch001 = [profile001, profile002]
|
||||
|
||||
extrude(10, sketch001)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm).await.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/array_of_sketches.png", &result, 1.0);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_circular_pattern3d_array_of_extrudes() {
|
||||
let code = r#"const plane001 = startSketchOn('XZ')
|
||||
|
||||
const sketch001 = plane001
|
||||
|> startProfileAt([40.82, 240.82], %)
|
||||
|> line([235.72, -8.16], %)
|
||||
|> line([13.27, -253.07], %)
|
||||
|> line([-247.97, -19.39], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> close(%)
|
||||
|> extrude(10, %)
|
||||
|
||||
const sketch002 = plane001
|
||||
|> startProfileAt([47.17, -71.91], %)
|
||||
|> line([247.96, -4.03], %)
|
||||
|> line([-17.26, -116.79], %)
|
||||
|> line([-235.87, 12.66], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> close(%)
|
||||
|> extrude(10, %)
|
||||
|
||||
|
||||
let extrudes = [sketch001, sketch002]
|
||||
|
||||
const pattn1 = patternLinear3d({
|
||||
axis: [0, 1, 0],
|
||||
repetitions: 2,
|
||||
distance: 20
|
||||
}, extrudes)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm).await.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/pattern3d_array_of_extrudes.png", &result, 1.0);
|
||||
}
|
||||
|
BIN
src/wasm-lib/tests/executor/outputs/array_of_sketches.png
Normal file
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 138 KiB |