allow for editing a sketch where extrude or revolve is in the same pipe (#2749)
* allow for editing a sketch where extrude or revolve is in the same pipe Signed-off-by: Jess Frazelle <github@jessfraz.com> * update tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * add playwright test for extrude Signed-off-by: Jess Frazelle <github@jessfraz.com> * add test for revolve Signed-off-by: Jess Frazelle <github@jessfraz.com> * remove log Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -62,8 +62,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -127,6 +199,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -152,24 +225,6 @@ string],
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -184,8 +239,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -249,6 +376,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -274,24 +402,6 @@ string],
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -220,8 +220,80 @@ const example = extrude(10, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -285,6 +357,7 @@ const example = extrude(10, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
type: "extrudeGroup",
|
type: "extrudeGroup",
|
||||||
@ -311,24 +384,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "extrudeGroups",
|
type: "extrudeGroups",
|
||||||
|
@ -62,8 +62,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -127,6 +199,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -152,24 +225,6 @@ string],
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -184,8 +239,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -249,6 +376,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -274,24 +402,6 @@ string],
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -49,8 +49,80 @@ const revolution = startSketchOn(box, "revolveAxis")
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -114,6 +186,7 @@ const revolution = startSketchOn(box, "revolveAxis")
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -139,24 +212,6 @@ const revolution = startSketchOn(box, "revolveAxis")
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -47,8 +47,80 @@ const example = extrude(5, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -112,6 +184,7 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -137,24 +210,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -45,8 +45,80 @@ const example = extrude(5, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -110,6 +182,7 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -135,24 +208,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -47,8 +47,80 @@ const example = extrude(5, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -112,6 +184,7 @@ const example = extrude(5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -137,24 +210,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -52,8 +52,80 @@ const part001 = startSketchOn('XY')
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -117,6 +189,7 @@ const part001 = startSketchOn('XY')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -142,24 +215,6 @@ const part001 = startSketchOn('XY')
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -174,8 +229,80 @@ const part001 = startSketchOn('XY')
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -239,6 +366,7 @@ const part001 = startSketchOn('XY')
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -264,24 +392,6 @@ const part001 = startSketchOn('XY')
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -56,8 +56,80 @@ const example = extrude(-5, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -121,6 +193,7 @@ const example = extrude(-5, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
type: "extrudeGroup",
|
type: "extrudeGroup",
|
||||||
@ -147,24 +220,6 @@ const example = extrude(-5, exampleSketch)
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "extrudeGroups",
|
type: "extrudeGroups",
|
||||||
|
@ -54,8 +54,80 @@ const example = extrude(1, exampleSketch)
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -119,6 +191,7 @@ const example = extrude(1, exampleSketch)
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
type: "extrudeGroup",
|
type: "extrudeGroup",
|
||||||
@ -145,24 +218,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
type: "extrudeGroups",
|
type: "extrudeGroups",
|
||||||
|
@ -311,8 +311,80 @@ string,
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -376,6 +448,7 @@ string,
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -401,24 +474,6 @@ string,
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -50,8 +50,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -115,6 +187,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -140,24 +213,6 @@ string],
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -172,8 +227,80 @@ string],
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -237,6 +364,7 @@ string],
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -262,24 +390,6 @@ string],
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -167,8 +167,80 @@ const a1 = startSketchOn({
|
|||||||
height: number,
|
height: number,
|
||||||
// The id of the extrude group.
|
// The id of the extrude group.
|
||||||
id: uuid,
|
id: uuid,
|
||||||
// The sketch group paths.
|
// The sketch group.
|
||||||
sketchGroupValues: [{
|
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.
|
// The from point.
|
||||||
from: [number, number],
|
from: [number, number],
|
||||||
// The name of the path.
|
// The name of the path.
|
||||||
@ -232,6 +304,7 @@ const a1 = startSketchOn({
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
type: "Base",
|
type: "Base",
|
||||||
}],
|
}],
|
||||||
|
},
|
||||||
// The id of the extrusion start cap
|
// The id of the extrusion start cap
|
||||||
startCapId: uuid,
|
startCapId: uuid,
|
||||||
// The extrude surfaces.
|
// The extrude surfaces.
|
||||||
@ -257,24 +330,6 @@ const a1 = startSketchOn({
|
|||||||
sourceRange: [number, number],
|
sourceRange: [number, number],
|
||||||
type: "extrudeArc",
|
type: "extrudeArc",
|
||||||
}],
|
}],
|
||||||
// The x-axis of the extrude group base plane in the 3D space
|
|
||||||
xAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The y-axis of the extrude group base plane in the 3D space
|
|
||||||
yAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
// The z-axis of the extrude group base plane in the 3D space
|
|
||||||
zAxis: {
|
|
||||||
x: number,
|
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
|
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
|
||||||
|
29236
docs/kcl/std.json
29236
docs/kcl/std.json
File diff suppressed because it is too large
Load Diff
@ -2652,6 +2652,206 @@ test('Can edit segments by dragging their handles', async ({ page }) => {
|
|||||||
|> tangentialArcTo([26.92, -3.32], %)`)
|
|> tangentialArcTo([26.92, -3.32], %)`)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
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(
|
||||||
|
'persistCode',
|
||||||
|
`const sketch001 = startSketchOn('XZ')
|
||||||
|
|> startProfileAt([4.61, -14.01], %)
|
||||||
|
|> line([12.73, -0.09], %)
|
||||||
|
|> tangentialArcTo([24.95, -5.38], %)
|
||||||
|
|> close(%)
|
||||||
|
|> extrude(5, %)`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
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(%)
|
||||||
|
|> 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 (
|
const doSnapAtDifferentScales = async (
|
||||||
page: any,
|
page: any,
|
||||||
camPos: [number, number, number],
|
camPos: [number, number, number],
|
||||||
|
@ -1388,7 +1388,7 @@ export class SceneEntities {
|
|||||||
},
|
},
|
||||||
onClick: async (args) => {
|
onClick: async (args) => {
|
||||||
const { streamDimensions } = useStore.getState()
|
const { streamDimensions } = useStore.getState()
|
||||||
const { entity_id, ...rest } = await sendSelectEventToEngine(
|
const { entity_id } = await sendSelectEventToEngine(
|
||||||
args?.mouseEvent,
|
args?.mouseEvent,
|
||||||
document.getElementById('video-stream') as HTMLVideoElement,
|
document.getElementById('video-stream') as HTMLVideoElement,
|
||||||
streamDimensions
|
streamDimensions
|
||||||
@ -1762,7 +1762,11 @@ export function sketchGroupFromPathToNode({
|
|||||||
pathToNode,
|
pathToNode,
|
||||||
'VariableDeclarator'
|
'VariableDeclarator'
|
||||||
).node
|
).node
|
||||||
return programMemory.root[varDec?.id?.name || ''] as SketchGroup
|
const result = programMemory.root[varDec?.id?.name || '']
|
||||||
|
if (result?.type === 'ExtrudeGroup') {
|
||||||
|
return result.sketchGroup
|
||||||
|
}
|
||||||
|
return result as SketchGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
function colorSegment(object: any, color: number) {
|
function colorSegment(object: any, color: number) {
|
||||||
|
@ -86,32 +86,36 @@ const mySketch001 = startSketchOn('XY')
|
|||||||
sourceRange: [108, 132],
|
sourceRange: [108, 132],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sketchGroupValues: [
|
sketchGroup: {
|
||||||
{
|
id: expect.any(String),
|
||||||
type: 'ToPoint',
|
__meta: expect.any(Array),
|
||||||
from: [0, 0],
|
on: expect.any(Object),
|
||||||
to: [-1.59, -1.54],
|
start: expect.any(Object),
|
||||||
name: '',
|
type: 'SketchGroup',
|
||||||
__geoMeta: {
|
value: [
|
||||||
id: expect.any(String),
|
{
|
||||||
sourceRange: [77, 102],
|
type: 'ToPoint',
|
||||||
|
from: [0, 0],
|
||||||
|
to: [-1.59, -1.54],
|
||||||
|
name: '',
|
||||||
|
__geoMeta: {
|
||||||
|
id: expect.any(String),
|
||||||
|
sourceRange: [77, 102],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [-1.59, -1.54],
|
||||||
from: [-1.59, -1.54],
|
to: [0.46, -5.82],
|
||||||
to: [0.46, -5.82],
|
name: '',
|
||||||
name: '',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [108, 132],
|
||||||
sourceRange: [108, 132],
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
height: 2,
|
height: 2,
|
||||||
xAxis: { x: 1, y: 0, z: 0 },
|
|
||||||
yAxis: { x: 0, y: 1, z: 0 },
|
|
||||||
zAxis: { x: 0, y: 0, z: 1 },
|
|
||||||
startCapId: expect.any(String),
|
startCapId: expect.any(String),
|
||||||
endCapId: expect.any(String),
|
endCapId: expect.any(String),
|
||||||
__meta: [{ sourceRange: [46, 71] }],
|
__meta: [{ sourceRange: [46, 71] }],
|
||||||
@ -170,42 +174,46 @@ const sk2 = startSketchOn('XY')
|
|||||||
sourceRange: [124, 143],
|
sourceRange: [124, 143],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sketchGroupValues: [
|
sketchGroup: {
|
||||||
{
|
id: expect.any(String),
|
||||||
type: 'ToPoint',
|
__meta: expect.any(Array),
|
||||||
from: [0, 0],
|
on: expect.any(Object),
|
||||||
to: [-2.5, 0],
|
start: expect.any(Object),
|
||||||
name: '',
|
type: 'SketchGroup',
|
||||||
__geoMeta: {
|
value: [
|
||||||
id: expect.any(String),
|
{
|
||||||
sourceRange: [69, 89],
|
type: 'ToPoint',
|
||||||
|
from: [0, 0],
|
||||||
|
to: [-2.5, 0],
|
||||||
|
name: '',
|
||||||
|
__geoMeta: {
|
||||||
|
id: expect.any(String),
|
||||||
|
sourceRange: [69, 89],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [-2.5, 0],
|
||||||
from: [-2.5, 0],
|
to: [0, 10],
|
||||||
to: [0, 10],
|
name: 'p',
|
||||||
name: 'p',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [95, 118],
|
||||||
sourceRange: [95, 118],
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [0, 10],
|
||||||
from: [0, 10],
|
to: [2.5, 0],
|
||||||
to: [2.5, 0],
|
name: '',
|
||||||
name: '',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [124, 143],
|
||||||
sourceRange: [124, 143],
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
height: 2,
|
height: 2,
|
||||||
xAxis: { x: 1, y: 0, z: 0 },
|
|
||||||
yAxis: { x: 0, y: 1, z: 0 },
|
|
||||||
zAxis: { x: 0, y: 0, z: 1 },
|
|
||||||
startCapId: expect.any(String),
|
startCapId: expect.any(String),
|
||||||
endCapId: expect.any(String),
|
endCapId: expect.any(String),
|
||||||
__meta: [{ sourceRange: [38, 63] }],
|
__meta: [{ sourceRange: [38, 63] }],
|
||||||
@ -236,42 +244,46 @@ const sk2 = startSketchOn('XY')
|
|||||||
sourceRange: [428, 447],
|
sourceRange: [428, 447],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sketchGroupValues: [
|
sketchGroup: {
|
||||||
{
|
id: expect.any(String),
|
||||||
type: 'ToPoint',
|
__meta: expect.any(Array),
|
||||||
from: [0, 0],
|
on: expect.any(Object),
|
||||||
to: [-2.5, 0],
|
start: expect.any(Object),
|
||||||
name: '',
|
type: 'SketchGroup',
|
||||||
__geoMeta: {
|
value: [
|
||||||
id: expect.any(String),
|
{
|
||||||
sourceRange: [374, 394],
|
type: 'ToPoint',
|
||||||
|
from: [0, 0],
|
||||||
|
to: [-2.5, 0],
|
||||||
|
name: '',
|
||||||
|
__geoMeta: {
|
||||||
|
id: expect.any(String),
|
||||||
|
sourceRange: [374, 394],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [-2.5, 0],
|
||||||
from: [-2.5, 0],
|
to: [0, 3],
|
||||||
to: [0, 3],
|
name: 'p',
|
||||||
name: 'p',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [400, 422],
|
||||||
sourceRange: [400, 422],
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'ToPoint',
|
||||||
type: 'ToPoint',
|
from: [0, 3],
|
||||||
from: [0, 3],
|
to: [2.5, 0],
|
||||||
to: [2.5, 0],
|
name: '',
|
||||||
name: '',
|
__geoMeta: {
|
||||||
__geoMeta: {
|
id: expect.any(String),
|
||||||
id: expect.any(String),
|
sourceRange: [428, 447],
|
||||||
sourceRange: [428, 447],
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
height: 2,
|
height: 2,
|
||||||
xAxis: { x: 1, y: 0, z: 0 },
|
|
||||||
yAxis: { x: 0, y: 1, z: 0 },
|
|
||||||
zAxis: { x: 0, y: 0, z: 1 },
|
|
||||||
startCapId: expect.any(String),
|
startCapId: expect.any(String),
|
||||||
endCapId: expect.any(String),
|
endCapId: expect.any(String),
|
||||||
__meta: [{ sourceRange: [343, 368] }],
|
__meta: [{ sourceRange: [343, 368] }],
|
||||||
|
@ -661,14 +661,6 @@ export function isSingleCursorInPipe(
|
|||||||
ast: Program
|
ast: Program
|
||||||
) {
|
) {
|
||||||
if (selectionRanges.codeBasedSelections.length !== 1) return false
|
if (selectionRanges.codeBasedSelections.length !== 1) return false
|
||||||
if (
|
|
||||||
doesPipeHaveCallExp({
|
|
||||||
ast,
|
|
||||||
selection: selectionRanges.codeBasedSelections[0],
|
|
||||||
calleeName: 'extrude',
|
|
||||||
})
|
|
||||||
)
|
|
||||||
return false
|
|
||||||
const selection = selectionRanges.codeBasedSelections[0]
|
const selection = selectionRanges.codeBasedSelections[0]
|
||||||
const pathToNode = getNodePathFromSourceRange(ast, selection.range)
|
const pathToNode = getNodePathFromSourceRange(ast, selection.range)
|
||||||
const nodeTypes = pathToNode.map(([, type]) => type)
|
const nodeTypes = pathToNode.map(([, type]) => type)
|
||||||
|
@ -59,9 +59,11 @@ export function isCursorInSketchCommandRange(
|
|||||||
artifact.commandType === 'close_path')
|
artifact.commandType === 'close_path')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return overlapingEntries.length && overlapingEntries[0][1].parentId
|
let result =
|
||||||
? overlapingEntries[0][1].parentId
|
overlapingEntries.length && overlapingEntries[0][1].parentId
|
||||||
: overlapingEntries.find(
|
? overlapingEntries[0][1].parentId
|
||||||
([, artifact]) => artifact.commandType === 'start_path'
|
: overlapingEntries.find(
|
||||||
)?.[0] || false
|
([, artifact]) => artifact.commandType === 'start_path'
|
||||||
|
)?.[0] || false
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
@ -570,16 +570,10 @@ pub struct ExtrudeGroup {
|
|||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
/// The extrude surfaces.
|
/// The extrude surfaces.
|
||||||
pub value: Vec<ExtrudeSurface>,
|
pub value: Vec<ExtrudeSurface>,
|
||||||
/// The sketch group paths.
|
/// The sketch group.
|
||||||
pub sketch_group_values: Vec<Path>,
|
pub sketch_group: SketchGroup,
|
||||||
/// The height of the extrude group.
|
/// The height of the extrude group.
|
||||||
pub height: f64,
|
pub height: f64,
|
||||||
/// 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
|
/// The id of the extrusion start cap
|
||||||
pub start_cap_id: Option<uuid::Uuid>,
|
pub start_cap_id: Option<uuid::Uuid>,
|
||||||
/// The id of the extrusion end cap
|
/// The id of the extrusion end cap
|
||||||
|
@ -94,7 +94,8 @@ async fn inner_chamfer(
|
|||||||
EdgeReference::Uuid(uuid) => uuid,
|
EdgeReference::Uuid(uuid) => uuid,
|
||||||
EdgeReference::Tag(tag) => {
|
EdgeReference::Tag(tag) => {
|
||||||
extrude_group
|
extrude_group
|
||||||
.sketch_group_values
|
.sketch_group
|
||||||
|
.value
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.get_name() == tag)
|
.find(|p| p.get_name() == tag)
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
|
@ -239,11 +239,8 @@ pub(crate) async fn do_post_extrude(
|
|||||||
// sketch group.
|
// sketch group.
|
||||||
id: sketch_group.id,
|
id: sketch_group.id,
|
||||||
value: new_value,
|
value: new_value,
|
||||||
sketch_group_values: sketch_group.value.clone(),
|
sketch_group: sketch_group.clone(),
|
||||||
height: length,
|
height: length,
|
||||||
x_axis: sketch_group.on.x_axis(),
|
|
||||||
y_axis: sketch_group.on.y_axis(),
|
|
||||||
z_axis: sketch_group.on.z_axis(),
|
|
||||||
start_cap_id,
|
start_cap_id,
|
||||||
end_cap_id,
|
end_cap_id,
|
||||||
meta: sketch_group.meta,
|
meta: sketch_group.meta,
|
||||||
|
@ -95,7 +95,8 @@ async fn inner_fillet(
|
|||||||
EdgeReference::Uuid(uuid) => uuid,
|
EdgeReference::Uuid(uuid) => uuid,
|
||||||
EdgeReference::Tag(tag) => {
|
EdgeReference::Tag(tag) => {
|
||||||
extrude_group
|
extrude_group
|
||||||
.sketch_group_values
|
.sketch_group
|
||||||
|
.value
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.get_name() == tag)
|
.find(|p| p.get_name() == tag)
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
@ -177,7 +178,8 @@ async fn inner_get_opposite_edge(tag: String, extrude_group: Box<ExtrudeGroup>,
|
|||||||
return Ok(Uuid::new_v4());
|
return Ok(Uuid::new_v4());
|
||||||
}
|
}
|
||||||
let tagged_path = extrude_group
|
let tagged_path = extrude_group
|
||||||
.sketch_group_values
|
.sketch_group
|
||||||
|
.value
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.get_name() == tag)
|
.find(|p| p.get_name() == tag)
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
@ -268,7 +270,8 @@ async fn inner_get_next_adjacent_edge(
|
|||||||
return Ok(Uuid::new_v4());
|
return Ok(Uuid::new_v4());
|
||||||
}
|
}
|
||||||
let tagged_path = extrude_group
|
let tagged_path = extrude_group
|
||||||
.sketch_group_values
|
.sketch_group
|
||||||
|
.value
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.get_name() == tag)
|
.find(|p| p.get_name() == tag)
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
@ -364,7 +367,8 @@ async fn inner_get_previous_adjacent_edge(
|
|||||||
return Ok(Uuid::new_v4());
|
return Ok(Uuid::new_v4());
|
||||||
}
|
}
|
||||||
let tagged_path = extrude_group
|
let tagged_path = extrude_group
|
||||||
.sketch_group_values
|
.sketch_group
|
||||||
|
.value
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.get_name() == tag)
|
.find(|p| p.get_name() == tag)
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
|
@ -336,7 +336,8 @@ async fn inner_get_edge(tag: String, extrude_group: Box<ExtrudeGroup>, args: Arg
|
|||||||
return Ok(Uuid::new_v4());
|
return Ok(Uuid::new_v4());
|
||||||
}
|
}
|
||||||
let tagged_path = extrude_group
|
let tagged_path = extrude_group
|
||||||
.sketch_group_values
|
.sketch_group
|
||||||
|
.value
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.get_name() == tag)
|
.find(|p| p.get_name() == tag)
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
|
@ -1074,9 +1074,9 @@ async fn start_sketch_on_face(
|
|||||||
value: tag.to_string(),
|
value: tag.to_string(),
|
||||||
sketch_group_id: extrude_group.id,
|
sketch_group_id: extrude_group.id,
|
||||||
// TODO: get this from the extrude plane data.
|
// TODO: get this from the extrude plane data.
|
||||||
x_axis: extrude_group.x_axis,
|
x_axis: extrude_group.sketch_group.on.x_axis(),
|
||||||
y_axis: extrude_group.y_axis,
|
y_axis: extrude_group.sketch_group.on.y_axis(),
|
||||||
z_axis: extrude_group.z_axis,
|
z_axis: extrude_group.sketch_group.on.z_axis(),
|
||||||
meta: vec![args.source_range.into()],
|
meta: vec![args.source_range.into()],
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user