start of close tag (#1639)
* start of close tag Signed-off-by: Jess Frazelle <github@jessfraz.com> * docs Signed-off-by: Jess Frazelle <github@jessfraz.com> * close Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * use local Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -20971,6 +20971,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "tag",
|
||||||
|
"type": "String",
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
"required": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returnValue": {
|
"returnValue": {
|
||||||
@ -32957,7 +32966,7 @@
|
|||||||
],
|
],
|
||||||
"nullable": true
|
"nullable": true
|
||||||
},
|
},
|
||||||
"required": true
|
"required": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returnValue": {
|
"returnValue": {
|
||||||
@ -53645,7 +53654,7 @@
|
|||||||
],
|
],
|
||||||
"nullable": true
|
"nullable": true
|
||||||
},
|
},
|
||||||
"required": true
|
"required": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returnValue": {
|
"returnValue": {
|
||||||
@ -56962,7 +56971,7 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"nullable": true
|
"nullable": true
|
||||||
},
|
},
|
||||||
"required": true
|
"required": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returnValue": {
|
"returnValue": {
|
||||||
|
215
docs/kcl/std.md
215
docs/kcl/std.md
@ -83,7 +83,7 @@ abs(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ acos(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -123,9 +123,9 @@ angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup)
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `segment_name`: `string`
|
* `segment_name`: `string` (REQUIRED)
|
||||||
* `to`: `number`
|
* `to`: `number` (REQUIRED)
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -308,9 +308,9 @@ angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup)
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `segment_name`: `string`
|
* `segment_name`: `string` (REQUIRED)
|
||||||
* `to`: `number`
|
* `to`: `number` (REQUIRED)
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -493,7 +493,7 @@ angledLine(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AngledLineData` - Data to draw an angled line.
|
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The angle of the line.
|
// The angle of the line.
|
||||||
@ -505,7 +505,7 @@ angledLine(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -851,7 +851,7 @@ angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGr
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AngledLineData` - Data to draw an angled line.
|
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The angle of the line.
|
// The angle of the line.
|
||||||
@ -863,7 +863,7 @@ angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGr
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -1209,7 +1209,7 @@ angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGr
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AngledLineData` - Data to draw an angled line.
|
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The angle of the line.
|
// The angle of the line.
|
||||||
@ -1221,7 +1221,7 @@ angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGr
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -1567,7 +1567,7 @@ angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: Sketc
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AngledLineThatIntersectsData` - Data for drawing an angled line that intersects with a given line.
|
* `data`: `AngledLineThatIntersectsData` - Data for drawing an angled line that intersects with a given line. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The angle of the line.
|
// The angle of the line.
|
||||||
@ -1580,7 +1580,7 @@ angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: Sketc
|
|||||||
tag: string,
|
tag: string,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -1926,7 +1926,7 @@ angledLineToX(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AngledLineToData` - Data to draw an angled line to a point.
|
* `data`: `AngledLineToData` - Data to draw an angled line to a point. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The angle of the line.
|
// The angle of the line.
|
||||||
@ -1938,7 +1938,7 @@ angledLineToX(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -2284,7 +2284,7 @@ angledLineToY(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AngledLineToData` - Data to draw an angled line to a point.
|
* `data`: `AngledLineToData` - Data to draw an angled line to a point. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The angle of the line.
|
// The angle of the line.
|
||||||
@ -2296,7 +2296,7 @@ angledLineToY(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -2642,7 +2642,7 @@ arc(data: ArcData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `ArcData` - Data to draw an arc.
|
* `data`: `ArcData` - Data to draw an arc. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The end angle.
|
// The end angle.
|
||||||
@ -2681,7 +2681,7 @@ arc(data: ArcData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -3027,7 +3027,7 @@ asin(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -3047,7 +3047,7 @@ atan(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -3067,7 +3067,7 @@ bezierCurve(data: BezierData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `BezierData` - Data to draw a bezier curve.
|
* `data`: `BezierData` - Data to draw a bezier curve. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The first control point.
|
// The first control point.
|
||||||
@ -3088,7 +3088,7 @@ bezierCurve(data: BezierData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
to: [number, number],
|
to: [number, number],
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -3434,7 +3434,7 @@ ceil(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -3454,7 +3454,7 @@ circle(plane: SketchData, center: [number, number], radius: number) -> SketchGro
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `plane`: `SketchData` - Data for start sketch on. You can start a sketch on a plane or an extrude group.
|
* `plane`: `SketchData` - Data for start sketch on. You can start a sketch on a plane or an extrude group. (REQUIRED)
|
||||||
```
|
```
|
||||||
"XY" |
|
"XY" |
|
||||||
"-XY" |
|
"-XY" |
|
||||||
@ -3619,8 +3619,8 @@ circle(plane: SketchData, center: [number, number], radius: number) -> SketchGro
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `center`: `[number, number]`
|
* `center`: `[number, number]` (REQUIRED)
|
||||||
* `radius`: `number`
|
* `radius`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -3798,12 +3798,12 @@ Close the current sketch.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
close(sketch_group: SketchGroup) -> SketchGroup
|
close(sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -3967,6 +3967,7 @@ close(sketch_group: SketchGroup) -> SketchGroup
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
* `tag`: `String` (OPTIONAL)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -4149,7 +4150,7 @@ cos(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -4188,8 +4189,8 @@ extrude(length: number, sketch_group: SketchGroup) -> ExtrudeGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `length`: `number`
|
* `length`: `number` (REQUIRED)
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -4502,7 +4503,7 @@ fillet(data: FilletData, extrude_group: ExtrudeGroup) -> ExtrudeGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `FilletData` - Data for fillets.
|
* `data`: `FilletData` - Data for fillets. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The radius of the fillet.
|
// The radius of the fillet.
|
||||||
@ -4512,7 +4513,7 @@ fillet(data: FilletData, extrude_group: ExtrudeGroup) -> ExtrudeGroup
|
|||||||
string],
|
string],
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces.
|
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The id of the extrusion end cap
|
// The id of the extrusion end cap
|
||||||
@ -4792,7 +4793,7 @@ floor(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -4812,8 +4813,8 @@ getExtrudeWallTransform(surface_name: string, extrude_group: ExtrudeGroup) -> Ex
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `surface_name`: `string`
|
* `surface_name`: `string` (REQUIRED)
|
||||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces.
|
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The id of the extrusion end cap
|
// The id of the extrusion end cap
|
||||||
@ -4969,8 +4970,8 @@ getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `tag`: `String`
|
* `tag`: `String` (REQUIRED)
|
||||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces.
|
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The id of the extrusion end cap
|
// The id of the extrusion end cap
|
||||||
@ -5120,8 +5121,8 @@ getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `tag`: `String`
|
* `tag`: `String` (REQUIRED)
|
||||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces.
|
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The id of the extrusion end cap
|
// The id of the extrusion end cap
|
||||||
@ -5271,8 +5272,8 @@ getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `tag`: `String`
|
* `tag`: `String` (REQUIRED)
|
||||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces.
|
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The id of the extrusion end cap
|
// The id of the extrusion end cap
|
||||||
@ -5422,7 +5423,7 @@ hole(hole_sketch_group: SketchGroupSet, sketch_group: SketchGroup) -> SketchGrou
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups.
|
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -5590,7 +5591,7 @@ hole(hole_sketch_group: SketchGroupSet, sketch_group: SketchGroup) -> SketchGrou
|
|||||||
type: "sketchGroups",
|
type: "sketchGroups",
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -5932,13 +5933,13 @@ For formats lacking unit data (STL, OBJ, PLY), the default import unit is millim
|
|||||||
Import paths are relative to the current project directory. This only works in the desktop app not in browser.
|
Import paths are relative to the current project directory. This only works in the desktop app not in browser.
|
||||||
|
|
||||||
```
|
```
|
||||||
import(file_path: String, options: ImportFormat) -> ImportedGeometry
|
import(file_path: String, options?: ImportFormat) -> ImportedGeometry
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `file_path`: `String`
|
* `file_path`: `String` (REQUIRED)
|
||||||
* `options`: `ImportFormat` - Import format specifier
|
* `options`: `ImportFormat` - Import format specifier (OPTIONAL)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
type: "fbx",
|
type: "fbx",
|
||||||
@ -6046,7 +6047,7 @@ lastSegX(sketch_group: SketchGroup) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -6229,7 +6230,7 @@ lastSegY(sketch_group: SketchGroup) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -6412,8 +6413,8 @@ legAngX(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `hypotenuse`: `number`
|
* `hypotenuse`: `number` (REQUIRED)
|
||||||
* `leg`: `number`
|
* `leg`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -6433,8 +6434,8 @@ legAngY(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `hypotenuse`: `number`
|
* `hypotenuse`: `number` (REQUIRED)
|
||||||
* `leg`: `number`
|
* `leg`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -6454,8 +6455,8 @@ legLen(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `hypotenuse`: `number`
|
* `hypotenuse`: `number` (REQUIRED)
|
||||||
* `leg`: `number`
|
* `leg`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -6475,7 +6476,7 @@ line(data: LineData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `LineData` - Data to draw a line.
|
* `data`: `LineData` - Data to draw a line. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The tag.
|
// The tag.
|
||||||
@ -6485,7 +6486,7 @@ line(data: LineData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -6831,7 +6832,7 @@ lineTo(data: LineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `LineToData` - Data to draw a line to a point.
|
* `data`: `LineToData` - Data to draw a line to a point. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The tag.
|
// The tag.
|
||||||
@ -6841,7 +6842,7 @@ lineTo(data: LineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -7187,7 +7188,7 @@ ln(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -7207,8 +7208,8 @@ log(num: number, base: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
* `base`: `number`
|
* `base`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -7228,7 +7229,7 @@ log10(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -7248,7 +7249,7 @@ log2(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -7268,7 +7269,7 @@ max(args: [number]) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `args`: `[number]`
|
* `args`: `[number]` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -7288,7 +7289,7 @@ min(args: [number]) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `args`: `[number]`
|
* `args`: `[number]` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -7308,7 +7309,7 @@ patternCircular(data: CircularPatternData, geometry: Geometry) -> Geometries
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `CircularPatternData` - Data for a circular pattern.
|
* `data`: `CircularPatternData` - Data for a circular pattern. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The arc angle (in degrees) to place the repetitions. Must be greater than 0.
|
// The arc angle (in degrees) to place the repetitions. Must be greater than 0.
|
||||||
@ -7323,7 +7324,7 @@ patternCircular(data: CircularPatternData, geometry: Geometry) -> Geometries
|
|||||||
rotateDuplicates: string,
|
rotateDuplicates: string,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `geometry`: `Geometry` - A geometry.
|
* `geometry`: `Geometry` - A geometry. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -7644,7 +7645,7 @@ patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `LinearPatternData` - Data for a linear pattern.
|
* `data`: `LinearPatternData` - Data for a linear pattern. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The axis of the pattern. This is a 2D vector.
|
// The axis of the pattern. This is a 2D vector.
|
||||||
@ -7655,7 +7656,7 @@ patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries
|
|||||||
repetitions: number,
|
repetitions: number,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `geometry`: `Geometry` - A geometry.
|
* `geometry`: `Geometry` - A geometry. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -7995,8 +7996,8 @@ pow(num: number, pow: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
* `pow`: `number`
|
* `pow`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -8016,8 +8017,8 @@ segAng(segment_name: string, sketch_group: SketchGroup) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `segment_name`: `string`
|
* `segment_name`: `string` (REQUIRED)
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -8200,8 +8201,8 @@ segEndX(segment_name: string, sketch_group: SketchGroup) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `segment_name`: `string`
|
* `segment_name`: `string` (REQUIRED)
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -8384,8 +8385,8 @@ segEndY(segment_name: string, sketch_group: SketchGroup) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `segment_name`: `string`
|
* `segment_name`: `string` (REQUIRED)
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -8568,8 +8569,8 @@ segLen(segment_name: string, sketch_group: SketchGroup) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `segment_name`: `string`
|
* `segment_name`: `string` (REQUIRED)
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -8752,7 +8753,7 @@ sin(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -8772,7 +8773,7 @@ sqrt(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -8792,7 +8793,7 @@ startProfileAt(data: LineData, sketch_surface: SketchSurface) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `LineData` - Data to draw a line.
|
* `data`: `LineData` - Data to draw a line. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The tag.
|
// The tag.
|
||||||
@ -8802,7 +8803,7 @@ startProfileAt(data: LineData, sketch_surface: SketchSurface) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_surface`: `SketchSurface` - A sketch group type.
|
* `sketch_surface`: `SketchSurface` - A sketch group type. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The id of the plane.
|
// The id of the plane.
|
||||||
@ -9045,7 +9046,7 @@ startSketchAt(data: LineData) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `LineData` - Data to draw a line.
|
* `data`: `LineData` - Data to draw a line. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The tag.
|
// The tag.
|
||||||
@ -9232,12 +9233,12 @@ Start a sketch on a specific plane or face.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
startSketchOn(data: SketchData, tag: SketchOnFaceTag) -> SketchSurface
|
startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `SketchData` - Data for start sketch on. You can start a sketch on a plane or an extrude group.
|
* `data`: `SketchData` - Data for start sketch on. You can start a sketch on a plane or an extrude group. (REQUIRED)
|
||||||
```
|
```
|
||||||
"XY" |
|
"XY" |
|
||||||
"-XY" |
|
"-XY" |
|
||||||
@ -9402,7 +9403,7 @@ startSketchOn(data: SketchData, tag: SketchOnFaceTag) -> SketchSurface
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `SketchOnFaceTag` - A tag for sketch on face.
|
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
|
||||||
```
|
```
|
||||||
"start" | "end" |
|
"start" | "end" |
|
||||||
string
|
string
|
||||||
@ -9486,7 +9487,7 @@ tan(num: number) -> number
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `num`: `number`
|
* `num`: `number` (REQUIRED)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -9506,7 +9507,7 @@ tangentialArc(data: TangentialArcData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `TangentialArcData` - Data to draw a tangential arc.
|
* `data`: `TangentialArcData` - Data to draw a tangential arc. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// Offset of the arc, in degrees.
|
// Offset of the arc, in degrees.
|
||||||
@ -9522,7 +9523,7 @@ tangentialArc(data: TangentialArcData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
[number, number]
|
[number, number]
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -9863,13 +9864,13 @@ Draw an arc.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag: String) -> SketchGroup
|
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `to`: `[number]`
|
* `to`: `[number]` (REQUIRED)
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -10033,7 +10034,7 @@ tangentialArcTo(to: [number], sketch_group: SketchGroup, tag: String) -> SketchG
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `tag`: `String`
|
* `tag`: `String` (OPTIONAL)
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
@ -10235,7 +10236,7 @@ xLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AxisLineData` - Data to draw a line on an axis.
|
* `data`: `AxisLineData` - Data to draw a line on an axis. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The length of the line.
|
// The length of the line.
|
||||||
@ -10245,7 +10246,7 @@ xLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
number
|
number
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -10591,7 +10592,7 @@ xLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AxisLineToData` - Data to draw a line to a point on an axis.
|
* `data`: `AxisLineToData` - Data to draw a line to a point on an axis. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The tag.
|
// The tag.
|
||||||
@ -10601,7 +10602,7 @@ xLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
number
|
number
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -10947,7 +10948,7 @@ yLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AxisLineData` - Data to draw a line on an axis.
|
* `data`: `AxisLineData` - Data to draw a line on an axis. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The length of the line.
|
// The length of the line.
|
||||||
@ -10957,7 +10958,7 @@ yLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
number
|
number
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
@ -11303,7 +11304,7 @@ yLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
* `data`: `AxisLineToData` - Data to draw a line to a point on an axis.
|
* `data`: `AxisLineToData` - Data to draw a line to a point on an axis. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The tag.
|
// The tag.
|
||||||
@ -11313,7 +11314,7 @@ yLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup
|
|||||||
} |
|
} |
|
||||||
number
|
number
|
||||||
```
|
```
|
||||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
|
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
// The plane id or face id of the sketch group.
|
// The plane id or face id of the sketch group.
|
||||||
|
10
src/wasm-lib/Cargo.lock
generated
10
src/wasm-lib/Cargo.lock
generated
@ -937,7 +937,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive-docs"
|
name = "derive-docs"
|
||||||
version = "0.1.8"
|
version = "0.1.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"convert_case",
|
"convert_case",
|
||||||
"expectorate",
|
"expectorate",
|
||||||
@ -954,9 +954,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive-docs"
|
name = "derive-docs"
|
||||||
version = "0.1.8"
|
version = "0.1.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5d58c9464a20d3ece3260838ad7c2f504c925a852cfdad13f0ea2e9e4bb8a859"
|
checksum = "b81bc4c6288273218d0bb4f2ee7cda229264f2e8381e53aae250c840946171f9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"convert_case",
|
"convert_case",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@ -1897,7 +1897,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kcl-lib"
|
name = "kcl-lib"
|
||||||
version = "0.1.42"
|
version = "0.1.43"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"approx 0.5.1",
|
"approx 0.5.1",
|
||||||
@ -1908,7 +1908,7 @@ dependencies = [
|
|||||||
"criterion",
|
"criterion",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"databake",
|
"databake",
|
||||||
"derive-docs 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"derive-docs 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"expectorate",
|
"expectorate",
|
||||||
"futures",
|
"futures",
|
||||||
"gltf-json",
|
"gltf-json",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "derive-docs"
|
name = "derive-docs"
|
||||||
description = "A tool for generating documentation from Rust derive macros"
|
description = "A tool for generating documentation from Rust derive macros"
|
||||||
version = "0.1.8"
|
version = "0.1.9"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/KittyCAD/modeling-app"
|
repository = "https://github.com/KittyCAD/modeling-app"
|
||||||
|
@ -197,6 +197,7 @@ fn do_stdlib_inner(
|
|||||||
let (ty_string, ty_ident) = clean_ty_string(ty.to_string().as_str());
|
let (ty_string, ty_ident) = clean_ty_string(ty.to_string().as_str());
|
||||||
|
|
||||||
let ty_string = rust_type_to_openapi_type(&ty_string);
|
let ty_string = rust_type_to_openapi_type(&ty_string);
|
||||||
|
let required = !ty_ident.to_string().starts_with("Option <");
|
||||||
|
|
||||||
if ty_string != "Args" {
|
if ty_string != "Args" {
|
||||||
let schema = if ty_ident.to_string().starts_with("Vec < ")
|
let schema = if ty_ident.to_string().starts_with("Vec < ")
|
||||||
@ -216,7 +217,7 @@ fn do_stdlib_inner(
|
|||||||
name: #arg_name.to_string(),
|
name: #arg_name.to_string(),
|
||||||
type_: #ty_string.to_string(),
|
type_: #ty_string.to_string(),
|
||||||
schema: #schema,
|
schema: #schema,
|
||||||
required: true,
|
required: #required,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ impl crate::docs::StdLibFn for Show {
|
|||||||
name: "args".to_string(),
|
name: "args".to_string(),
|
||||||
type_: "number".to_string(),
|
type_: "number".to_string(),
|
||||||
schema: <Option<f64>>::json_schema(&mut generator),
|
schema: <Option<f64>>::json_schema(&mut generator),
|
||||||
required: true,
|
required: false,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ impl crate::docs::StdLibFn for Import {
|
|||||||
name: "args".to_string(),
|
name: "args".to_string(),
|
||||||
type_: "kittycad::types::InputFormat".to_string(),
|
type_: "kittycad::types::InputFormat".to_string(),
|
||||||
schema: <Option<kittycad::types::InputFormat>>::json_schema(&mut generator),
|
schema: <Option<kittycad::types::InputFormat>>::json_schema(&mut generator),
|
||||||
required: true,
|
required: false,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "kcl-lib"
|
name = "kcl-lib"
|
||||||
description = "KittyCAD Language implementation and tools"
|
description = "KittyCAD Language implementation and tools"
|
||||||
version = "0.1.42"
|
version = "0.1.43"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/KittyCAD/modeling-app"
|
repository = "https://github.com/KittyCAD/modeling-app"
|
||||||
@ -17,7 +17,7 @@ async-trait = "0.1.77"
|
|||||||
clap = { version = "4.5.1", features = ["cargo", "derive", "env", "unicode"], optional = true }
|
clap = { version = "4.5.1", features = ["cargo", "derive", "env", "unicode"], optional = true }
|
||||||
dashmap = "5.5.3"
|
dashmap = "5.5.3"
|
||||||
databake = { version = "0.1.7", features = ["derive"] }
|
databake = { version = "0.1.7", features = ["derive"] }
|
||||||
derive-docs = { version = "0.1.8" }
|
derive-docs = { version = "0.1.9" }
|
||||||
#derive-docs = { path = "../derive-docs" }
|
#derive-docs = { path = "../derive-docs" }
|
||||||
futures = { version = "0.3.30" }
|
futures = { version = "0.3.30" }
|
||||||
gltf-json = "1.4.0"
|
gltf-json = "1.4.0"
|
||||||
|
@ -132,7 +132,11 @@ pub trait StdLibFn: std::fmt::Debug + Send + Sync {
|
|||||||
if i > 0 {
|
if i > 0 {
|
||||||
signature.push_str(", ");
|
signature.push_str(", ");
|
||||||
}
|
}
|
||||||
|
if arg.required {
|
||||||
signature.push_str(&format!("{}: {}", arg.name, arg.type_));
|
signature.push_str(&format!("{}: {}", arg.name, arg.type_));
|
||||||
|
} else {
|
||||||
|
signature.push_str(&format!("{}?: {}", arg.name, arg.type_));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
signature.push(')');
|
signature.push(')');
|
||||||
if let Some(return_value) = self.return_value() {
|
if let Some(return_value) = self.return_value() {
|
||||||
|
@ -420,6 +420,36 @@ impl Args {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_sketch_group_and_optional_tag(&self) -> Result<(Box<SketchGroup>, Option<String>), KclError> {
|
||||||
|
let first_value = self.args.first().ok_or_else(|| {
|
||||||
|
KclError::Type(KclErrorDetails {
|
||||||
|
message: format!("Expected a SketchGroup as the first argument, found `{:?}`", self.args),
|
||||||
|
source_ranges: vec![self.source_range],
|
||||||
|
})
|
||||||
|
})?;
|
||||||
|
|
||||||
|
let sketch_group = if let MemoryItem::SketchGroup(sg) = first_value {
|
||||||
|
sg.clone()
|
||||||
|
} else {
|
||||||
|
return Err(KclError::Type(KclErrorDetails {
|
||||||
|
message: format!("Expected a SketchGroup as the first argument, found `{:?}`", self.args),
|
||||||
|
source_ranges: vec![self.source_range],
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(second_value) = self.args.get(1) {
|
||||||
|
let tag: String = serde_json::from_value(second_value.get_json_value()?).map_err(|e| {
|
||||||
|
KclError::Type(KclErrorDetails {
|
||||||
|
message: format!("Failed to deserialize String from JSON: {}", e),
|
||||||
|
source_ranges: vec![self.source_range],
|
||||||
|
})
|
||||||
|
})?;
|
||||||
|
Ok((sketch_group, Some(tag)))
|
||||||
|
} else {
|
||||||
|
Ok((sketch_group, None))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn get_data_and_optional_tag<T: serde::de::DeserializeOwned>(
|
fn get_data_and_optional_tag<T: serde::de::DeserializeOwned>(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<(T, Option<SketchOnFaceTag>), KclError> {
|
) -> Result<(T, Option<SketchOnFaceTag>), KclError> {
|
||||||
@ -881,10 +911,14 @@ mod tests {
|
|||||||
fn_docs.push_str("#### Arguments\n\n");
|
fn_docs.push_str("#### Arguments\n\n");
|
||||||
for arg in internal_fn.args() {
|
for arg in internal_fn.args() {
|
||||||
let (format, should_be_indented) = arg.get_type_string().unwrap();
|
let (format, should_be_indented) = arg.get_type_string().unwrap();
|
||||||
|
let optional_string = if arg.required { " (REQUIRED)" } else { " (OPTIONAL)" }.to_string();
|
||||||
if let Some(description) = arg.description() {
|
if let Some(description) = arg.description() {
|
||||||
fn_docs.push_str(&format!("* `{}`: `{}` - {}\n", arg.name, arg.type_, description));
|
fn_docs.push_str(&format!(
|
||||||
|
"* `{}`: `{}` - {}{}\n",
|
||||||
|
arg.name, arg.type_, description, optional_string
|
||||||
|
));
|
||||||
} else {
|
} else {
|
||||||
fn_docs.push_str(&format!("* `{}`: `{}`\n", arg.name, arg.type_));
|
fn_docs.push_str(&format!("* `{}`: `{}`{}\n", arg.name, arg.type_, optional_string));
|
||||||
}
|
}
|
||||||
|
|
||||||
if should_be_indented {
|
if should_be_indented {
|
||||||
|
@ -1073,9 +1073,9 @@ async fn inner_start_profile_at(
|
|||||||
|
|
||||||
/// Close the current sketch.
|
/// Close the current sketch.
|
||||||
pub async fn close(args: Args) -> Result<MemoryItem, KclError> {
|
pub async fn close(args: Args) -> Result<MemoryItem, KclError> {
|
||||||
let sketch_group = args.get_sketch_group()?;
|
let (sketch_group, tag): (Box<SketchGroup>, Option<String>) = args.get_sketch_group_and_optional_tag()?;
|
||||||
|
|
||||||
let new_sketch_group = inner_close(sketch_group, args).await?;
|
let new_sketch_group = inner_close(sketch_group, tag, args).await?;
|
||||||
|
|
||||||
Ok(MemoryItem::SketchGroup(new_sketch_group))
|
Ok(MemoryItem::SketchGroup(new_sketch_group))
|
||||||
}
|
}
|
||||||
@ -1084,7 +1084,11 @@ pub async fn close(args: Args) -> Result<MemoryItem, KclError> {
|
|||||||
#[stdlib {
|
#[stdlib {
|
||||||
name = "close",
|
name = "close",
|
||||||
}]
|
}]
|
||||||
async fn inner_close(sketch_group: Box<SketchGroup>, args: Args) -> Result<Box<SketchGroup>, KclError> {
|
async fn inner_close(
|
||||||
|
sketch_group: Box<SketchGroup>,
|
||||||
|
tag: Option<String>,
|
||||||
|
args: Args,
|
||||||
|
) -> Result<Box<SketchGroup>, KclError> {
|
||||||
let from = sketch_group.get_coords_from_paths()?;
|
let from = sketch_group.get_coords_from_paths()?;
|
||||||
let to: Point2d = sketch_group.start.from.into();
|
let to: Point2d = sketch_group.start.from.into();
|
||||||
|
|
||||||
@ -1110,8 +1114,7 @@ async fn inner_close(sketch_group: Box<SketchGroup>, args: Args) -> Result<Box<S
|
|||||||
base: BasePath {
|
base: BasePath {
|
||||||
from: from.into(),
|
from: from.into(),
|
||||||
to: to.into(),
|
to: to.into(),
|
||||||
// TODO: should we use a different name?
|
name: tag.unwrap_or_default(),
|
||||||
name: "".into(),
|
|
||||||
geo_meta: GeoMeta {
|
geo_meta: GeoMeta {
|
||||||
id,
|
id,
|
||||||
metadata: args.source_range.into(),
|
metadata: args.source_range.into(),
|
||||||
|
@ -260,6 +260,29 @@ async fn serial_test_basic_fillet_cube_end() {
|
|||||||
twenty_twenty::assert_image("tests/executor/outputs/basic_fillet_cube_end.png", &result, 0.999);
|
twenty_twenty::assert_image("tests/executor/outputs/basic_fillet_cube_end.png", &result, 0.999);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn serial_test_basic_fillet_cube_close_opposite() {
|
||||||
|
let code = r#"const part001 = startSketchOn('XY')
|
||||||
|
|> startProfileAt([0,0], %)
|
||||||
|
|> line({to: [0, 10], tag: "thing"}, %)
|
||||||
|
|> line([10, 0], %)
|
||||||
|
|> line({to: [0, -10], tag: "thing2"}, %)
|
||||||
|
|> close(%, "thing3")
|
||||||
|
|> extrude(10, %)
|
||||||
|
|> fillet({radius: 2, tags: ["thing3", getOppositeEdge("thing3", %)]}, %)
|
||||||
|
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
twenty_twenty::assert_image(
|
||||||
|
"tests/executor/outputs/basic_fillet_cube_close_opposite.png",
|
||||||
|
&result,
|
||||||
|
0.999,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread")]
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
async fn serial_test_basic_fillet_cube_next_adjacent() {
|
async fn serial_test_basic_fillet_cube_next_adjacent() {
|
||||||
let code = r#"const part001 = startSketchOn('XY')
|
let code = r#"const part001 = startSketchOn('XY')
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 99 KiB |
Reference in New Issue
Block a user