fix links for kcl docs (#1714)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* more link

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* better highlighting

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* better highlighting

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-03-13 15:43:42 -07:00
committed by GitHub
parent 17b7c687d4
commit d3d2612a3b
70 changed files with 234 additions and 234 deletions

View File

@ -8,13 +8,13 @@ Computes the absolute value of a number.
``` ```js
abs(num: number) -> number abs(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = abs(-4) const myVar = abs(-4)
``` ```

View File

@ -8,13 +8,13 @@ Computes the arccosine of a number (in radians).
``` ```js
acos(num: number) -> number acos(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = acos(0.5) const myVar = acos(0.5)
``` ```

View File

@ -8,13 +8,13 @@ Returns the angle to match the given length for x.
``` ```js
angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
```kcl ```js
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [1, 3.82], tag: 'seg01' }, %) |> line({ to: [1, 3.82], tag: 'seg01' }, %)
@ -30,7 +30,7 @@ const part001 = startSketchOn('XY')
* `segment_name`: `string` (REQUIRED) * `segment_name`: `string` (REQUIRED)
* `to`: `number` (REQUIRED) * `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Returns the angle to match the given length for y.
``` ```js
angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
```kcl ```js
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [1, 3.82], tag: 'seg01' }, %) |> line({ to: [1, 3.82], tag: 'seg01' }, %)
@ -30,7 +30,7 @@ const part001 = startSketchOn('XY')
* `segment_name`: `string` (REQUIRED) * `segment_name`: `string` (REQUIRED)
* `to`: `number` (REQUIRED) * `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw an angled line.
``` ```js
angledLine(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup angledLine(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 45, length: 10, tag: "edge1" }, %) |> angledLine({ angle: 45, length: 10, tag: "edge1" }, %)
@ -27,7 +27,7 @@ startSketchOn('XY')
### Arguments ### Arguments
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
``` ```js
{ {
// The angle of the line. // The angle of the line.
angle: number, angle: number,
@ -39,7 +39,7 @@ startSketchOn('XY')
[number, number] [number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -206,7 +206,7 @@ startSketchOn('XY')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw an angled line of a given x length.
``` ```js
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XZ') startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLineOfXLength({ angle: 45, length: 10, tag: "edge1" }, %) |> angledLineOfXLength({ angle: 45, length: 10, tag: "edge1" }, %)
@ -27,7 +27,7 @@ startSketchOn('XZ')
### Arguments ### Arguments
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
``` ```js
{ {
// The angle of the line. // The angle of the line.
angle: number, angle: number,
@ -39,7 +39,7 @@ startSketchOn('XZ')
[number, number] [number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -206,7 +206,7 @@ startSketchOn('XZ')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw an angled line of a given y length.
``` ```js
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('YZ') startSketchOn('YZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLineOfYLength({ angle: 45, length: 10, tag: "edge1" }, %) |> angledLineOfYLength({ angle: 45, length: 10, tag: "edge1" }, %)
@ -28,7 +28,7 @@ startSketchOn('YZ')
### Arguments ### Arguments
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
``` ```js
{ {
// The angle of the line. // The angle of the line.
angle: number, angle: number,
@ -40,7 +40,7 @@ startSketchOn('YZ')
[number, number] [number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -207,7 +207,7 @@ startSketchOn('YZ')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw an angled line that intersects with a given line.
``` ```js
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup) -> SketchGroup angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> lineTo({ to: [2, 2], tag: "yo" }, %) |> lineTo({ to: [2, 2], tag: "yo" }, %)
@ -33,7 +33,7 @@ const part001 = startSketchOn('XY')
### Arguments ### Arguments
* `data`: `AngledLineThatIntersectsData` - Data for drawing an angled line that intersects with a given line. (REQUIRED) * `data`: `AngledLineThatIntersectsData` - Data for drawing an angled line that intersects with a given line. (REQUIRED)
``` ```js
{ {
// The angle of the line. // The angle of the line.
angle: number, angle: number,
@ -46,7 +46,7 @@ const part001 = startSketchOn('XY')
} }
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -213,7 +213,7 @@ const part001 = startSketchOn('XY')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw an angled line to a given x coordinate.
``` ```js
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup angledLineToX(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLineToX({ angle: 45, to: 10, tag: "edge1" }, %) |> angledLineToX({ angle: 45, to: 10, tag: "edge1" }, %)
@ -28,7 +28,7 @@ startSketchOn('XY')
### Arguments ### Arguments
* `data`: `AngledLineToData` - Data to draw an angled line to a point. (REQUIRED) * `data`: `AngledLineToData` - Data to draw an angled line to a point. (REQUIRED)
``` ```js
{ {
// The angle of the line. // The angle of the line.
angle: number, angle: number,
@ -40,7 +40,7 @@ startSketchOn('XY')
[number, number] [number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -207,7 +207,7 @@ startSketchOn('XY')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw an angled line to a given y coordinate.
``` ```js
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup angledLineToY(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLineToY({ angle: 45, to: 10, tag: "edge1" }, %) |> angledLineToY({ angle: 45, to: 10, tag: "edge1" }, %)
@ -27,7 +27,7 @@ startSketchOn('XY')
### Arguments ### Arguments
* `data`: `AngledLineToData` - Data to draw an angled line to a point. (REQUIRED) * `data`: `AngledLineToData` - Data to draw an angled line to a point. (REQUIRED)
``` ```js
{ {
// The angle of the line. // The angle of the line.
angle: number, angle: number,
@ -39,7 +39,7 @@ startSketchOn('XY')
[number, number] [number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -206,7 +206,7 @@ startSketchOn('XY')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw an arc.
``` ```js
arc(data: ArcData, sketch_group: SketchGroup) -> SketchGroup arc(data: ArcData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('-YZ') startSketchOn('-YZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> arc({ |> arc({
@ -29,7 +29,7 @@ startSketchOn('-YZ')
### Arguments ### Arguments
* `data`: `ArcData` - Data to draw an arc. (REQUIRED) * `data`: `ArcData` - Data to draw an arc. (REQUIRED)
``` ```js
{ {
// The end angle. // The end angle.
angle_end: number, angle_end: number,
@ -52,7 +52,7 @@ startSketchOn('-YZ')
} }
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -219,7 +219,7 @@ startSketchOn('-YZ')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Computes the arcsine of a number (in radians).
``` ```js
asin(num: number) -> number asin(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = asin(0.5) const myVar = asin(0.5)
``` ```

View File

@ -8,13 +8,13 @@ Computes the arctangent of a number (in radians).
``` ```js
atan(num: number) -> number atan(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = atan(1.0) const myVar = atan(1.0)
``` ```

View File

@ -8,13 +8,13 @@ Draw a bezier curve.
``` ```js
bezierCurve(data: BezierData, sketch_group: SketchGroup) -> SketchGroup bezierCurve(data: BezierData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> bezierCurve({ |> bezierCurve({
@ -30,7 +30,7 @@ startSketchOn('XY')
### Arguments ### Arguments
* `data`: `BezierData` - Data to draw a bezier curve. (REQUIRED) * `data`: `BezierData` - Data to draw a bezier curve. (REQUIRED)
``` ```js
{ {
// The first control point. // The first control point.
control1: [number, number], control1: [number, number],
@ -43,7 +43,7 @@ startSketchOn('XY')
} }
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -210,7 +210,7 @@ startSketchOn('XY')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Computes the smallest integer greater than or equal to a number.
``` ```js
ceil(num: number) -> number ceil(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = ceil(4.5) const myVar = ceil(4.5)
``` ```

View File

@ -8,7 +8,7 @@ Sketch a circle on the given plane
``` ```js
circle(center: [number, number], radius: number, surface: SketchSurface, tag?: String) -> SketchGroup circle(center: [number, number], radius: number, surface: SketchSurface, tag?: String) -> SketchGroup
``` ```
@ -17,7 +17,7 @@ circle(center: [number, number], radius: number, surface: SketchSurface, tag?: S
* `center`: `[number, number]` (REQUIRED) * `center`: `[number, number]` (REQUIRED)
* `radius`: `number` (REQUIRED) * `radius`: `number` (REQUIRED)
* `surface`: `SketchSurface` - A sketch group type. (REQUIRED) * `surface`: `SketchSurface` - A sketch group type. (REQUIRED)
``` ```js
{ {
// The id of the plane. // The id of the plane.
id: uuid, id: uuid,
@ -82,7 +82,7 @@ circle(center: [number, number], radius: number, surface: SketchSurface, tag?: S
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Close the current sketch.
``` ```js
close(sketch_group: SketchGroup, tag?: String) -> SketchGroup close(sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XZ') startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 10], %) |> line([10, 10], %)
@ -22,7 +22,7 @@ startSketchOn('XZ')
|> close(%) |> close(%)
``` ```
```kcl ```js
startSketchOn('YZ') startSketchOn('YZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 10], %) |> line([10, 10], %)
@ -33,7 +33,7 @@ startSketchOn('YZ')
### Arguments ### Arguments
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -201,7 +201,7 @@ startSketchOn('YZ')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Computes the sine of a number (in radians).
``` ```js
cos(num: number) -> number cos(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const anotherVar = cos(2 * pi()) const anotherVar = cos(2 * pi())
``` ```

View File

@ -8,13 +8,13 @@ Return the value of Eulers number `e`.
``` ```js
e() -> number e() -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = e() const myVar = e()
``` ```

View File

@ -8,13 +8,13 @@ Extrudes by a given amount.
``` ```js
extrude(length: number, sketch_group: SketchGroup) -> ExtrudeGroup extrude(length: number, sketch_group: SketchGroup) -> ExtrudeGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 10], %) |> line([0, 10], %)
@ -28,7 +28,7 @@ startSketchOn('XY')
* `length`: `number` (REQUIRED) * `length`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -195,7 +195,7 @@ startSketchOn('XY')
### Returns ### Returns
`ExtrudeGroup` - An extrude group is a collection of extrude surfaces. `ExtrudeGroup` - An extrude group is a collection of extrude surfaces.
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,

View File

@ -8,13 +8,13 @@ Create fillets on tagged paths.
``` ```js
fillet(data: FilletData, extrude_group: ExtrudeGroup) -> ExtrudeGroup fillet(data: FilletData, extrude_group: ExtrudeGroup) -> ExtrudeGroup
``` ```
### Examples ### Examples
```kcl ```js
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [0, 10], tag: "thing" }, %) |> line({ to: [0, 10], tag: "thing" }, %)
@ -28,7 +28,7 @@ const part001 = startSketchOn('XY')
### Arguments ### Arguments
* `data`: `FilletData` - Data for fillets. (REQUIRED) * `data`: `FilletData` - Data for fillets. (REQUIRED)
``` ```js
{ {
// The radius of the fillet. // The radius of the fillet.
radius: number, radius: number,
@ -38,7 +38,7 @@ string],
} }
``` ```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
@ -172,7 +172,7 @@ string],
### Returns ### Returns
`ExtrudeGroup` - An extrude group is a collection of extrude surfaces. `ExtrudeGroup` - An extrude group is a collection of extrude surfaces.
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,

View File

@ -8,13 +8,13 @@ Computes the largest integer less than or equal to a number.
``` ```js
floor(num: number) -> number floor(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = floor(4.5) const myVar = floor(4.5)
``` ```

View File

@ -8,13 +8,13 @@ Returns the extrude wall transform.
``` ```js
getExtrudeWallTransform(surface_name: string, extrude_group: ExtrudeGroup) -> ExtrudeTransform getExtrudeWallTransform(surface_name: string, extrude_group: ExtrudeGroup) -> ExtrudeTransform
``` ```
### Examples ### Examples
```kcl ```js
const box = startSketchOn('XY') const box = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 10], %) |> line([0, 10], %)
@ -30,7 +30,7 @@ const transform = getExtrudeWallTransform('surface', box)
* `surface_name`: `string` (REQUIRED) * `surface_name`: `string` (REQUIRED)
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
@ -164,7 +164,7 @@ const transform = getExtrudeWallTransform('surface', box)
### Returns ### Returns
`ExtrudeTransform` `ExtrudeTransform`
``` ```js
{ {
position: [number, number, number], position: [number, number, number],
rotation: [number, number, number, number], rotation: [number, number, number, number],

View File

@ -8,13 +8,13 @@ Get the next adjacent edge to the edge given.
``` ```js
getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
```kcl ```js
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [0, 10], tag: "thing" }, %) |> line({ to: [0, 10], tag: "thing" }, %)
@ -32,7 +32,7 @@ const part001 = startSketchOn('XY')
* `tag`: `String` (REQUIRED) * `tag`: `String` (REQUIRED)
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,

View File

@ -8,13 +8,13 @@ Get the opposite edge to the edge given.
``` ```js
getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
```kcl ```js
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [0, 10], tag: "thing" }, %) |> line({ to: [0, 10], tag: "thing" }, %)
@ -32,7 +32,7 @@ const part001 = startSketchOn('XY')
* `tag`: `String` (REQUIRED) * `tag`: `String` (REQUIRED)
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,

View File

@ -8,13 +8,13 @@ Get the previous adjacent edge to the edge given.
``` ```js
getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
```kcl ```js
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [0, 10], tag: "thing" }, %) |> line({ to: [0, 10], tag: "thing" }, %)
@ -32,7 +32,7 @@ const part001 = startSketchOn('XY')
* `tag`: `String` (REQUIRED) * `tag`: `String` (REQUIRED)
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,

View File

@ -8,13 +8,13 @@ Use a sketch to cut a hole in another sketch.
``` ```js
hole(hole_sketch_group: SketchGroupSet, sketch_group: SketchGroup) -> SketchGroup hole(hole_sketch_group: SketchGroupSet, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
const square = startSketchOn('XY') const square = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 10], %) |> line([0, 10], %)
@ -29,7 +29,7 @@ const square = startSketchOn('XY')
### Arguments ### Arguments
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) * `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -197,7 +197,7 @@ const square = startSketchOn('XY')
} }
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -364,7 +364,7 @@ const square = startSketchOn('XY')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -9,29 +9,29 @@ Import a CAD file.
For formats lacking unit data (STL, OBJ, PLY), the default import unit is millimeters. Otherwise you can specify the unit by passing in the options parameter. If you import a gltf file, we will try to find the bin file and import it as well. For formats lacking unit data (STL, OBJ, PLY), the default import unit is millimeters. Otherwise you can specify the unit by passing in the options parameter. If you import a gltf file, we will try to find the bin file and import it as well.
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.
``` ```js
import(file_path: String, options?: ImportFormat) -> ImportedGeometry import(file_path: String, options?: ImportFormat) -> ImportedGeometry
``` ```
### Examples ### Examples
```kcl ```js
const model = import("thing.obj") const model = import("thing.obj")
``` ```
```kcl ```js
const model = import("cube.obj", { type: "obj", units: "m" }) const model = import("cube.obj", { type: "obj", units: "m" })
``` ```
```kcl ```js
const model = import("my_model.gltf") const model = import("my_model.gltf")
``` ```
```kcl ```js
const model = import("my_model.sldprt") const model = import("my_model.sldprt")
``` ```
```kcl ```js
const model = import("my_model.step") const model = import("my_model.step")
``` ```
@ -39,7 +39,7 @@ const model = import("my_model.step")
* `file_path`: `String` (REQUIRED) * `file_path`: `String` (REQUIRED)
* `options`: `ImportFormat` - Import format specifier (OPTIONAL) * `options`: `ImportFormat` - Import format specifier (OPTIONAL)
``` ```js
{ {
type: "fbx", type: "fbx",
} | } |
@ -123,7 +123,7 @@ const model = import("my_model.step")
### Returns ### Returns
`ImportedGeometry` - Data for an imported geometry. `ImportedGeometry` - Data for an imported geometry.
``` ```js
{ {
// The ID of the imported geometry. // The ID of the imported geometry.
id: uuid, id: uuid,

View File

@ -8,13 +8,13 @@ Returns the last segment of x.
``` ```js
lastSegX(sketch_group: SketchGroup) -> number lastSegX(sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn("YZ") startSketchOn("YZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [5, 0], tag: "thing" }, %) |> line({ to: [5, 0], tag: "thing" }, %)
@ -27,7 +27,7 @@ startSketchOn("YZ")
### Arguments ### Arguments
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Returns the last segment of y.
``` ```js
lastSegY(sketch_group: SketchGroup) -> number lastSegY(sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn("YZ") startSketchOn("YZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [5, 0], tag: "thing" }, %) |> line({ to: [5, 0], tag: "thing" }, %)
@ -27,7 +27,7 @@ startSketchOn("YZ")
### Arguments ### Arguments
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Returns the angle of the given leg for x.
``` ```js
legAngX(hypotenuse: number, leg: number) -> number legAngX(hypotenuse: number, leg: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
legAngX(5, 3) legAngX(5, 3)
``` ```

View File

@ -8,13 +8,13 @@ Returns the angle of the given leg for y.
``` ```js
legAngY(hypotenuse: number, leg: number) -> number legAngY(hypotenuse: number, leg: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
legAngY(5, 3) legAngY(5, 3)
``` ```

View File

@ -8,13 +8,13 @@ Returns the length of the given leg.
``` ```js
legLen(hypotenuse: number, leg: number) -> number legLen(hypotenuse: number, leg: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
legLen(5, 3) legLen(5, 3)
``` ```

View File

@ -8,13 +8,13 @@ Draw a line.
``` ```js
line(data: LineData, sketch_group: SketchGroup) -> SketchGroup line(data: LineData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('-XY') startSketchOn('-XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 10], %) |> line([10, 10], %)
@ -26,7 +26,7 @@ startSketchOn('-XY')
### Arguments ### Arguments
* `data`: `LineData` - Data to draw a line. (REQUIRED) * `data`: `LineData` - Data to draw a line. (REQUIRED)
``` ```js
{ {
// The tag. // The tag.
tag: string, tag: string,
@ -36,7 +36,7 @@ startSketchOn('-XY')
[number, number] [number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -203,7 +203,7 @@ startSketchOn('-XY')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw a line to a point.
``` ```js
lineTo(data: LineToData, sketch_group: SketchGroup) -> SketchGroup lineTo(data: LineToData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
fn rectShape = (pos, w, l) => { fn rectShape = (pos, w, l) => {
const rr = startSketchOn('YZ') const rr = startSketchOn('YZ')
|> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %) |> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %)
@ -41,7 +41,7 @@ const part = rectShape([0, 0], 20, 20)
### Arguments ### Arguments
* `data`: `LineToData` - Data to draw a line to a point. (REQUIRED) * `data`: `LineToData` - Data to draw a line to a point. (REQUIRED)
``` ```js
{ {
// The tag. // The tag.
tag: string, tag: string,
@ -51,7 +51,7 @@ const part = rectShape([0, 0], 20, 20)
[number, number] [number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -218,7 +218,7 @@ const part = rectShape([0, 0], 20, 20)
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Computes the natural logarithm of the number.
``` ```js
ln(num: number) -> number ln(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = ln(4) const myVar = ln(4)
``` ```

View File

@ -8,13 +8,13 @@ Computes the logarithm of the number with respect to an arbitrary base.
The result might not be correctly rounded owing to implementation details; `log2()` can produce more accurate results for base 2, and `log10()` can produce more accurate results for base 10. The result might not be correctly rounded owing to implementation details; `log2()` can produce more accurate results for base 2, and `log10()` can produce more accurate results for base 10.
``` ```js
log(num: number, base: number) -> number log(num: number, base: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = log(4, 2) const myVar = log(4, 2)
``` ```

View File

@ -8,13 +8,13 @@ Computes the base 10 logarithm of the number.
``` ```js
log10(num: number) -> number log10(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = log10(4) const myVar = log10(4)
``` ```

View File

@ -8,13 +8,13 @@ Computes the base 2 logarithm of the number.
``` ```js
log2(num: number) -> number log2(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = log2(4) const myVar = log2(4)
``` ```

View File

@ -8,13 +8,13 @@ Computes the maximum of the given arguments.
``` ```js
max(args: [number]) -> number max(args: [number]) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = max(4, 5, 6) const myVar = max(4, 5, 6)
``` ```

View File

@ -8,13 +8,13 @@ Computes the minimum of the given arguments.
``` ```js
min(args: [number]) -> number min(args: [number]) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = min(4, 5, 6) const myVar = min(4, 5, 6)
``` ```

View File

@ -8,13 +8,13 @@ A circular pattern on a 2D sketch.
``` ```js
patternCircular2d(data: CircularPattern2dData, sketch_group: SketchGroup) -> [SketchGroup] patternCircular2d(data: CircularPattern2dData, sketch_group: SketchGroup) -> [SketchGroup]
``` ```
### Examples ### Examples
```kcl ```js
const part = startSketchOn('XY') const part = startSketchOn('XY')
|> circle([0, 0], 2, %) |> circle([0, 0], 2, %)
|> patternCircular2d({ |> patternCircular2d({
@ -28,7 +28,7 @@ const part = startSketchOn('XY')
### Arguments ### Arguments
* `data`: `CircularPattern2dData` - Data for a circular pattern on a 2D sketch. (REQUIRED) * `data`: `CircularPattern2dData` - Data for a circular pattern on a 2D sketch. (REQUIRED)
``` ```js
{ {
// 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.
arcDegrees: number, arcDegrees: number,
@ -41,7 +41,7 @@ const part = startSketchOn('XY')
} }
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ A circular pattern on a 3D model.
``` ```js
patternCircular3d(data: CircularPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup] patternCircular3d(data: CircularPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup]
``` ```
### Examples ### Examples
```kcl ```js
const part = startSketchOn('XY') const part = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 1], %) |> line([0, 1], %)
@ -34,7 +34,7 @@ const part = startSketchOn('XY')
### Arguments ### Arguments
* `data`: `CircularPattern3dData` - Data for a circular pattern on a 3D model. (REQUIRED) * `data`: `CircularPattern3dData` - Data for a circular pattern on a 3D model. (REQUIRED)
``` ```js
{ {
// 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.
arcDegrees: number, arcDegrees: number,
@ -49,7 +49,7 @@ const part = startSketchOn('XY')
} }
``` ```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,

View File

@ -8,13 +8,13 @@ A linear pattern on a 2D sketch.
``` ```js
patternLinear2d(data: LinearPattern2dData, sketch_group: SketchGroup) -> [SketchGroup] patternLinear2d(data: LinearPattern2dData, sketch_group: SketchGroup) -> [SketchGroup]
``` ```
### Examples ### Examples
```kcl ```js
const part = startSketchOn('XY') const part = startSketchOn('XY')
|> circle([0, 0], 2, %) |> circle([0, 0], 2, %)
|> patternLinear2d({ |> patternLinear2d({
@ -27,7 +27,7 @@ const part = startSketchOn('XY')
### Arguments ### Arguments
* `data`: `LinearPattern2dData` - Data for a linear pattern on a 2D sketch. (REQUIRED) * `data`: `LinearPattern2dData` - Data for a linear pattern on a 2D sketch. (REQUIRED)
``` ```js
{ {
// The axis of the pattern. This is a 2D vector. // The axis of the pattern. This is a 2D vector.
axis: [number, number], axis: [number, number],
@ -38,7 +38,7 @@ const part = startSketchOn('XY')
} }
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ A linear pattern on a 3D model.
``` ```js
patternLinear3d(data: LinearPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup] patternLinear3d(data: LinearPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup]
``` ```
### Examples ### Examples
```kcl ```js
const part = startSketchOn('XY') const part = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 1], %) |> line([0, 1], %)
@ -32,7 +32,7 @@ const part = startSketchOn('XY')
### Arguments ### Arguments
* `data`: `LinearPattern3dData` - Data for a linear pattern on a 3D model. (REQUIRED) * `data`: `LinearPattern3dData` - Data for a linear pattern on a 3D model. (REQUIRED)
``` ```js
{ {
// The axis of the pattern. // The axis of the pattern.
axis: [number, number, number], axis: [number, number, number],
@ -43,7 +43,7 @@ const part = startSketchOn('XY')
} }
``` ```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
``` ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,

View File

@ -8,13 +8,13 @@ Return the value of `pi`. Archimedes constant (π).
``` ```js
pi() -> number pi() -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = pi() * 3.0 const myVar = pi() * 3.0
``` ```

View File

@ -8,13 +8,13 @@ Computes the number to a power.
``` ```js
pow(num: number, pow: number) -> number pow(num: number, pow: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = pow(4, 2) const myVar = pow(4, 2)
``` ```

View File

@ -8,13 +8,13 @@ Returns the angle of the segment.
``` ```js
segAng(segment_name: string, sketch_group: SketchGroup) -> number segAng(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
```kcl ```js
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([4.83, 12.56], %) |> startProfileAt([4.83, 12.56], %)
|> line([15.1, 2.48], %) |> line([15.1, 2.48], %)
@ -30,7 +30,7 @@ const part001 = startSketchOn('XY')
* `segment_name`: `string` (REQUIRED) * `segment_name`: `string` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Returns the segment end of x.
``` ```js
segEndX(segment_name: string, sketch_group: SketchGroup) -> number segEndX(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn("YZ") startSketchOn("YZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [5, 0], tag: "thing" }, %) |> line({ to: [5, 0], tag: "thing" }, %)
@ -28,7 +28,7 @@ startSketchOn("YZ")
* `segment_name`: `string` (REQUIRED) * `segment_name`: `string` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Returns the segment end of y.
``` ```js
segEndY(segment_name: string, sketch_group: SketchGroup) -> number segEndY(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn("YZ") startSketchOn("YZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [5, 0], tag: "thing" }, %) |> line({ to: [5, 0], tag: "thing" }, %)
@ -28,7 +28,7 @@ startSketchOn("YZ")
* `segment_name`: `string` (REQUIRED) * `segment_name`: `string` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Returns the length of the segment.
``` ```js
segLen(segment_name: string, sketch_group: SketchGroup) -> number segLen(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn("YZ") startSketchOn("YZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [5, 0], tag: "thing" }, %) |> line({ to: [5, 0], tag: "thing" }, %)
@ -28,7 +28,7 @@ startSketchOn("YZ")
* `segment_name`: `string` (REQUIRED) * `segment_name`: `string` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Computes the sine of a number (in radians).
``` ```js
sin(num: number) -> number sin(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = sin(2 * pi()) const myVar = sin(2 * pi())
``` ```

View File

@ -8,13 +8,13 @@ Computes the square root of a number.
``` ```js
sqrt(num: number) -> number sqrt(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = sqrt(4) const myVar = sqrt(4)
``` ```

View File

@ -8,13 +8,13 @@ Start a profile at a given point.
``` ```js
startProfileAt(data: LineData, sketch_surface: SketchSurface) -> SketchGroup startProfileAt(data: LineData, sketch_surface: SketchSurface) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 10], %) |> line([10, 10], %)
@ -23,7 +23,7 @@ startSketchOn('XY')
### Arguments ### Arguments
* `data`: `LineData` - Data to draw a line. (REQUIRED) * `data`: `LineData` - Data to draw a line. (REQUIRED)
``` ```js
{ {
// The tag. // The tag.
tag: string, tag: string,
@ -33,7 +33,7 @@ startSketchOn('XY')
[number, number] [number, number]
``` ```
* `sketch_surface`: `SketchSurface` - A sketch group type. (REQUIRED) * `sketch_surface`: `SketchSurface` - A sketch group type. (REQUIRED)
``` ```js
{ {
// The id of the plane. // The id of the plane.
id: uuid, id: uuid,
@ -97,7 +97,7 @@ startSketchOn('XY')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Start a sketch at a given point on the 'XY' plane.
``` ```js
startSketchAt(data: LineData) -> SketchGroup startSketchAt(data: LineData) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchAt([0, 0]) startSketchAt([0, 0])
|> line([10, 10], %) |> line([10, 10], %)
``` ```
@ -22,7 +22,7 @@ startSketchAt([0, 0])
### Arguments ### Arguments
* `data`: `LineData` - Data to draw a line. (REQUIRED) * `data`: `LineData` - Data to draw a line. (REQUIRED)
``` ```js
{ {
// The tag. // The tag.
tag: string, tag: string,
@ -35,7 +35,7 @@ startSketchAt([0, 0])
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Start a sketch on a specific plane or face.
``` ```js
startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 10], %) |> line([10, 10], %)
@ -22,7 +22,7 @@ startSketchOn('XY')
|> close(%, "edge2") |> close(%, "edge2")
``` ```
```kcl ```js
fn cube = (pos, scale) => { fn cube = (pos, scale) => {
const sg = startSketchOn('XY') const sg = startSketchOn('XY')
|> startProfileAt(pos, %) |> startProfileAt(pos, %)
@ -48,7 +48,7 @@ const part001 = startSketchOn(box, "start")
### Arguments ### Arguments
* `data`: `SketchData` - Data for start sketch on. You can start a sketch on a plane or an extrude group. (REQUIRED) * `data`: `SketchData` - Data for start sketch on. You can start a sketch on a plane or an extrude group. (REQUIRED)
``` ```js
"XY" | "XY" |
"-XY" | "-XY" |
"XZ" | "XZ" |
@ -213,7 +213,7 @@ const part001 = startSketchOn(box, "start")
} }
``` ```
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL) * `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
``` ```js
"start" | "end" | "start" | "end" |
string string
``` ```
@ -221,7 +221,7 @@ string
### Returns ### Returns
`SketchSurface` - A sketch group type. `SketchSurface` - A sketch group type.
``` ```js
{ {
// The id of the plane. // The id of the plane.
id: uuid, id: uuid,

View File

@ -8,13 +8,13 @@ Computes the tangent of a number (in radians).
``` ```js
tan(num: number) -> number tan(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = tan(2 * pi()) const myVar = tan(2 * pi())
``` ```

View File

@ -8,13 +8,13 @@ Draw an arc.
``` ```js
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup) -> SketchGroup tangentialArc(data: TangentialArcData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('-YZ') startSketchOn('-YZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [10, 10], tag: "edge0" }, %) |> line({ to: [10, 10], tag: "edge0" }, %)
@ -26,7 +26,7 @@ startSketchOn('-YZ')
### Arguments ### Arguments
* `data`: `TangentialArcData` - Data to draw a tangential arc. (REQUIRED) * `data`: `TangentialArcData` - Data to draw a tangential arc. (REQUIRED)
``` ```js
{ {
// Offset of the arc, in degrees. // Offset of the arc, in degrees.
offset: number, offset: number,
@ -42,7 +42,7 @@ startSketchOn('-YZ')
[number, number] [number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -209,7 +209,7 @@ startSketchOn('-YZ')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw an arc.
``` ```js
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('-YZ') startSketchOn('-YZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line({ to: [10, 10], tag: "edge0" }, %) |> line({ to: [10, 10], tag: "edge0" }, %)
@ -26,7 +26,7 @@ startSketchOn('-YZ')
* `to`: `[number]` (REQUIRED) * `to`: `[number]` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -194,7 +194,7 @@ startSketchOn('-YZ')
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Return the value of `tau`. The full circle constant (τ). Equal to 2π.
``` ```js
tau() -> number tau() -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = tau() const myVar = tau()
``` ```

View File

@ -8,13 +8,13 @@ Converts a number from radians to degrees.
``` ```js
toDegrees(num: number) -> number toDegrees(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = toDegrees(2 * pi()) const myVar = toDegrees(2 * pi())
``` ```

View File

@ -8,13 +8,13 @@ Converts a number from degrees to radians.
``` ```js
toRadians(num: number) -> number toRadians(num: number) -> number
``` ```
### Examples ### Examples
```kcl ```js
const myVar = toRadians(180) const myVar = toRadians(180)
``` ```

View File

@ -8,13 +8,13 @@ Draw a line on the x-axis.
``` ```js
xLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup xLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('YZ') startSketchOn('YZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(10, %) |> xLine(10, %)
@ -26,7 +26,7 @@ startSketchOn('YZ')
### Arguments ### Arguments
* `data`: `AxisLineData` - Data to draw a line on an axis. (REQUIRED) * `data`: `AxisLineData` - Data to draw a line on an axis. (REQUIRED)
``` ```js
{ {
// The length of the line. // The length of the line.
length: number, length: number,
@ -36,7 +36,7 @@ startSketchOn('YZ')
number number
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -203,7 +203,7 @@ number
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw a line to a point on the x-axis.
``` ```js
xLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup xLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLineTo({ to: 10, tag: "edge1" }, %) |> xLineTo({ to: 10, tag: "edge1" }, %)
@ -26,7 +26,7 @@ startSketchOn('XY')
### Arguments ### Arguments
* `data`: `AxisLineToData` - Data to draw a line to a point on an axis. (REQUIRED) * `data`: `AxisLineToData` - Data to draw a line to a point on an axis. (REQUIRED)
``` ```js
{ {
// The tag. // The tag.
tag: string, tag: string,
@ -36,7 +36,7 @@ startSketchOn('XY')
number number
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -203,7 +203,7 @@ number
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw a line on the y-axis.
``` ```js
yLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup yLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLine(10, %) |> yLine(10, %)
@ -26,7 +26,7 @@ startSketchOn('XY')
### Arguments ### Arguments
* `data`: `AxisLineData` - Data to draw a line on an axis. (REQUIRED) * `data`: `AxisLineData` - Data to draw a line on an axis. (REQUIRED)
``` ```js
{ {
// The length of the line. // The length of the line.
length: number, length: number,
@ -36,7 +36,7 @@ startSketchOn('XY')
number number
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -203,7 +203,7 @@ number
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -8,13 +8,13 @@ Draw a line to a point on the y-axis.
``` ```js
yLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup yLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup
``` ```
### Examples ### Examples
```kcl ```js
startSketchOn('XZ') startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLineTo({ to: 10, tag: "edge1" }, %) |> yLineTo({ to: 10, tag: "edge1" }, %)
@ -27,7 +27,7 @@ startSketchOn('XZ')
### Arguments ### Arguments
* `data`: `AxisLineToData` - Data to draw a line to a point on an axis. (REQUIRED) * `data`: `AxisLineToData` - Data to draw a line to a point on an axis. (REQUIRED)
``` ```js
{ {
// The tag. // The tag.
tag: string, tag: string,
@ -37,7 +37,7 @@ startSketchOn('XZ')
number number
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,
@ -204,7 +204,7 @@ number
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
``` ```js
{ {
// The plane id or face id of the sketch group. // The plane id or face id of the sketch group.
entityId: uuid, entityId: uuid,

View File

@ -23,7 +23,7 @@ Plenty of you have professional CAD experience, and may not understand why codin
Before you dive straight into the app, we wanted to lay some expectations out for you. Before you dive straight into the app, we wanted to lay some expectations out for you.
- ZMA is in early development. Kurt pitched the idea back in January, and the team has been working hard on it since then. ZMA has really basic CAD features for now, but we have plenty of features on our roadmap. Most of the features that you may be currently used to in your CAD workflow today will be available down the road. - ZMA is in early development. Kurt pitched the idea back in January, and the team has been working hard on it since then. ZMA has really basic CAD features for now, but we have plenty of features on our roadmap. Most of the features that you may be currently used to in your CAD workflow today will be available down the road.
- For a list of all scripting functions, please reference our [documentation](https://github.com/KittyCAD/modeling-app/blob/main/docs/kcl/index.md). For a basic rundown of our types, please reference [this document](https://github.com/KittyCAD/modeling-app/blob/main/docs/kcl/types.md). - For a list of all scripting functions, please reference our [documentation](https://zoo.dev/docs/kcl). For a basic rundown of our types, please reference [this document](https://zoo.dev/docs/kcl/types).
- With that being said, we have created an external new features list in [GH Discussions](https://github.com/KittyCAD/modeling-app/discussions). For our current priority list, please click [here](https://github.com/KittyCAD/modeling-app/blob/main/public/roadmap.md). Please upvote any features in the GH Discussions page that you would like to see implemented first. We will prioritize the highest upvoted items or items that are foundational for other features on the list. You can also add your own, but we will review it to make sure its not a duplicate or its feasible for the current state of the app. - With that being said, we have created an external new features list in [GH Discussions](https://github.com/KittyCAD/modeling-app/discussions). For our current priority list, please click [here](https://github.com/KittyCAD/modeling-app/blob/main/public/roadmap.md). Please upvote any features in the GH Discussions page that you would like to see implemented first. We will prioritize the highest upvoted items or items that are foundational for other features on the list. You can also add your own, but we will review it to make sure its not a duplicate or its feasible for the current state of the app.
- Please report any and all bugs/issues you find. Even the smallest bugs are important! You can report them in a GH Issue [here](https://github.com/KittyCAD/modeling-app/issues/new). You are more than welcome to link your GH Issue in the **bugs** section of our Discord, but if you want to discuss the bug further, please keep that in the GH Issue thread. Please include the severity of the bug in your GH Issue ticket (High, Medium, or Low). If you are having trouble deciding what severity the bug is, use this guideline: - Please report any and all bugs/issues you find. Even the smallest bugs are important! You can report them in a GH Issue [here](https://github.com/KittyCAD/modeling-app/issues/new). You are more than welcome to link your GH Issue in the **bugs** section of our Discord, but if you want to discuss the bug further, please keep that in the GH Issue thread. Please include the severity of the bug in your GH Issue ticket (High, Medium, or Low). If you are having trouble deciding what severity the bug is, use this guideline:
- **High:** The bug is blocking you from continuing. - **High:** The bug is blocking you from continuing.

View File

@ -59,7 +59,7 @@ export const CodeMenu = ({ children }: PropsWithChildren) => {
<Menu.Item> <Menu.Item>
<a <a
className={styles.button} className={styles.button}
href="https://github.com/KittyCAD/modeling-app/blob/main/docs/kcl/index.md" href="https://zoo.dev/docs/kcl"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >

View File

@ -40,7 +40,7 @@ export default function CodeEditor() {
in kcl before they're available as point-and-click tools, so it's in kcl before they're available as point-and-click tools, so it's
good to have a link to{' '} good to have a link to{' '}
<a <a
href="https://github.com/KittyCAD/modeling-app/blob/main/docs/kcl/index.md" href="https://zoo.dev/docs/kcl"
rel="noreferrer noopener" rel="noreferrer noopener"
target="_blank" target="_blank"
> >

View File

@ -891,7 +891,7 @@ layout: manual
fn_docs.push_str(&format!("{}\n\n", internal_fn.summary())); fn_docs.push_str(&format!("{}\n\n", internal_fn.summary()));
fn_docs.push_str(&format!("{}\n\n", internal_fn.description())); fn_docs.push_str(&format!("{}\n\n", internal_fn.description()));
fn_docs.push_str("```\n"); fn_docs.push_str("```js\n");
let signature = internal_fn.fn_signature(); let signature = internal_fn.fn_signature();
fn_docs.push_str(&signature); fn_docs.push_str(&signature);
fn_docs.push_str("\n```\n\n"); fn_docs.push_str("\n```\n\n");
@ -900,7 +900,7 @@ layout: manual
fn_docs.push_str("### Examples\n\n"); fn_docs.push_str("### Examples\n\n");
for example in internal_fn.examples() { for example in internal_fn.examples() {
fn_docs.push_str("```kcl\n"); fn_docs.push_str("```js\n");
fn_docs.push_str(&example); fn_docs.push_str(&example);
fn_docs.push_str("\n```\n\n"); fn_docs.push_str("\n```\n\n");
} }
@ -920,7 +920,7 @@ layout: manual
} }
if should_be_indented { if should_be_indented {
fn_docs.push_str(&format!("```\n{}\n```\n", format)); fn_docs.push_str(&format!("```js\n{}\n```\n", format));
} }
} }
@ -934,7 +934,7 @@ layout: manual
let (format, should_be_indented) = return_type.get_type_string().unwrap(); let (format, should_be_indented) = return_type.get_type_string().unwrap();
if should_be_indented { if should_be_indented {
fn_docs.push_str(&format!("```\n{}\n```\n", format)); fn_docs.push_str(&format!("```js\n{}\n```\n", format));
} }
} }