diff --git a/.codespellrc b/.codespellrc index 63f506c1d..48b43c054 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,3 @@ [codespell] ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser,fromM,FromM -skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,./e2e/playwright/lib/console-error-whitelist.ts,.package-lock.json,**/package-lock.json,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo,./src/lib/machine-api.d.ts +skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/**/*.md,./e2e/playwright/lib/console-error-whitelist.ts,.package-lock.json,**/package-lock.json,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo,./src/lib/machine-api.d.ts diff --git a/docs/kcl-lang/index.md b/docs/kcl-lang/index.md new file mode 100644 index 000000000..4663979fa --- /dev/null +++ b/docs/kcl-lang/index.md @@ -0,0 +1,12 @@ +--- +title: "KCL Language Guide" +excerpt: "Documentation of the KCL language for the Zoo Design Studio." +layout: manual +--- + +## Topics + +* [`Types`](/docs/kcl-lang/types) +* [`Modules`](/docs/kcl-lang/modules) +* [`Settings`](/docs/kcl-lang/settings) +* [`Known Issues`](/docs/kcl-lang/known-issues) diff --git a/docs/kcl-src/known-issues.md b/docs/kcl-lang/known-issues.md similarity index 100% rename from docs/kcl-src/known-issues.md rename to docs/kcl-lang/known-issues.md diff --git a/docs/kcl-src/modules.md b/docs/kcl-lang/modules.md similarity index 100% rename from docs/kcl-src/modules.md rename to docs/kcl-lang/modules.md diff --git a/docs/kcl/settings-project.md b/docs/kcl-lang/settings-project.md similarity index 100% rename from docs/kcl/settings-project.md rename to docs/kcl-lang/settings-project.md diff --git a/docs/kcl/settings-user.md b/docs/kcl-lang/settings-user.md similarity index 100% rename from docs/kcl/settings-user.md rename to docs/kcl-lang/settings-user.md diff --git a/docs/kcl-src/settings.md b/docs/kcl-lang/settings.md similarity index 100% rename from docs/kcl-src/settings.md rename to docs/kcl-lang/settings.md diff --git a/docs/kcl-src/types.md b/docs/kcl-lang/types.md similarity index 100% rename from docs/kcl-src/types.md rename to docs/kcl-lang/types.md diff --git a/docs/kcl/README.md b/docs/kcl-std/README.md similarity index 100% rename from docs/kcl/README.md rename to docs/kcl-std/README.md diff --git a/docs/kcl/angledLine.md b/docs/kcl-std/angledLine.md similarity index 98% rename from docs/kcl/angledLine.md rename to docs/kcl-std/angledLine.md index 70fc315af..705c82725 100644 --- a/docs/kcl/angledLine.md +++ b/docs/kcl-std/angledLine.md @@ -26,18 +26,18 @@ angledLine( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `angle` | [`number`](/docs/kcl/types/std-types-number) | Which angle should the line be drawn at? | Yes | -| `length` | [`number`](/docs/kcl/types/std-types-number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | -| `lengthX` | [`number`](/docs/kcl/types/std-types-number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | -| `lengthY` | [`number`](/docs/kcl/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | -| `endAbsoluteX` | [`number`](/docs/kcl/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | -| `endAbsoluteY` | [`number`](/docs/kcl/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes | +| `length` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | +| `lengthX` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | +| `lengthY` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | +| `endAbsoluteX` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | +| `endAbsoluteY` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/angledLineThatIntersects.md b/docs/kcl-std/angledLineThatIntersects.md similarity index 99% rename from docs/kcl/angledLineThatIntersects.md rename to docs/kcl-std/angledLineThatIntersects.md index aa5d08743..2088699a8 100644 --- a/docs/kcl/angledLineThatIntersects.md +++ b/docs/kcl-std/angledLineThatIntersects.md @@ -23,15 +23,15 @@ angledLineThatIntersects( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `angle` | [`number`](/docs/kcl/types/std-types-number) | Which angle should the line be drawn at? | Yes | -| `intersectTag` | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The tag of the line to intersect with | Yes | -| `offset` | [`number`](/docs/kcl/types/std-types-number) | The offset from the intersecting line. Defaults to 0. | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes | +| `intersectTag` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the line to intersect with | Yes | +| `offset` | [`number`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. Defaults to 0. | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/appearance.md b/docs/kcl-std/appearance.md similarity index 99% rename from docs/kcl/appearance.md rename to docs/kcl-std/appearance.md index 4cb592631..db6964a43 100644 --- a/docs/kcl/appearance.md +++ b/docs/kcl-std/appearance.md @@ -22,14 +22,14 @@ appearance( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solids` | [`[Solid]`](/docs/kcl/types/std-types-Solid) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) | The solid(s) whose appearance is being set | Yes | -| `color` | [`string`](/docs/kcl/types/std-types-string) | Color of the new material, a hex string like '#ff0000' | Yes | -| `metalness` | [`number`](/docs/kcl/types/std-types-number) | Metalness of the new material, a percentage like 95.7. | No | -| `roughness` | [`number`](/docs/kcl/types/std-types-number) | Roughness of the new material, a percentage like 95.7. | No | +| `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) | The solid(s) whose appearance is being set | Yes | +| `color` | [`string`](/docs/kcl-std/types/std-types-string) | Color of the new material, a hex string like '#ff0000' | Yes | +| `metalness` | [`number`](/docs/kcl-std/types/std-types-number) | Metalness of the new material, a percentage like 95.7. | No | +| `roughness` | [`number`](/docs/kcl-std/types/std-types-number) | Roughness of the new material, a percentage like 95.7. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) - Data for a solid or an imported geometry. +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) - Data for a solid or an imported geometry. ### Examples diff --git a/docs/kcl/arc.md b/docs/kcl-std/arc.md similarity index 99% rename from docs/kcl/arc.md rename to docs/kcl-std/arc.md index f38d50477..93c4412aa 100644 --- a/docs/kcl/arc.md +++ b/docs/kcl-std/arc.md @@ -27,17 +27,17 @@ arc( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `angleStart` | [`number`](/docs/kcl/types/std-types-number) | Where along the circle should this arc start? | No | -| `angleEnd` | [`number`](/docs/kcl/types/std-types-number) | Where along the circle should this arc end? | No | -| `radius` | [`number`](/docs/kcl/types/std-types-number) | How large should the circle be? | No | -| `interiorAbsolute` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | Any point between the arc's start and end? Requires `endAbsolute`. Incompatible with `angleStart` or `angleEnd` | No | -| `endAbsolute` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | Where should this arc end? Requires `interiorAbsolute`. Incompatible with `angleStart` or `angleEnd` | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `angleStart` | [`number`](/docs/kcl-std/types/std-types-number) | Where along the circle should this arc start? | No | +| `angleEnd` | [`number`](/docs/kcl-std/types/std-types-number) | Where along the circle should this arc end? | No | +| `radius` | [`number`](/docs/kcl-std/types/std-types-number) | How large should the circle be? | No | +| `interiorAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Any point between the arc's start and end? Requires `endAbsolute`. Incompatible with `angleStart` or `angleEnd` | No | +| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where should this arc end? Requires `interiorAbsolute`. Incompatible with `angleStart` or `angleEnd` | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/assert.md b/docs/kcl-std/assert.md similarity index 95% rename from docs/kcl/assert.md rename to docs/kcl-std/assert.md index e0e3caabf..01b509197 100644 --- a/docs/kcl/assert.md +++ b/docs/kcl-std/assert.md @@ -26,14 +26,14 @@ assert( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `actual` | [`number`](/docs/kcl/types/std-types-number) | Value to check. It will be compared with one of the comparison arguments. | Yes | -| `isGreaterThan` | [`number`](/docs/kcl/types/std-types-number) | Comparison argument. If given, checks the `actual` value is greater than this. | No | -| `isLessThan` | [`number`](/docs/kcl/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than this. | No | -| `isGreaterThanOrEqual` | [`number`](/docs/kcl/types/std-types-number) | Comparison argument. If given, checks the `actual` value is greater than or equal to this. | No | -| `isLessThanOrEqual` | [`number`](/docs/kcl/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than or equal to this. | No | -| `isEqualTo` | [`number`](/docs/kcl/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than or equal to this. | No | -| `tolerance` | [`number`](/docs/kcl/types/std-types-number) | If `isEqualTo` is used, this is the tolerance to allow for the comparison. This tolerance is used because KCL's number system has some floating-point imprecision when used with very large decimal places. | No | -| `error` | [`string`](/docs/kcl/types/std-types-string) | If the value was false, the program will terminate with this error message | No | +| `actual` | [`number`](/docs/kcl-std/types/std-types-number) | Value to check. It will be compared with one of the comparison arguments. | Yes | +| `isGreaterThan` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is greater than this. | No | +| `isLessThan` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than this. | No | +| `isGreaterThanOrEqual` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is greater than or equal to this. | No | +| `isLessThanOrEqual` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than or equal to this. | No | +| `isEqualTo` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than or equal to this. | No | +| `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | If `isEqualTo` is used, this is the tolerance to allow for the comparison. This tolerance is used because KCL's number system has some floating-point imprecision when used with very large decimal places. | No | +| `error` | [`string`](/docs/kcl-std/types/std-types-string) | If the value was false, the program will terminate with this error message | No | ### Returns diff --git a/docs/kcl/assertIs.md b/docs/kcl-std/assertIs.md similarity index 98% rename from docs/kcl/assertIs.md rename to docs/kcl-std/assertIs.md index 78593851a..9c274181d 100644 --- a/docs/kcl/assertIs.md +++ b/docs/kcl-std/assertIs.md @@ -20,8 +20,8 @@ assertIs( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `actual` | [`bool`](/docs/kcl/types/std-types-bool) | Value to check. If this is the boolean value true, assert passes. Otherwise it fails. | Yes | -| `error` | [`string`](/docs/kcl/types/std-types-string) | If the value was false, the program will terminate with this error message | No | +| `actual` | [`bool`](/docs/kcl-std/types/std-types-bool) | Value to check. If this is the boolean value true, assert passes. Otherwise it fails. | Yes | +| `error` | [`string`](/docs/kcl-std/types/std-types-string) | If the value was false, the program will terminate with this error message | No | ### Returns diff --git a/docs/kcl/bezierCurve.md b/docs/kcl-std/bezierCurve.md similarity index 99% rename from docs/kcl/bezierCurve.md rename to docs/kcl-std/bezierCurve.md index 27b9ccd99..12af63d87 100644 --- a/docs/kcl/bezierCurve.md +++ b/docs/kcl-std/bezierCurve.md @@ -23,15 +23,15 @@ bezierCurve( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `control1` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | First control point for the cubic | Yes | -| `control2` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | Second control point for the cubic | Yes | -| `end` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? | Yes | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `control1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | First control point for the cubic | Yes | +| `control2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Second control point for the cubic | Yes | +| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/circleThreePoint.md b/docs/kcl-std/circleThreePoint.md similarity index 99% rename from docs/kcl/circleThreePoint.md rename to docs/kcl-std/circleThreePoint.md index 07158f0e2..012532cd2 100644 --- a/docs/kcl/circleThreePoint.md +++ b/docs/kcl-std/circleThreePoint.md @@ -23,15 +23,15 @@ circleThreePoint( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketchSurfaceOrGroup` | [`Sketch`](/docs/kcl/types/std-types-Sketch) or [`Plane`](/docs/kcl/types/std-types-Plane) or [`Face`](/docs/kcl/types/std-types-Face) | Plane or surface to sketch on. | Yes | -| `p1` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | 1st point to derive the circle. | Yes | -| `p2` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | 2nd point to derive the circle. | Yes | -| `p3` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | 3rd point to derive the circle. | Yes | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Identifier for the circle to reference elsewhere. | No | +| `sketchSurfaceOrGroup` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | Plane or surface to sketch on. | Yes | +| `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes | +| `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes | +| `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Identifier for the circle to reference elsewhere. | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/clone.md b/docs/kcl-std/clone.md similarity index 99% rename from docs/kcl/clone.md rename to docs/kcl-std/clone.md index 37f51ef55..d8f6edb13 100644 --- a/docs/kcl/clone.md +++ b/docs/kcl-std/clone.md @@ -21,11 +21,11 @@ clone(geometry: Solid | Sketch | ImportedGeometry): Solid | Sketch | ImportedGeo | Name | Type | Description | Required | |----------|------|-------------|----------| -| `geometry` | [`Solid`](/docs/kcl/types/std-types-Solid) or [`Sketch`](/docs/kcl/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) | The sketch, solid, or imported geometry to be cloned | Yes | +| `geometry` | [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) | The sketch, solid, or imported geometry to be cloned | Yes | ### Returns -[`Solid`](/docs/kcl/types/std-types-Solid) or [`Sketch`](/docs/kcl/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) - A geometry including an imported geometry. +[`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) - A geometry including an imported geometry. ### Examples diff --git a/docs/kcl/close.md b/docs/kcl-std/close.md similarity index 99% rename from docs/kcl/close.md rename to docs/kcl-std/close.md index dd731e779..7af9b4dec 100644 --- a/docs/kcl/close.md +++ b/docs/kcl-std/close.md @@ -20,12 +20,12 @@ close( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | The sketch you want to close | Yes | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch you want to close | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/consts.md b/docs/kcl-std/consts.md similarity index 100% rename from docs/kcl/consts.md rename to docs/kcl-std/consts.md diff --git a/docs/kcl/consts/std-END.md b/docs/kcl-std/consts/std-END.md similarity index 100% rename from docs/kcl/consts/std-END.md rename to docs/kcl-std/consts/std-END.md diff --git a/docs/kcl/consts/std-START.md b/docs/kcl-std/consts/std-START.md similarity index 100% rename from docs/kcl/consts/std-START.md rename to docs/kcl-std/consts/std-START.md diff --git a/docs/kcl/consts/std-X.md b/docs/kcl-std/consts/std-X.md similarity index 100% rename from docs/kcl/consts/std-X.md rename to docs/kcl-std/consts/std-X.md diff --git a/docs/kcl/consts/std-XY.md b/docs/kcl-std/consts/std-XY.md similarity index 100% rename from docs/kcl/consts/std-XY.md rename to docs/kcl-std/consts/std-XY.md diff --git a/docs/kcl/consts/std-XZ.md b/docs/kcl-std/consts/std-XZ.md similarity index 100% rename from docs/kcl/consts/std-XZ.md rename to docs/kcl-std/consts/std-XZ.md diff --git a/docs/kcl/consts/std-Y.md b/docs/kcl-std/consts/std-Y.md similarity index 100% rename from docs/kcl/consts/std-Y.md rename to docs/kcl-std/consts/std-Y.md diff --git a/docs/kcl/consts/std-YZ.md b/docs/kcl-std/consts/std-YZ.md similarity index 100% rename from docs/kcl/consts/std-YZ.md rename to docs/kcl-std/consts/std-YZ.md diff --git a/docs/kcl/consts/std-Z.md b/docs/kcl-std/consts/std-Z.md similarity index 100% rename from docs/kcl/consts/std-Z.md rename to docs/kcl-std/consts/std-Z.md diff --git a/docs/kcl/consts/std-math-E.md b/docs/kcl-std/consts/std-math-E.md similarity index 100% rename from docs/kcl/consts/std-math-E.md rename to docs/kcl-std/consts/std-math-E.md diff --git a/docs/kcl/consts/std-math-PI.md b/docs/kcl-std/consts/std-math-PI.md similarity index 100% rename from docs/kcl/consts/std-math-PI.md rename to docs/kcl-std/consts/std-math-PI.md diff --git a/docs/kcl/consts/std-math-TAU.md b/docs/kcl-std/consts/std-math-TAU.md similarity index 100% rename from docs/kcl/consts/std-math-TAU.md rename to docs/kcl-std/consts/std-math-TAU.md diff --git a/docs/kcl/consts/std-turns-HALF_TURN.md b/docs/kcl-std/consts/std-turns-HALF_TURN.md similarity index 100% rename from docs/kcl/consts/std-turns-HALF_TURN.md rename to docs/kcl-std/consts/std-turns-HALF_TURN.md diff --git a/docs/kcl/consts/std-turns-QUARTER_TURN.md b/docs/kcl-std/consts/std-turns-QUARTER_TURN.md similarity index 100% rename from docs/kcl/consts/std-turns-QUARTER_TURN.md rename to docs/kcl-std/consts/std-turns-QUARTER_TURN.md diff --git a/docs/kcl/consts/std-turns-THREE_QUARTER_TURN.md b/docs/kcl-std/consts/std-turns-THREE_QUARTER_TURN.md similarity index 100% rename from docs/kcl/consts/std-turns-THREE_QUARTER_TURN.md rename to docs/kcl-std/consts/std-turns-THREE_QUARTER_TURN.md diff --git a/docs/kcl/consts/std-turns-ZERO.md b/docs/kcl-std/consts/std-turns-ZERO.md similarity index 100% rename from docs/kcl/consts/std-turns-ZERO.md rename to docs/kcl-std/consts/std-turns-ZERO.md diff --git a/docs/kcl/extrude.md b/docs/kcl-std/extrude.md similarity index 99% rename from docs/kcl/extrude.md rename to docs/kcl-std/extrude.md index 6c9e0ebdf..0c2c67963 100644 --- a/docs/kcl/extrude.md +++ b/docs/kcl-std/extrude.md @@ -24,16 +24,16 @@ extrude( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketches` | [`[Sketch]`](/docs/kcl/types/std-types-Sketch) | Which sketch or sketches should be extruded | Yes | -| `length` | [`number`](/docs/kcl/types/std-types-number) | How far to extrude the given sketches | Yes | -| `symmetric` | [`bool`](/docs/kcl/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the | No | -| `bidirectionalLength` | [`number`](/docs/kcl/types/std-types-number) | If specified, will also extrude in the opposite direction to 'distance' to the specified distance. If 'symmetric' is true, this value is ignored. | No | -| `tagStart` | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | A named tag for the face at the start of the extrusion, i.e. the original sketch | No | -| `tagEnd` | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch | No | +| `sketches` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | Which sketch or sketches should be extruded | Yes | +| `length` | [`number`](/docs/kcl-std/types/std-types-number) | How far to extrude the given sketches | Yes | +| `symmetric` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the | No | +| `bidirectionalLength` | [`number`](/docs/kcl-std/types/std-types-number) | If specified, will also extrude in the opposite direction to 'distance' to the specified distance. If 'symmetric' is true, this value is ignored. | No | +| `tagStart` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the start of the extrusion, i.e. the original sketch | No | +| `tagEnd` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/functions/std-helix.md b/docs/kcl-std/functions/std-helix.md similarity index 99% rename from docs/kcl/functions/std-helix.md rename to docs/kcl-std/functions/std-helix.md index 5b018d334..a220b0209 100644 --- a/docs/kcl/functions/std-helix.md +++ b/docs/kcl-std/functions/std-helix.md @@ -27,15 +27,15 @@ helix( |----------|------|-------------|----------| | `revolutions` | `number(_)` | Number of revolutions. | Yes | | `angleStart` | `number(Angle)` | Start angle. | Yes | -| `ccw` | [`bool`](/docs/kcl/types/std-types-bool) | Is the helix rotation counter clockwise? The default is `false`. | No | +| `ccw` | [`bool`](/docs/kcl-std/types/std-types-bool) | Is the helix rotation counter clockwise? The default is `false`. | No | | `radius` | `number(Length)` | Radius of the helix. | No | -| `axis` | [`Axis3d`](/docs/kcl/types/std-types-Axis3d) or [`Edge`](/docs/kcl/types/std-types-Edge) | Axis to use for the helix. | No | +| `axis` | [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | Axis to use for the helix. | No | | `length` | `number(Length)` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No | -| `cylinder` | [`Solid`](/docs/kcl/types/std-types-Solid) | Cylinder to create the helix on. | No | +| `cylinder` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | Cylinder to create the helix on. | No | ### Returns -[`Helix`](/docs/kcl/types/std-types-Helix) +[`Helix`](/docs/kcl-std/types/std-types-Helix) ### Examples diff --git a/docs/kcl/functions/std-math-abs.md b/docs/kcl-std/functions/std-math-abs.md similarity index 99% rename from docs/kcl/functions/std-math-abs.md rename to docs/kcl-std/functions/std-math-abs.md index 795b87b02..20d88f419 100644 --- a/docs/kcl/functions/std-math-abs.md +++ b/docs/kcl-std/functions/std-math-abs.md @@ -17,11 +17,11 @@ abs(@input: number): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-acos.md b/docs/kcl-std/functions/std-math-acos.md similarity index 100% rename from docs/kcl/functions/std-math-acos.md rename to docs/kcl-std/functions/std-math-acos.md diff --git a/docs/kcl/functions/std-math-asin.md b/docs/kcl-std/functions/std-math-asin.md similarity index 100% rename from docs/kcl/functions/std-math-asin.md rename to docs/kcl-std/functions/std-math-asin.md diff --git a/docs/kcl/functions/std-math-atan.md b/docs/kcl-std/functions/std-math-atan.md similarity index 100% rename from docs/kcl/functions/std-math-atan.md rename to docs/kcl-std/functions/std-math-atan.md diff --git a/docs/kcl/functions/std-math-atan2.md b/docs/kcl-std/functions/std-math-atan2.md similarity index 100% rename from docs/kcl/functions/std-math-atan2.md rename to docs/kcl-std/functions/std-math-atan2.md diff --git a/docs/kcl/functions/std-math-ceil.md b/docs/kcl-std/functions/std-math-ceil.md similarity index 99% rename from docs/kcl/functions/std-math-ceil.md rename to docs/kcl-std/functions/std-math-ceil.md index d5e0612b1..819d74267 100644 --- a/docs/kcl/functions/std-math-ceil.md +++ b/docs/kcl-std/functions/std-math-ceil.md @@ -17,11 +17,11 @@ ceil(@input: number): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-cos.md b/docs/kcl-std/functions/std-math-cos.md similarity index 100% rename from docs/kcl/functions/std-math-cos.md rename to docs/kcl-std/functions/std-math-cos.md diff --git a/docs/kcl/functions/std-math-floor.md b/docs/kcl-std/functions/std-math-floor.md similarity index 99% rename from docs/kcl/functions/std-math-floor.md rename to docs/kcl-std/functions/std-math-floor.md index 6745622ac..11cdaef75 100644 --- a/docs/kcl/functions/std-math-floor.md +++ b/docs/kcl-std/functions/std-math-floor.md @@ -17,11 +17,11 @@ floor(@input: number): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-ln.md b/docs/kcl-std/functions/std-math-ln.md similarity index 99% rename from docs/kcl/functions/std-math-ln.md rename to docs/kcl-std/functions/std-math-ln.md index bf5a20aaa..f86001895 100644 --- a/docs/kcl/functions/std-math-ln.md +++ b/docs/kcl-std/functions/std-math-ln.md @@ -17,11 +17,11 @@ ln(@input: number): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-log.md b/docs/kcl-std/functions/std-math-log.md similarity index 99% rename from docs/kcl/functions/std-math-log.md rename to docs/kcl-std/functions/std-math-log.md index 46c25b1d4..e78b79bdc 100644 --- a/docs/kcl/functions/std-math-log.md +++ b/docs/kcl-std/functions/std-math-log.md @@ -22,12 +22,12 @@ log( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | The number to compute the logarithm of. | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to compute the logarithm of. | Yes | | `base` | `number(_)` | The base of the logarithm. | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-log10.md b/docs/kcl-std/functions/std-math-log10.md similarity index 99% rename from docs/kcl/functions/std-math-log10.md rename to docs/kcl-std/functions/std-math-log10.md index a7be136a2..775f57fe3 100644 --- a/docs/kcl/functions/std-math-log10.md +++ b/docs/kcl-std/functions/std-math-log10.md @@ -17,11 +17,11 @@ log10(@input: number): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-log2.md b/docs/kcl-std/functions/std-math-log2.md similarity index 99% rename from docs/kcl/functions/std-math-log2.md rename to docs/kcl-std/functions/std-math-log2.md index c607e63cf..457fe4155 100644 --- a/docs/kcl/functions/std-math-log2.md +++ b/docs/kcl-std/functions/std-math-log2.md @@ -17,11 +17,11 @@ log2(@input: number): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-max.md b/docs/kcl-std/functions/std-math-max.md similarity index 99% rename from docs/kcl/functions/std-math-max.md rename to docs/kcl-std/functions/std-math-max.md index 891c68ec4..37814d5f2 100644 --- a/docs/kcl/functions/std-math-max.md +++ b/docs/kcl-std/functions/std-math-max.md @@ -17,11 +17,11 @@ max(@input: [number; 1+]): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`[number; 1+]`](/docs/kcl/types/std-types-number) | An array of numbers to compute the maximum of. | Yes | +| `input` | [`[number; 1+]`](/docs/kcl-std/types/std-types-number) | An array of numbers to compute the maximum of. | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-min.md b/docs/kcl-std/functions/std-math-min.md similarity index 99% rename from docs/kcl/functions/std-math-min.md rename to docs/kcl-std/functions/std-math-min.md index 05222ceb0..c5099d28d 100644 --- a/docs/kcl/functions/std-math-min.md +++ b/docs/kcl-std/functions/std-math-min.md @@ -17,11 +17,11 @@ min(@input: [number; 1+]): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`[number; 1+]`](/docs/kcl/types/std-types-number) | An array of numbers to compute the minimum of. | Yes | +| `input` | [`[number; 1+]`](/docs/kcl-std/types/std-types-number) | An array of numbers to compute the minimum of. | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-polar.md b/docs/kcl-std/functions/std-math-polar.md similarity index 99% rename from docs/kcl/functions/std-math-polar.md rename to docs/kcl-std/functions/std-math-polar.md index 190839a08..1a829d02b 100644 --- a/docs/kcl/functions/std-math-polar.md +++ b/docs/kcl-std/functions/std-math-polar.md @@ -26,7 +26,7 @@ polar( ### Returns -[`Point2d`](/docs/kcl/types/std-types-Point2d) +[`Point2d`](/docs/kcl-std/types/std-types-Point2d) ### Examples diff --git a/docs/kcl/functions/std-math-pow.md b/docs/kcl-std/functions/std-math-pow.md similarity index 99% rename from docs/kcl/functions/std-math-pow.md rename to docs/kcl-std/functions/std-math-pow.md index 165fef823..84f074cdc 100644 --- a/docs/kcl/functions/std-math-pow.md +++ b/docs/kcl-std/functions/std-math-pow.md @@ -20,12 +20,12 @@ pow( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | The number to raise. | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to raise. | Yes | | `exp` | `number(_)` | The power to raise to. | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-rem.md b/docs/kcl-std/functions/std-math-rem.md similarity index 99% rename from docs/kcl/functions/std-math-rem.md rename to docs/kcl-std/functions/std-math-rem.md index aa1a5ad2f..8e23a07b9 100644 --- a/docs/kcl/functions/std-math-rem.md +++ b/docs/kcl-std/functions/std-math-rem.md @@ -21,12 +21,12 @@ rem( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `num` | [`number`](/docs/kcl/types/std-types-number) | The number which will be divided by `divisor`. | Yes | -| `divisor` | [`number`](/docs/kcl/types/std-types-number) | The number which will divide `num`. | Yes | +| `num` | [`number`](/docs/kcl-std/types/std-types-number) | The number which will be divided by `divisor`. | Yes | +| `divisor` | [`number`](/docs/kcl-std/types/std-types-number) | The number which will divide `num`. | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-round.md b/docs/kcl-std/functions/std-math-round.md similarity index 99% rename from docs/kcl/functions/std-math-round.md rename to docs/kcl-std/functions/std-math-round.md index 9d643595b..9e408c603 100644 --- a/docs/kcl/functions/std-math-round.md +++ b/docs/kcl-std/functions/std-math-round.md @@ -17,11 +17,11 @@ round(@input: number): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-sin.md b/docs/kcl-std/functions/std-math-sin.md similarity index 100% rename from docs/kcl/functions/std-math-sin.md rename to docs/kcl-std/functions/std-math-sin.md diff --git a/docs/kcl/functions/std-math-sqrt.md b/docs/kcl-std/functions/std-math-sqrt.md similarity index 99% rename from docs/kcl/functions/std-math-sqrt.md rename to docs/kcl-std/functions/std-math-sqrt.md index 945a7689f..b9ecf6d99 100644 --- a/docs/kcl/functions/std-math-sqrt.md +++ b/docs/kcl-std/functions/std-math-sqrt.md @@ -17,11 +17,11 @@ sqrt(@input: number): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `input` | [`number`](/docs/kcl/types/std-types-number) | | Yes | +| `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/functions/std-math-tan.md b/docs/kcl-std/functions/std-math-tan.md similarity index 100% rename from docs/kcl/functions/std-math-tan.md rename to docs/kcl-std/functions/std-math-tan.md diff --git a/docs/kcl/functions/std-offsetPlane.md b/docs/kcl-std/functions/std-offsetPlane.md similarity index 99% rename from docs/kcl/functions/std-offsetPlane.md rename to docs/kcl-std/functions/std-offsetPlane.md index 40b4fda23..a69856edb 100644 --- a/docs/kcl/functions/std-offsetPlane.md +++ b/docs/kcl-std/functions/std-offsetPlane.md @@ -21,12 +21,12 @@ offsetPlane( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `plane` | [`Plane`](/docs/kcl/types/std-types-Plane) | The plane (e.g. `XY`) which this new plane is created from. | Yes | +| `plane` | [`Plane`](/docs/kcl-std/types/std-types-Plane) | The plane (e.g. `XY`) which this new plane is created from. | Yes | | `offset` | `number(Length)` | Distance from the standard plane this new plane will be created at. | Yes | ### Returns -[`Plane`](/docs/kcl/types/std-types-Plane) +[`Plane`](/docs/kcl-std/types/std-types-Plane) ### Examples diff --git a/docs/kcl/functions/std-revolve.md b/docs/kcl-std/functions/std-revolve.md similarity index 99% rename from docs/kcl/functions/std-revolve.md rename to docs/kcl-std/functions/std-revolve.md index 53990f087..195932144 100644 --- a/docs/kcl/functions/std-revolve.md +++ b/docs/kcl-std/functions/std-revolve.md @@ -35,18 +35,18 @@ revolve( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketches` | [`[Sketch; 1+]`](/docs/kcl/types/std-types-Sketch) | The sketch or set of sketches that should be revolved | Yes | -| `axis` | [`Axis2d`](/docs/kcl/types/std-types-Axis2d) or [`Edge`](/docs/kcl/types/std-types-Edge) | Axis of revolution. | Yes | +| `sketches` | [`[Sketch; 1+]`](/docs/kcl-std/types/std-types-Sketch) | The sketch or set of sketches that should be revolved | Yes | +| `axis` | [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | Axis of revolution. | Yes | | `angle` | `number(Angle)` | Angle to revolve (in degrees). Default is 360. | No | | `tolerance` | `number(Length)` | Tolerance for the revolve operation. | No | -| `symmetric` | [`bool`](/docs/kcl/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the extrusion will happen on only one side of the sketch. | No | +| `symmetric` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the extrusion will happen on only one side of the sketch. | No | | `bidirectionalAngle` | `number(Angle)` | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No | -| `tagStart` | [`tag`](/docs/kcl/types/std-types-tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No | -| `tagEnd` | [`tag`](/docs/kcl/types/std-types-tag) | A named tag for the face at the end of the revolve. | No | +| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No | +| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the revolve. | No | ### Returns -[`Solid`](/docs/kcl/types/std-types-Solid) +[`Solid`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/functions/std-sketch-circle.md b/docs/kcl-std/functions/std-sketch-circle.md similarity index 99% rename from docs/kcl/functions/std-sketch-circle.md rename to docs/kcl-std/functions/std-sketch-circle.md index 3b62f4f2f..b78c44bfb 100644 --- a/docs/kcl/functions/std-sketch-circle.md +++ b/docs/kcl-std/functions/std-sketch-circle.md @@ -23,14 +23,14 @@ circle( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch_or_surface` | [`Sketch`](/docs/kcl/types/std-types-Sketch) or [`Plane`](/docs/kcl/types/std-types-Plane) or [`Face`](/docs/kcl/types/std-types-Face) | Sketch to extend, or plane or surface to sketch on. | Yes | -| `center` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | The center of the circle. | Yes | +| `sketch_or_surface` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | Sketch to extend, or plane or surface to sketch on. | Yes | +| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center of the circle. | Yes | | `radius` | `number(Length)` | The radius of the circle. | Yes | -| [`tag`](/docs/kcl/types/std-types-tag) | [`tag`](/docs/kcl/types/std-types-tag) | Create a new tag which refers to this circle. | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this circle. | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/functions/std-sketch-mirror2d.md b/docs/kcl-std/functions/std-sketch-mirror2d.md similarity index 99% rename from docs/kcl/functions/std-sketch-mirror2d.md rename to docs/kcl-std/functions/std-sketch-mirror2d.md index fa4b9e23a..9b466b4eb 100644 --- a/docs/kcl/functions/std-sketch-mirror2d.md +++ b/docs/kcl-std/functions/std-sketch-mirror2d.md @@ -22,12 +22,12 @@ mirror2d( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketches` | [`[Sketch; 1+]`](/docs/kcl/types/std-types-Sketch) | The sketch or sketches to be reflected. | Yes | -| `axis` | [`Axis2d`](/docs/kcl/types/std-types-Axis2d) or [`Edge`](/docs/kcl/types/std-types-Edge) | The axis to reflect around. | Yes | +| `sketches` | [`[Sketch; 1+]`](/docs/kcl-std/types/std-types-Sketch) | The sketch or sketches to be reflected. | Yes | +| `axis` | [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | The axis to reflect around. | Yes | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/functions/std-solid-chamfer.md b/docs/kcl-std/functions/std-solid-chamfer.md similarity index 99% rename from docs/kcl/functions/std-solid-chamfer.md rename to docs/kcl-std/functions/std-solid-chamfer.md index 087d3ae4e..9b8848197 100644 --- a/docs/kcl/functions/std-solid-chamfer.md +++ b/docs/kcl-std/functions/std-solid-chamfer.md @@ -24,14 +24,14 @@ chamfer( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solid` | [`Solid`](/docs/kcl/types/std-types-Solid) | The solid whose edges should be chamfered | Yes | +| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be chamfered | Yes | | `length` | `number(Length)` | The length of the chamfer | Yes | -| `tags` | [`[Edge; 1+]`](/docs/kcl/types/std-types-Edge) | The paths you want to chamfer | Yes | -| [`tag`](/docs/kcl/types/std-types-tag) | [`tag`](/docs/kcl/types/std-types-tag) | Create a new tag which refers to this chamfer | No | +| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to chamfer | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this chamfer | No | ### Returns -[`Solid`](/docs/kcl/types/std-types-Solid) +[`Solid`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/functions/std-solid-fillet.md b/docs/kcl-std/functions/std-solid-fillet.md similarity index 99% rename from docs/kcl/functions/std-solid-fillet.md rename to docs/kcl-std/functions/std-solid-fillet.md index bfa7bb36d..575ceaccd 100644 --- a/docs/kcl/functions/std-solid-fillet.md +++ b/docs/kcl-std/functions/std-solid-fillet.md @@ -25,15 +25,15 @@ fillet( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solid` | [`Solid`](/docs/kcl/types/std-types-Solid) | The solid whose edges should be filletted | Yes | +| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be filletted | Yes | | `radius` | `number(Length)` | The radius of the fillet | Yes | -| `tags` | [`[Edge; 1+]`](/docs/kcl/types/std-types-Edge) | The paths you want to fillet | Yes | +| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to fillet | Yes | | `tolerance` | `number(Length)` | The tolerance for this fillet | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`tag`](/docs/kcl/types/std-types-tag) | Create a new tag which refers to this fillet | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this fillet | No | ### Returns -[`Solid`](/docs/kcl/types/std-types-Solid) +[`Solid`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/functions/std-solid-hollow.md b/docs/kcl-std/functions/std-solid-hollow.md similarity index 99% rename from docs/kcl/functions/std-solid-hollow.md rename to docs/kcl-std/functions/std-solid-hollow.md index bcaba01aa..5cddee3bc 100644 --- a/docs/kcl/functions/std-solid-hollow.md +++ b/docs/kcl-std/functions/std-solid-hollow.md @@ -21,12 +21,12 @@ hollow( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solid` | [`Solid`](/docs/kcl/types/std-types-Solid) | Which solid to hollow out | Yes | +| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | Which solid to hollow out | Yes | | `thickness` | `number(Length)` | The thickness of the remaining shell | Yes | ### Returns -[`Solid`](/docs/kcl/types/std-types-Solid) +[`Solid`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/functions/std-solid-shell.md b/docs/kcl-std/functions/std-solid-shell.md similarity index 99% rename from docs/kcl/functions/std-solid-shell.md rename to docs/kcl-std/functions/std-solid-shell.md index 2f119ced7..cc01f9199 100644 --- a/docs/kcl/functions/std-solid-shell.md +++ b/docs/kcl-std/functions/std-solid-shell.md @@ -22,13 +22,13 @@ shell( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solids` | [`[Solid; 1+]`](/docs/kcl/types/std-types-Solid) | Which solid (or solids) to shell out | Yes | +| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | Which solid (or solids) to shell out | Yes | | `thickness` | `number(Length)` | The thickness of the shell | Yes | -| `faces` | [`[tag; 1+]`](/docs/kcl/types/std-types-tag) | The faces you want removed | Yes | +| `faces` | [`[tag; 1+]`](/docs/kcl-std/types/std-types-tag) | The faces you want removed | Yes | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/functions/std-units-toCentimeters.md b/docs/kcl-std/functions/std-units-toCentimeters.md similarity index 100% rename from docs/kcl/functions/std-units-toCentimeters.md rename to docs/kcl-std/functions/std-units-toCentimeters.md diff --git a/docs/kcl/functions/std-units-toDegrees.md b/docs/kcl-std/functions/std-units-toDegrees.md similarity index 100% rename from docs/kcl/functions/std-units-toDegrees.md rename to docs/kcl-std/functions/std-units-toDegrees.md diff --git a/docs/kcl/functions/std-units-toFeet.md b/docs/kcl-std/functions/std-units-toFeet.md similarity index 100% rename from docs/kcl/functions/std-units-toFeet.md rename to docs/kcl-std/functions/std-units-toFeet.md diff --git a/docs/kcl/functions/std-units-toInches.md b/docs/kcl-std/functions/std-units-toInches.md similarity index 100% rename from docs/kcl/functions/std-units-toInches.md rename to docs/kcl-std/functions/std-units-toInches.md diff --git a/docs/kcl/functions/std-units-toMeters.md b/docs/kcl-std/functions/std-units-toMeters.md similarity index 100% rename from docs/kcl/functions/std-units-toMeters.md rename to docs/kcl-std/functions/std-units-toMeters.md diff --git a/docs/kcl/functions/std-units-toMillimeters.md b/docs/kcl-std/functions/std-units-toMillimeters.md similarity index 100% rename from docs/kcl/functions/std-units-toMillimeters.md rename to docs/kcl-std/functions/std-units-toMillimeters.md diff --git a/docs/kcl/functions/std-units-toRadians.md b/docs/kcl-std/functions/std-units-toRadians.md similarity index 100% rename from docs/kcl/functions/std-units-toRadians.md rename to docs/kcl-std/functions/std-units-toRadians.md diff --git a/docs/kcl/functions/std-units-toYards.md b/docs/kcl-std/functions/std-units-toYards.md similarity index 100% rename from docs/kcl/functions/std-units-toYards.md rename to docs/kcl-std/functions/std-units-toYards.md diff --git a/docs/kcl/getCommonEdge.md b/docs/kcl-std/getCommonEdge.md similarity index 99% rename from docs/kcl/getCommonEdge.md rename to docs/kcl-std/getCommonEdge.md index 32b65ab72..4753b68e3 100644 --- a/docs/kcl/getCommonEdge.md +++ b/docs/kcl-std/getCommonEdge.md @@ -17,7 +17,7 @@ getCommonEdge(faces: [TagIdentifier]): Uuid | Name | Type | Description | Required | |----------|------|-------------|----------| -| `faces` | [`[TagIdentifier]`](/docs/kcl/types#TagIdentifier) | The tags of the faces you want to find the common edge between | Yes | +| `faces` | [`[TagIdentifier]`](/docs/kcl-lang/types#TagIdentifier) | The tags of the faces you want to find the common edge between | Yes | ### Returns diff --git a/docs/kcl/getNextAdjacentEdge.md b/docs/kcl-std/getNextAdjacentEdge.md similarity index 99% rename from docs/kcl/getNextAdjacentEdge.md rename to docs/kcl-std/getNextAdjacentEdge.md index 1619bde57..90c309c09 100644 --- a/docs/kcl/getNextAdjacentEdge.md +++ b/docs/kcl-std/getNextAdjacentEdge.md @@ -17,7 +17,7 @@ getNextAdjacentEdge(edge: TagIdentifier): Uuid | Name | Type | Description | Required | |----------|------|-------------|----------| -| `edge` | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The tag of the edge you want to find the next adjacent edge of. | Yes | +| `edge` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the edge you want to find the next adjacent edge of. | Yes | ### Returns diff --git a/docs/kcl/getOppositeEdge.md b/docs/kcl-std/getOppositeEdge.md similarity index 99% rename from docs/kcl/getOppositeEdge.md rename to docs/kcl-std/getOppositeEdge.md index 430e56cd8..73760bd35 100644 --- a/docs/kcl/getOppositeEdge.md +++ b/docs/kcl-std/getOppositeEdge.md @@ -17,7 +17,7 @@ getOppositeEdge(edge: TagIdentifier): Uuid | Name | Type | Description | Required | |----------|------|-------------|----------| -| `edge` | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The tag of the edge you want to find the opposite edge of. | Yes | +| `edge` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the edge you want to find the opposite edge of. | Yes | ### Returns diff --git a/docs/kcl/getPreviousAdjacentEdge.md b/docs/kcl-std/getPreviousAdjacentEdge.md similarity index 99% rename from docs/kcl/getPreviousAdjacentEdge.md rename to docs/kcl-std/getPreviousAdjacentEdge.md index 75fe03a09..138c39116 100644 --- a/docs/kcl/getPreviousAdjacentEdge.md +++ b/docs/kcl-std/getPreviousAdjacentEdge.md @@ -17,7 +17,7 @@ getPreviousAdjacentEdge(edge: TagIdentifier): Uuid | Name | Type | Description | Required | |----------|------|-------------|----------| -| `edge` | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The tag of the edge you want to find the previous adjacent edge of. | Yes | +| `edge` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the edge you want to find the previous adjacent edge of. | Yes | ### Returns diff --git a/docs/kcl-std/index.md b/docs/kcl-std/index.md new file mode 100644 index 000000000..21a380f58 --- /dev/null +++ b/docs/kcl-std/index.md @@ -0,0 +1,160 @@ +--- +title: "KCL Standard Library" +excerpt: "Documentation for the KCL standard library for the Zoo Design Studio." +layout: manual +--- + +## Table of Contents + +### Functions + +* [**std**](/docs/kcl-std/modules/std) + * [`angledLine`](/docs/kcl-std/angledLine) + * [`angledLineThatIntersects`](/docs/kcl-std/angledLineThatIntersects) + * [`appearance`](/docs/kcl-std/appearance) + * [`arc`](/docs/kcl-std/arc) + * [`assert`](/docs/kcl-std/assert) + * [`assertIs`](/docs/kcl-std/assertIs) + * [`bezierCurve`](/docs/kcl-std/bezierCurve) + * [`circleThreePoint`](/docs/kcl-std/circleThreePoint) + * [`clone`](/docs/kcl-std/clone) + * [`close`](/docs/kcl-std/close) + * [`extrude`](/docs/kcl-std/extrude) + * [`getCommonEdge`](/docs/kcl-std/getCommonEdge) + * [`getNextAdjacentEdge`](/docs/kcl-std/getNextAdjacentEdge) + * [`getOppositeEdge`](/docs/kcl-std/getOppositeEdge) + * [`getPreviousAdjacentEdge`](/docs/kcl-std/getPreviousAdjacentEdge) + * [`helix`](/docs/kcl-std/functions/std-helix) + * [`intersect`](/docs/kcl-std/intersect) + * [`involuteCircular`](/docs/kcl-std/involuteCircular) + * [`lastSegX`](/docs/kcl-std/lastSegX) + * [`lastSegY`](/docs/kcl-std/lastSegY) + * [`legAngX`](/docs/kcl-std/legAngX) + * [`legAngY`](/docs/kcl-std/legAngY) + * [`legLen`](/docs/kcl-std/legLen) + * [`line`](/docs/kcl-std/line) + * [`loft`](/docs/kcl-std/loft) + * [`map`](/docs/kcl-std/map) + * [`offsetPlane`](/docs/kcl-std/functions/std-offsetPlane) + * [`patternCircular2d`](/docs/kcl-std/patternCircular2d) + * [`patternCircular3d`](/docs/kcl-std/patternCircular3d) + * [`patternLinear2d`](/docs/kcl-std/patternLinear2d) + * [`patternLinear3d`](/docs/kcl-std/patternLinear3d) + * [`patternTransform`](/docs/kcl-std/patternTransform) + * [`patternTransform2d`](/docs/kcl-std/patternTransform2d) + * [`polygon`](/docs/kcl-std/polygon) + * [`pop`](/docs/kcl-std/pop) + * [`profileStart`](/docs/kcl-std/profileStart) + * [`profileStartX`](/docs/kcl-std/profileStartX) + * [`profileStartY`](/docs/kcl-std/profileStartY) + * [`push`](/docs/kcl-std/push) + * [`reduce`](/docs/kcl-std/reduce) + * [`revolve`](/docs/kcl-std/functions/std-revolve) + * [`rotate`](/docs/kcl-std/rotate) + * [`scale`](/docs/kcl-std/scale) + * [`segAng`](/docs/kcl-std/segAng) + * [`segEnd`](/docs/kcl-std/segEnd) + * [`segEndX`](/docs/kcl-std/segEndX) + * [`segEndY`](/docs/kcl-std/segEndY) + * [`segLen`](/docs/kcl-std/segLen) + * [`segStart`](/docs/kcl-std/segStart) + * [`segStartX`](/docs/kcl-std/segStartX) + * [`segStartY`](/docs/kcl-std/segStartY) + * [`startProfile`](/docs/kcl-std/startProfile) + * [`startSketchOn`](/docs/kcl-std/startSketchOn) + * [`subtract`](/docs/kcl-std/subtract) + * [`subtract2d`](/docs/kcl-std/subtract2d) + * [`sweep`](/docs/kcl-std/sweep) + * [`tangentToEnd`](/docs/kcl-std/tangentToEnd) + * [`tangentialArc`](/docs/kcl-std/tangentialArc) + * [`translate`](/docs/kcl-std/translate) + * [`union`](/docs/kcl-std/union) + * [`xLine`](/docs/kcl-std/xLine) + * [`yLine`](/docs/kcl-std/yLine) +* [**std::math**](/docs/kcl-std/modules/std-math) + * [`abs`](/docs/kcl-std/functions/std-math-abs) + * [`acos`](/docs/kcl-std/functions/std-math-acos) + * [`asin`](/docs/kcl-std/functions/std-math-asin) + * [`atan`](/docs/kcl-std/functions/std-math-atan) + * [`atan2`](/docs/kcl-std/functions/std-math-atan2) + * [`ceil`](/docs/kcl-std/functions/std-math-ceil) + * [`cos`](/docs/kcl-std/functions/std-math-cos) + * [`floor`](/docs/kcl-std/functions/std-math-floor) + * [`ln`](/docs/kcl-std/functions/std-math-ln) + * [`log`](/docs/kcl-std/functions/std-math-log) + * [`log10`](/docs/kcl-std/functions/std-math-log10) + * [`log2`](/docs/kcl-std/functions/std-math-log2) + * [`max`](/docs/kcl-std/functions/std-math-max) + * [`min`](/docs/kcl-std/functions/std-math-min) + * [`polar`](/docs/kcl-std/functions/std-math-polar) + * [`pow`](/docs/kcl-std/functions/std-math-pow) + * [`rem`](/docs/kcl-std/functions/std-math-rem) + * [`round`](/docs/kcl-std/functions/std-math-round) + * [`sin`](/docs/kcl-std/functions/std-math-sin) + * [`sqrt`](/docs/kcl-std/functions/std-math-sqrt) + * [`tan`](/docs/kcl-std/functions/std-math-tan) +* [**std::sketch**](/docs/kcl-std/modules/std-sketch) + * [`circle`](/docs/kcl-std/functions/std-sketch-circle) + * [`mirror2d`](/docs/kcl-std/functions/std-sketch-mirror2d) +* [**std::solid**](/docs/kcl-std/modules/std-solid) + * [`chamfer`](/docs/kcl-std/functions/std-solid-chamfer) + * [`fillet`](/docs/kcl-std/functions/std-solid-fillet) + * [`hollow`](/docs/kcl-std/functions/std-solid-hollow) + * [`shell`](/docs/kcl-std/functions/std-solid-shell) +* [**std::units**](/docs/kcl-std/modules/std-units) + * [`units::toCentimeters`](/docs/kcl-std/functions/std-units-toCentimeters) + * [`units::toDegrees`](/docs/kcl-std/functions/std-units-toDegrees) + * [`units::toFeet`](/docs/kcl-std/functions/std-units-toFeet) + * [`units::toInches`](/docs/kcl-std/functions/std-units-toInches) + * [`units::toMeters`](/docs/kcl-std/functions/std-units-toMeters) + * [`units::toMillimeters`](/docs/kcl-std/functions/std-units-toMillimeters) + * [`units::toRadians`](/docs/kcl-std/functions/std-units-toRadians) + * [`units::toYards`](/docs/kcl-std/functions/std-units-toYards) + +### Constants + +* [**std**](/docs/kcl-std/modules/std) + * [`END`](/docs/kcl-std/consts/std-END) + * [`START`](/docs/kcl-std/consts/std-START) + * [`X`](/docs/kcl-std/consts/std-X) + * [`XY`](/docs/kcl-std/consts/std-XY) + * [`XZ`](/docs/kcl-std/consts/std-XZ) + * [`Y`](/docs/kcl-std/consts/std-Y) + * [`YZ`](/docs/kcl-std/consts/std-YZ) + * [`Z`](/docs/kcl-std/consts/std-Z) +* [**std::math**](/docs/kcl-std/modules/std-math) + * [`E`](/docs/kcl-std/consts/std-math-E) + * [`PI`](/docs/kcl-std/consts/std-math-PI) + * [`TAU`](/docs/kcl-std/consts/std-math-TAU) +* [**std::turns**](/docs/kcl-std/modules/std-turns) + * [`turns::HALF_TURN`](/docs/kcl-std/consts/std-turns-HALF_TURN) + * [`turns::QUARTER_TURN`](/docs/kcl-std/consts/std-turns-QUARTER_TURN) + * [`turns::THREE_QUARTER_TURN`](/docs/kcl-std/consts/std-turns-THREE_QUARTER_TURN) + * [`turns::ZERO`](/docs/kcl-std/consts/std-turns-ZERO) + +### Types + +See also the [types overview](/docs/kcl-lang/types) + +* [**Primitive types**](/docs/kcl-std/modules/Primitive types) + * [`End`](/docs/kcl-std/types#End) + * [`ImportedGeometry`](/docs/kcl-std/types#ImportedGeometry) + * [`Start`](/docs/kcl-std/types#Start) + * [`TagDeclarator`](/docs/kcl-std/types#TagDeclarator) + * [`TagIdentifier`](/docs/kcl-std/types#TagIdentifier) + * [`any`](/docs/kcl-std/types/std-types-any) + * [`bool`](/docs/kcl-std/types/std-types-bool) + * [`number`](/docs/kcl-std/types/std-types-number) + * [`string`](/docs/kcl-std/types/std-types-string) + * [`tag`](/docs/kcl-std/types/std-types-tag) +* [**std::types**](/docs/kcl-std/modules/std-types) + * [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) + * [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) + * [`Edge`](/docs/kcl-std/types/std-types-Edge) + * [`Face`](/docs/kcl-std/types/std-types-Face) + * [`Helix`](/docs/kcl-std/types/std-types-Helix) + * [`Plane`](/docs/kcl-std/types/std-types-Plane) + * [`Point2d`](/docs/kcl-std/types/std-types-Point2d) + * [`Point3d`](/docs/kcl-std/types/std-types-Point3d) + * [`Sketch`](/docs/kcl-std/types/std-types-Sketch) + * [`Solid`](/docs/kcl-std/types/std-types-Solid) diff --git a/docs/kcl/intersect.md b/docs/kcl-std/intersect.md similarity index 99% rename from docs/kcl/intersect.md rename to docs/kcl-std/intersect.md index 22da99281..8ecb590dc 100644 --- a/docs/kcl/intersect.md +++ b/docs/kcl-std/intersect.md @@ -20,12 +20,12 @@ intersect( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solids` | [`[Solid]`](/docs/kcl/types/std-types-Solid) | The solids to intersect. | Yes | -| `tolerance` | [`number`](/docs/kcl/types/std-types-number) | The tolerance to use for the intersection operation. | No | +| `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to intersect. | Yes | +| `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the intersection operation. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/involuteCircular.md b/docs/kcl-std/involuteCircular.md similarity index 97% rename from docs/kcl/involuteCircular.md rename to docs/kcl-std/involuteCircular.md index cd0c1a27e..c65cf390c 100644 --- a/docs/kcl/involuteCircular.md +++ b/docs/kcl-std/involuteCircular.md @@ -24,16 +24,16 @@ involuteCircular( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `startRadius` | [`number`](/docs/kcl/types/std-types-number) | The involute is described between two circles, start_radius is the radius of the inner circle. | Yes | -| `endRadius` | [`number`](/docs/kcl/types/std-types-number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes | -| `angle` | [`number`](/docs/kcl/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes | -| `reverse` | [`bool`](/docs/kcl/types/std-types-bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. Defaults to false. | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `startRadius` | [`number`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, start_radius is the radius of the inner circle. | Yes | +| `endRadius` | [`number`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes | +| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes | +| `reverse` | [`bool`](/docs/kcl-std/types/std-types-bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. Defaults to false. | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/lastSegX.md b/docs/kcl-std/lastSegX.md similarity index 99% rename from docs/kcl/lastSegX.md rename to docs/kcl-std/lastSegX.md index db5c4a4b4..312250245 100644 --- a/docs/kcl/lastSegX.md +++ b/docs/kcl-std/lastSegX.md @@ -17,11 +17,11 @@ lastSegX(sketch: Sketch): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | The sketch whose line segment is being queried | Yes | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch whose line segment is being queried | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/lastSegY.md b/docs/kcl-std/lastSegY.md similarity index 99% rename from docs/kcl/lastSegY.md rename to docs/kcl-std/lastSegY.md index 638df839d..199fbca38 100644 --- a/docs/kcl/lastSegY.md +++ b/docs/kcl-std/lastSegY.md @@ -17,11 +17,11 @@ lastSegY(sketch: Sketch): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | The sketch whose line segment is being queried | Yes | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch whose line segment is being queried | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/legAngX.md b/docs/kcl-std/legAngX.md similarity index 57% rename from docs/kcl/legAngX.md rename to docs/kcl-std/legAngX.md index b0134682e..741dc9b2c 100644 --- a/docs/kcl/legAngX.md +++ b/docs/kcl-std/legAngX.md @@ -24,12 +24,12 @@ legAngX( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `hypotenuse` | [`number`](/docs/kcl/types/std-types-number) | The length of the triangle's hypotenuse | Yes | -| `leg` | [`number`](/docs/kcl/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes | +| `hypotenuse` | [`number`](/docs/kcl-std/types/std-types-number) | The length of the triangle's hypotenuse | Yes | +| `leg` | [`number`](/docs/kcl-std/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/legAngY.md b/docs/kcl-std/legAngY.md similarity index 57% rename from docs/kcl/legAngY.md rename to docs/kcl-std/legAngY.md index 7ecd6ea3b..c0db0f711 100644 --- a/docs/kcl/legAngY.md +++ b/docs/kcl-std/legAngY.md @@ -24,12 +24,12 @@ legAngY( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `hypotenuse` | [`number`](/docs/kcl/types/std-types-number) | The length of the triangle's hypotenuse | Yes | -| `leg` | [`number`](/docs/kcl/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes | +| `hypotenuse` | [`number`](/docs/kcl-std/types/std-types-number) | The length of the triangle's hypotenuse | Yes | +| `leg` | [`number`](/docs/kcl-std/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/legLen.md b/docs/kcl-std/legLen.md similarity index 56% rename from docs/kcl/legLen.md rename to docs/kcl-std/legLen.md index 9fc976ef7..dd557b1d8 100644 --- a/docs/kcl/legLen.md +++ b/docs/kcl-std/legLen.md @@ -24,12 +24,12 @@ legLen( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `hypotenuse` | [`number`](/docs/kcl/types/std-types-number) | The length of the triangle's hypotenuse | Yes | -| `leg` | [`number`](/docs/kcl/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes | +| `hypotenuse` | [`number`](/docs/kcl-std/types/std-types-number) | The length of the triangle's hypotenuse | Yes | +| `leg` | [`number`](/docs/kcl-std/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/line.md b/docs/kcl-std/line.md similarity index 99% rename from docs/kcl/line.md rename to docs/kcl-std/line.md index 768f50940..13a8ca1f1 100644 --- a/docs/kcl/line.md +++ b/docs/kcl-std/line.md @@ -22,14 +22,14 @@ line( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `endAbsolute` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | Which absolute point should this line go to? Incompatible with `end`. | No | -| `end` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Which absolute point should this line go to? Incompatible with `end`. | No | +| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/loft.md b/docs/kcl-std/loft.md similarity index 99% rename from docs/kcl/loft.md rename to docs/kcl-std/loft.md index 5e9619237..00daae40d 100644 --- a/docs/kcl/loft.md +++ b/docs/kcl-std/loft.md @@ -25,17 +25,17 @@ loft( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketches` | [`[Sketch]`](/docs/kcl/types/std-types-Sketch) | Which sketches to loft. Must include at least 2 sketches. | Yes | -| `vDegree` | [`number`](/docs/kcl/types/std-types-number) | Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. | Yes | -| `bezApproximateRational` | [`bool`](/docs/kcl/types/std-types-bool) | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. | Yes | -| `baseCurveIndex` | [`number`](/docs/kcl/types/std-types-number) | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No | -| `tolerance` | [`number`](/docs/kcl/types/std-types-number) | Tolerance for the loft operation. | No | -| `tagStart` | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | A named tag for the face at the start of the loft, i.e. the original sketch | No | -| `tagEnd` | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | A named tag for the face at the end of the loft, i.e. the last sketch | No | +| `sketches` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | Which sketches to loft. Must include at least 2 sketches. | Yes | +| `vDegree` | [`number`](/docs/kcl-std/types/std-types-number) | Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. | Yes | +| `bezApproximateRational` | [`bool`](/docs/kcl-std/types/std-types-bool) | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. | Yes | +| `baseCurveIndex` | [`number`](/docs/kcl-std/types/std-types-number) | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No | +| `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | Tolerance for the loft operation. | No | +| `tagStart` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the start of the loft, i.e. the original sketch | No | +| `tagEnd` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the end of the loft, i.e. the last sketch | No | ### Returns -[`Solid`](/docs/kcl/types/std-types-Solid) +[`Solid`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/map.md b/docs/kcl-std/map.md similarity index 99% rename from docs/kcl/map.md rename to docs/kcl-std/map.md index 490420335..49237bf9f 100644 --- a/docs/kcl/map.md +++ b/docs/kcl-std/map.md @@ -20,12 +20,12 @@ map( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `array` | [`[any]`](/docs/kcl/types/std-types-any) | Input array. The output array is this input array, but every element has had the function `f` run on it. | Yes | +| `array` | [`[any]`](/docs/kcl-std/types/std-types-any) | Input array. The output array is this input array, but every element has had the function `f` run on it. | Yes | | `f` | `FunctionSource` | A function. The output array is just the input array, but `f` has been run on every item. | Yes | ### Returns -[`[any]`](/docs/kcl/types/std-types-any) +[`[any]`](/docs/kcl-std/types/std-types-any) ### Examples diff --git a/docs/kcl-std/modules/std-math.md b/docs/kcl-std/modules/std-math.md new file mode 100644 index 000000000..dd9f65773 --- /dev/null +++ b/docs/kcl-std/modules/std-math.md @@ -0,0 +1,38 @@ +--- +title: "std::math" +excerpt: "" +layout: manual +--- + + + + + + +## Functions and constants + +* [`E`](/docs/kcl-std/consts/std-math-E) +* [`PI`](/docs/kcl-std/consts/std-math-PI) +* [`TAU`](/docs/kcl-std/consts/std-math-TAU) +* [`abs`](/docs/kcl-std/functions/std-math-abs) +* [`acos`](/docs/kcl-std/functions/std-math-acos) +* [`asin`](/docs/kcl-std/functions/std-math-asin) +* [`atan`](/docs/kcl-std/functions/std-math-atan) +* [`atan2`](/docs/kcl-std/functions/std-math-atan2) +* [`ceil`](/docs/kcl-std/functions/std-math-ceil) +* [`cos`](/docs/kcl-std/functions/std-math-cos) +* [`floor`](/docs/kcl-std/functions/std-math-floor) +* [`ln`](/docs/kcl-std/functions/std-math-ln) +* [`log`](/docs/kcl-std/functions/std-math-log) +* [`log10`](/docs/kcl-std/functions/std-math-log10) +* [`log2`](/docs/kcl-std/functions/std-math-log2) +* [`max`](/docs/kcl-std/functions/std-math-max) +* [`min`](/docs/kcl-std/functions/std-math-min) +* [`polar`](/docs/kcl-std/functions/std-math-polar) +* [`pow`](/docs/kcl-std/functions/std-math-pow) +* [`rem`](/docs/kcl-std/functions/std-math-rem) +* [`round`](/docs/kcl-std/functions/std-math-round) +* [`sin`](/docs/kcl-std/functions/std-math-sin) +* [`sqrt`](/docs/kcl-std/functions/std-math-sqrt) +* [`tan`](/docs/kcl-std/functions/std-math-tan) + diff --git a/docs/kcl-std/modules/std-sketch.md b/docs/kcl-std/modules/std-sketch.md new file mode 100644 index 000000000..5c9e15218 --- /dev/null +++ b/docs/kcl-std/modules/std-sketch.md @@ -0,0 +1,16 @@ +--- +title: "std::sketch" +excerpt: "" +layout: manual +--- + + + + + + +## Functions and constants + +* [`circle`](/docs/kcl-std/functions/std-sketch-circle) +* [`mirror2d`](/docs/kcl-std/functions/std-sketch-mirror2d) + diff --git a/docs/kcl-std/modules/std-solid.md b/docs/kcl-std/modules/std-solid.md new file mode 100644 index 000000000..2008db8d2 --- /dev/null +++ b/docs/kcl-std/modules/std-solid.md @@ -0,0 +1,18 @@ +--- +title: "std::solid" +excerpt: "" +layout: manual +--- + + + + + + +## Functions and constants + +* [`chamfer`](/docs/kcl-std/functions/std-solid-chamfer) +* [`fillet`](/docs/kcl-std/functions/std-solid-fillet) +* [`hollow`](/docs/kcl-std/functions/std-solid-hollow) +* [`shell`](/docs/kcl-std/functions/std-solid-shell) + diff --git a/docs/kcl-std/modules/std-turns.md b/docs/kcl-std/modules/std-turns.md new file mode 100644 index 000000000..b3fe27d53 --- /dev/null +++ b/docs/kcl-std/modules/std-turns.md @@ -0,0 +1,18 @@ +--- +title: "std::turns" +excerpt: "" +layout: manual +--- + + + + + + +## Functions and constants + +* [`turns::HALF_TURN`](/docs/kcl-std/consts/std-turns-HALF_TURN) +* [`turns::QUARTER_TURN`](/docs/kcl-std/consts/std-turns-QUARTER_TURN) +* [`turns::THREE_QUARTER_TURN`](/docs/kcl-std/consts/std-turns-THREE_QUARTER_TURN) +* [`turns::ZERO`](/docs/kcl-std/consts/std-turns-ZERO) + diff --git a/docs/kcl-std/modules/std-types.md b/docs/kcl-std/modules/std-types.md new file mode 100644 index 000000000..b57d33e0a --- /dev/null +++ b/docs/kcl-std/modules/std-types.md @@ -0,0 +1,29 @@ +--- +title: "std::types" +excerpt: "" +layout: manual +--- + + + + + + + +## Types + +* [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) +* [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) +* [`Edge`](/docs/kcl-std/types/std-types-Edge) +* [`Face`](/docs/kcl-std/types/std-types-Face) +* [`Helix`](/docs/kcl-std/types/std-types-Helix) +* [`Plane`](/docs/kcl-std/types/std-types-Plane) +* [`Point2d`](/docs/kcl-std/types/std-types-Point2d) +* [`Point3d`](/docs/kcl-std/types/std-types-Point3d) +* [`Sketch`](/docs/kcl-std/types/std-types-Sketch) +* [`Solid`](/docs/kcl-std/types/std-types-Solid) +* [`any`](/docs/kcl-std/types/std-types-any) +* [`bool`](/docs/kcl-std/types/std-types-bool) +* [`number`](/docs/kcl-std/types/std-types-number) +* [`string`](/docs/kcl-std/types/std-types-string) +* [`tag`](/docs/kcl-std/types/std-types-tag) diff --git a/docs/kcl-std/modules/std-units.md b/docs/kcl-std/modules/std-units.md new file mode 100644 index 000000000..68a5f3647 --- /dev/null +++ b/docs/kcl-std/modules/std-units.md @@ -0,0 +1,22 @@ +--- +title: "std::units" +excerpt: "Functions for converting numbers to different units. " +layout: manual +--- + +Functions for converting numbers to different units. + + + + +## Functions and constants + +* [`units::toCentimeters`](/docs/kcl-std/functions/std-units-toCentimeters) +* [`units::toDegrees`](/docs/kcl-std/functions/std-units-toDegrees) +* [`units::toFeet`](/docs/kcl-std/functions/std-units-toFeet) +* [`units::toInches`](/docs/kcl-std/functions/std-units-toInches) +* [`units::toMeters`](/docs/kcl-std/functions/std-units-toMeters) +* [`units::toMillimeters`](/docs/kcl-std/functions/std-units-toMillimeters) +* [`units::toRadians`](/docs/kcl-std/functions/std-units-toRadians) +* [`units::toYards`](/docs/kcl-std/functions/std-units-toYards) + diff --git a/docs/kcl-std/modules/std.md b/docs/kcl-std/modules/std.md new file mode 100644 index 000000000..8dc98ffc3 --- /dev/null +++ b/docs/kcl-std/modules/std.md @@ -0,0 +1,33 @@ +--- +title: "std" +excerpt: "The KCL standard library " +layout: manual +--- + +The KCL standard library + +Contains frequently used constants, functions for interacting with the KittyCAD servers to create sketches and geometry, and utility functions. + +## Modules + +* [`math`](/docs/kcl-std/modules/std-math) +* [`sketch`](/docs/kcl-std/modules/std-sketch) +* [`solid`](/docs/kcl-std/modules/std-solid) +* [`turns::turns`](/docs/kcl-std/modules/std-turns) +* [`types`](/docs/kcl-std/modules/std-types) +* [`units::units`](/docs/kcl-std/modules/std-units) + +## Functions and constants + +* [`END`](/docs/kcl-std/consts/std-END) +* [`START`](/docs/kcl-std/consts/std-START) +* [`X`](/docs/kcl-std/consts/std-X) +* [`XY`](/docs/kcl-std/consts/std-XY) +* [`XZ`](/docs/kcl-std/consts/std-XZ) +* [`Y`](/docs/kcl-std/consts/std-Y) +* [`YZ`](/docs/kcl-std/consts/std-YZ) +* [`Z`](/docs/kcl-std/consts/std-Z) +* [`helix`](/docs/kcl-std/functions/std-helix) +* [`offsetPlane`](/docs/kcl-std/functions/std-offsetPlane) +* [`revolve`](/docs/kcl-std/functions/std-revolve) + diff --git a/docs/kcl/patternCircular2d.md b/docs/kcl-std/patternCircular2d.md similarity index 98% rename from docs/kcl/patternCircular2d.md rename to docs/kcl-std/patternCircular2d.md index 00eaf2ea3..fdcf0b882 100644 --- a/docs/kcl/patternCircular2d.md +++ b/docs/kcl-std/patternCircular2d.md @@ -24,16 +24,16 @@ patternCircular2d( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketchSet` | [`[Sketch]`](/docs/kcl/types/std-types-Sketch) | Which sketch(es) to pattern | Yes | -| `instances` | [`number`](/docs/kcl/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | -| `center` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | The center about which to make the pattern. This is a 2D vector. | Yes | -| `arcDegrees` | [`number`](/docs/kcl/types/std-types-number) | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes | -| `rotateDuplicates` | [`bool`](/docs/kcl/types/std-types-bool) | Whether or not to rotate the duplicates as they are copied. | Yes | -| `useOriginal` | [`bool`](/docs/kcl/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | +| `sketchSet` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | Which sketch(es) to pattern | Yes | +| `instances` | [`number`](/docs/kcl-std/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | +| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center about which to make the pattern. This is a 2D vector. | Yes | +| `arcDegrees` | [`number`](/docs/kcl-std/types/std-types-number) | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes | +| `rotateDuplicates` | [`bool`](/docs/kcl-std/types/std-types-bool) | Whether or not to rotate the duplicates as they are copied. | Yes | +| `useOriginal` | [`bool`](/docs/kcl-std/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | ### Returns -[`[Sketch]`](/docs/kcl/types/std-types-Sketch) +[`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/patternCircular3d.md b/docs/kcl-std/patternCircular3d.md similarity index 99% rename from docs/kcl/patternCircular3d.md rename to docs/kcl-std/patternCircular3d.md index 0276595e7..d2d47153a 100644 --- a/docs/kcl/patternCircular3d.md +++ b/docs/kcl-std/patternCircular3d.md @@ -25,17 +25,17 @@ patternCircular3d( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solids` | [`[Solid]`](/docs/kcl/types/std-types-Solid) | Which solid(s) to pattern | Yes | -| `instances` | [`number`](/docs/kcl/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | -| `axis` | [`[number]`](/docs/kcl/types/std-types-number) | The axis around which to make the pattern. This is a 3D vector | Yes | -| `center` | [`Point3d`](/docs/kcl/types/std-types-Point3d) | The center about which to make the pattern. This is a 3D vector. | Yes | -| `arcDegrees` | [`number`](/docs/kcl/types/std-types-number) | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes | -| `rotateDuplicates` | [`bool`](/docs/kcl/types/std-types-bool) | Whether or not to rotate the duplicates as they are copied. | Yes | -| `useOriginal` | [`bool`](/docs/kcl/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | +| `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | Which solid(s) to pattern | Yes | +| `instances` | [`number`](/docs/kcl-std/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | +| `axis` | [`[number]`](/docs/kcl-std/types/std-types-number) | The axis around which to make the pattern. This is a 3D vector | Yes | +| `center` | [`Point3d`](/docs/kcl-std/types/std-types-Point3d) | The center about which to make the pattern. This is a 3D vector. | Yes | +| `arcDegrees` | [`number`](/docs/kcl-std/types/std-types-number) | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes | +| `rotateDuplicates` | [`bool`](/docs/kcl-std/types/std-types-bool) | Whether or not to rotate the duplicates as they are copied. | Yes | +| `useOriginal` | [`bool`](/docs/kcl-std/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/patternLinear2d.md b/docs/kcl-std/patternLinear2d.md similarity index 98% rename from docs/kcl/patternLinear2d.md rename to docs/kcl-std/patternLinear2d.md index 5a8916700..3672d84cc 100644 --- a/docs/kcl/patternLinear2d.md +++ b/docs/kcl-std/patternLinear2d.md @@ -23,15 +23,15 @@ patternLinear2d( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketches` | [`[Sketch]`](/docs/kcl/types/std-types-Sketch) | The sketch(es) to duplicate | Yes | -| `instances` | [`number`](/docs/kcl/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | -| `distance` | [`number`](/docs/kcl/types/std-types-number) | Distance between each repetition. Also known as 'spacing'. | Yes | -| `axis` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | The axis of the pattern. A 2D vector. | Yes | -| `useOriginal` | [`bool`](/docs/kcl/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | +| `sketches` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | The sketch(es) to duplicate | Yes | +| `instances` | [`number`](/docs/kcl-std/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | +| `distance` | [`number`](/docs/kcl-std/types/std-types-number) | Distance between each repetition. Also known as 'spacing'. | Yes | +| `axis` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The axis of the pattern. A 2D vector. | Yes | +| `useOriginal` | [`bool`](/docs/kcl-std/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | ### Returns -[`[Sketch]`](/docs/kcl/types/std-types-Sketch) +[`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/patternLinear3d.md b/docs/kcl-std/patternLinear3d.md similarity index 99% rename from docs/kcl/patternLinear3d.md rename to docs/kcl-std/patternLinear3d.md index 6aca53d0f..a1a059f02 100644 --- a/docs/kcl/patternLinear3d.md +++ b/docs/kcl-std/patternLinear3d.md @@ -23,15 +23,15 @@ patternLinear3d( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solids` | [`[Solid]`](/docs/kcl/types/std-types-Solid) | The solid(s) to duplicate | Yes | -| `instances` | [`number`](/docs/kcl/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | -| `distance` | [`number`](/docs/kcl/types/std-types-number) | Distance between each repetition. Also known as 'spacing'. | Yes | -| `axis` | [`Point3d`](/docs/kcl/types/std-types-Point3d) | The axis of the pattern. A 2D vector. | Yes | -| `useOriginal` | [`bool`](/docs/kcl/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | +| `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solid(s) to duplicate | Yes | +| `instances` | [`number`](/docs/kcl-std/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | +| `distance` | [`number`](/docs/kcl-std/types/std-types-number) | Distance between each repetition. Also known as 'spacing'. | Yes | +| `axis` | [`Point3d`](/docs/kcl-std/types/std-types-Point3d) | The axis of the pattern. A 2D vector. | Yes | +| `useOriginal` | [`bool`](/docs/kcl-std/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/patternTransform.md b/docs/kcl-std/patternTransform.md similarity index 99% rename from docs/kcl/patternTransform.md rename to docs/kcl-std/patternTransform.md index 7702b50a7..b2e76913c 100644 --- a/docs/kcl/patternTransform.md +++ b/docs/kcl-std/patternTransform.md @@ -48,14 +48,14 @@ patternTransform( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solids` | [`[Solid]`](/docs/kcl/types/std-types-Solid) | The solid(s) to duplicate | Yes | -| `instances` | [`number`](/docs/kcl/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | +| `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solid(s) to duplicate | Yes | +| `instances` | [`number`](/docs/kcl-std/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | | `transform` | `FunctionSource` | How each replica should be transformed. The transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples. | Yes | -| `useOriginal` | [`bool`](/docs/kcl/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | +| `useOriginal` | [`bool`](/docs/kcl-std/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/patternTransform2d.md b/docs/kcl-std/patternTransform2d.md similarity index 98% rename from docs/kcl/patternTransform2d.md rename to docs/kcl-std/patternTransform2d.md index 87e03a22d..092bc1580 100644 --- a/docs/kcl/patternTransform2d.md +++ b/docs/kcl-std/patternTransform2d.md @@ -22,14 +22,14 @@ patternTransform2d( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketches` | [`[Sketch]`](/docs/kcl/types/std-types-Sketch) | The sketch(es) to duplicate | Yes | -| `instances` | [`number`](/docs/kcl/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | +| `sketches` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | The sketch(es) to duplicate | Yes | +| `instances` | [`number`](/docs/kcl-std/types/std-types-number) | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes | | `transform` | `FunctionSource` | How each replica should be transformed. The transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples. | Yes | -| `useOriginal` | [`bool`](/docs/kcl/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | +| `useOriginal` | [`bool`](/docs/kcl-std/types/std-types-bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No | ### Returns -[`[Sketch]`](/docs/kcl/types/std-types-Sketch) +[`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/polygon.md b/docs/kcl-std/polygon.md similarity index 99% rename from docs/kcl/polygon.md rename to docs/kcl-std/polygon.md index c2fd2d04a..da50db5a2 100644 --- a/docs/kcl/polygon.md +++ b/docs/kcl-std/polygon.md @@ -23,15 +23,15 @@ polygon( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketchSurfaceOrGroup` | [`Sketch`](/docs/kcl/types/std-types-Sketch) or [`Plane`](/docs/kcl/types/std-types-Plane) or [`Face`](/docs/kcl/types/std-types-Face) | Plane or surface to sketch on | Yes | -| `radius` | [`number`](/docs/kcl/types/std-types-number) | The radius of the polygon | Yes | +| `sketchSurfaceOrGroup` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | Plane or surface to sketch on | Yes | +| `radius` | [`number`](/docs/kcl-std/types/std-types-number) | The radius of the polygon | Yes | | `numSides` | `u64` | The number of sides in the polygon | Yes | -| `center` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | The center point of the polygon | Yes | -| `inscribed` | [`bool`](/docs/kcl/types/std-types-bool) | Whether the polygon is inscribed (true, the default) or circumscribed (false) about a circle with the specified radius | No | +| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center point of the polygon | Yes | +| `inscribed` | [`bool`](/docs/kcl-std/types/std-types-bool) | Whether the polygon is inscribed (true, the default) or circumscribed (false) about a circle with the specified radius | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/pop.md b/docs/kcl-std/pop.md similarity index 99% rename from docs/kcl/pop.md rename to docs/kcl-std/pop.md index 184bf1d39..02948d300 100644 --- a/docs/kcl/pop.md +++ b/docs/kcl-std/pop.md @@ -17,11 +17,11 @@ pop(array: [any]): any | Name | Type | Description | Required | |----------|------|-------------|----------| -| `array` | [`[any]`](/docs/kcl/types/std-types-any) | The array to pop from. Must not be empty. | Yes | +| `array` | [`[any]`](/docs/kcl-std/types/std-types-any) | The array to pop from. Must not be empty. | Yes | ### Returns -[`any`](/docs/kcl/types/std-types-any) - Any KCL value. +[`any`](/docs/kcl-std/types/std-types-any) - Any KCL value. ### Examples diff --git a/docs/kcl/profileStart.md b/docs/kcl-std/profileStart.md similarity index 99% rename from docs/kcl/profileStart.md rename to docs/kcl-std/profileStart.md index 997d951c8..0dd198ef8 100644 --- a/docs/kcl/profileStart.md +++ b/docs/kcl-std/profileStart.md @@ -17,11 +17,11 @@ profileStart(profile: Sketch): [number] | Name | Type | Description | Required | |----------|------|-------------|----------| -| `profile` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Profile whose start is being used | Yes | +| `profile` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Profile whose start is being used | Yes | ### Returns -[`[number]`](/docs/kcl/types/std-types-number) +[`[number]`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/profileStartX.md b/docs/kcl-std/profileStartX.md similarity index 99% rename from docs/kcl/profileStartX.md rename to docs/kcl-std/profileStartX.md index dcff89a53..cb152feee 100644 --- a/docs/kcl/profileStartX.md +++ b/docs/kcl-std/profileStartX.md @@ -17,11 +17,11 @@ profileStartX(profile: Sketch): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `profile` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Profile whose start is being used | Yes | +| `profile` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Profile whose start is being used | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/profileStartY.md b/docs/kcl-std/profileStartY.md similarity index 99% rename from docs/kcl/profileStartY.md rename to docs/kcl-std/profileStartY.md index 7c02b8243..738f820a5 100644 --- a/docs/kcl/profileStartY.md +++ b/docs/kcl-std/profileStartY.md @@ -17,11 +17,11 @@ profileStartY(profile: Sketch): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| `profile` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Profile whose start is being used | Yes | +| `profile` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Profile whose start is being used | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/push.md b/docs/kcl-std/push.md similarity index 99% rename from docs/kcl/push.md rename to docs/kcl-std/push.md index 19a1c64e0..42d369a12 100644 --- a/docs/kcl/push.md +++ b/docs/kcl-std/push.md @@ -20,12 +20,12 @@ push( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `array` | [`[any]`](/docs/kcl/types/std-types-any) | The array which you're adding a new item to. | Yes | -| `item` | [`any`](/docs/kcl/types/std-types-any) | The new item to add to the array | Yes | +| `array` | [`[any]`](/docs/kcl-std/types/std-types-any) | The array which you're adding a new item to. | Yes | +| `item` | [`any`](/docs/kcl-std/types/std-types-any) | The new item to add to the array | Yes | ### Returns -[`any`](/docs/kcl/types/std-types-any) - Any KCL value. +[`any`](/docs/kcl-std/types/std-types-any) - Any KCL value. ### Examples diff --git a/docs/kcl/reduce.md b/docs/kcl-std/reduce.md similarity index 99% rename from docs/kcl/reduce.md rename to docs/kcl-std/reduce.md index 135e3e8f4..28451e9ed 100644 --- a/docs/kcl/reduce.md +++ b/docs/kcl-std/reduce.md @@ -21,13 +21,13 @@ reduce( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `array` | [`[any]`](/docs/kcl/types/std-types-any) | Each element of this array gets run through the function `f`, combined with the previous output from `f`, and then used for the next run. | Yes | -| `initial` | [`any`](/docs/kcl/types/std-types-any) | The first time `f` is run, it will be called with the first item of `array` and this initial starting value. | Yes | +| `array` | [`[any]`](/docs/kcl-std/types/std-types-any) | Each element of this array gets run through the function `f`, combined with the previous output from `f`, and then used for the next run. | Yes | +| `initial` | [`any`](/docs/kcl-std/types/std-types-any) | The first time `f` is run, it will be called with the first item of `array` and this initial starting value. | Yes | | `f` | `FunctionSource` | Run once per item in the input `array`. This function takes an item from the array, and the previous output from `f` (or `initial` on the very first run). The final time `f` is run, its output is returned as the final output from `reduce`. | Yes | ### Returns -[`any`](/docs/kcl/types/std-types-any) - Any KCL value. +[`any`](/docs/kcl-std/types/std-types-any) - Any KCL value. ### Examples diff --git a/docs/kcl/rotate.md b/docs/kcl-std/rotate.md similarity index 99% rename from docs/kcl/rotate.md rename to docs/kcl-std/rotate.md index e5f7be9a5..efe302409 100644 --- a/docs/kcl/rotate.md +++ b/docs/kcl-std/rotate.md @@ -43,17 +43,17 @@ rotate( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `objects` | [`[Solid]`](/docs/kcl/types/std-types-Solid) or [`[Sketch]`](/docs/kcl/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) | The solid, sketch, or set of solids or sketches to rotate. | Yes | -| `roll` | [`number`](/docs/kcl/types/std-types-number) | The roll angle in degrees. Must be between -360 and 360. Default is 0 if not given. | No | -| `pitch` | [`number`](/docs/kcl/types/std-types-number) | The pitch angle in degrees. Must be between -360 and 360. Default is 0 if not given. | No | -| `yaw` | [`number`](/docs/kcl/types/std-types-number) | The yaw angle in degrees. Must be between -360 and 360. Default is 0 if not given. | No | -| `axis` | [`[number]`](/docs/kcl/types/std-types-number) | The axis to rotate around. Must be used with `angle`. | No | -| `angle` | [`number`](/docs/kcl/types/std-types-number) | The angle to rotate in degrees. Must be used with `axis`. Must be between -360 and 360. | No | -| `global` | [`bool`](/docs/kcl/types/std-types-bool) | If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move. | No | +| `objects` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) | The solid, sketch, or set of solids or sketches to rotate. | Yes | +| `roll` | [`number`](/docs/kcl-std/types/std-types-number) | The roll angle in degrees. Must be between -360 and 360. Default is 0 if not given. | No | +| `pitch` | [`number`](/docs/kcl-std/types/std-types-number) | The pitch angle in degrees. Must be between -360 and 360. Default is 0 if not given. | No | +| `yaw` | [`number`](/docs/kcl-std/types/std-types-number) | The yaw angle in degrees. Must be between -360 and 360. Default is 0 if not given. | No | +| `axis` | [`[number]`](/docs/kcl-std/types/std-types-number) | The axis to rotate around. Must be used with `angle`. | No | +| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | The angle to rotate in degrees. Must be used with `axis`. Must be between -360 and 360. | No | +| `global` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) or [`[Sketch]`](/docs/kcl/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) - Data for a solid, sketch, or an imported geometry. +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) - Data for a solid, sketch, or an imported geometry. ### Examples diff --git a/docs/kcl/scale.md b/docs/kcl-std/scale.md similarity index 99% rename from docs/kcl/scale.md rename to docs/kcl-std/scale.md index 901a7424a..8136e9c0a 100644 --- a/docs/kcl/scale.md +++ b/docs/kcl-std/scale.md @@ -29,15 +29,15 @@ scale( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `objects` | [`[Solid]`](/docs/kcl/types/std-types-Solid) or [`[Sketch]`](/docs/kcl/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) | The solid, sketch, or set of solids or sketches to scale. | Yes | -| `x` | [`number`](/docs/kcl/types/std-types-number) | The scale factor for the x axis. Default is 1 if not provided. | No | -| `y` | [`number`](/docs/kcl/types/std-types-number) | The scale factor for the y axis. Default is 1 if not provided. | No | -| `z` | [`number`](/docs/kcl/types/std-types-number) | The scale factor for the z axis. Default is 1 if not provided. | No | -| `global` | [`bool`](/docs/kcl/types/std-types-bool) | If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move. | No | +| `objects` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) | The solid, sketch, or set of solids or sketches to scale. | Yes | +| `x` | [`number`](/docs/kcl-std/types/std-types-number) | The scale factor for the x axis. Default is 1 if not provided. | No | +| `y` | [`number`](/docs/kcl-std/types/std-types-number) | The scale factor for the y axis. Default is 1 if not provided. | No | +| `z` | [`number`](/docs/kcl-std/types/std-types-number) | The scale factor for the z axis. Default is 1 if not provided. | No | +| `global` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) or [`[Sketch]`](/docs/kcl/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) - Data for a solid, sketch, or an imported geometry. +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) - Data for a solid, sketch, or an imported geometry. ### Examples diff --git a/docs/kcl/segAng.md b/docs/kcl-std/segAng.md similarity index 99% rename from docs/kcl/segAng.md rename to docs/kcl-std/segAng.md index e9aef8b9b..3cd5e5581 100644 --- a/docs/kcl/segAng.md +++ b/docs/kcl-std/segAng.md @@ -17,11 +17,11 @@ segAng(tag: TagIdentifier): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/segEnd.md b/docs/kcl-std/segEnd.md similarity index 99% rename from docs/kcl/segEnd.md rename to docs/kcl-std/segEnd.md index 29323fccd..e8b0d2a2d 100644 --- a/docs/kcl/segEnd.md +++ b/docs/kcl-std/segEnd.md @@ -17,11 +17,11 @@ segEnd(tag: TagIdentifier): Point2d | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`Point2d`](/docs/kcl/types/std-types-Point2d) +[`Point2d`](/docs/kcl-std/types/std-types-Point2d) ### Examples diff --git a/docs/kcl/segEndX.md b/docs/kcl-std/segEndX.md similarity index 99% rename from docs/kcl/segEndX.md rename to docs/kcl-std/segEndX.md index c150680dd..835ab5159 100644 --- a/docs/kcl/segEndX.md +++ b/docs/kcl-std/segEndX.md @@ -17,11 +17,11 @@ segEndX(tag: TagIdentifier): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/segEndY.md b/docs/kcl-std/segEndY.md similarity index 99% rename from docs/kcl/segEndY.md rename to docs/kcl-std/segEndY.md index 14b828d93..476cd023e 100644 --- a/docs/kcl/segEndY.md +++ b/docs/kcl-std/segEndY.md @@ -17,11 +17,11 @@ segEndY(tag: TagIdentifier): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/segLen.md b/docs/kcl-std/segLen.md similarity index 99% rename from docs/kcl/segLen.md rename to docs/kcl-std/segLen.md index da9fcb62a..6f5c7bdd5 100644 --- a/docs/kcl/segLen.md +++ b/docs/kcl-std/segLen.md @@ -17,11 +17,11 @@ segLen(tag: TagIdentifier): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/segStart.md b/docs/kcl-std/segStart.md similarity index 99% rename from docs/kcl/segStart.md rename to docs/kcl-std/segStart.md index 86e1e50d5..59a525b99 100644 --- a/docs/kcl/segStart.md +++ b/docs/kcl-std/segStart.md @@ -17,11 +17,11 @@ segStart(tag: TagIdentifier): Point2d | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`Point2d`](/docs/kcl/types/std-types-Point2d) +[`Point2d`](/docs/kcl-std/types/std-types-Point2d) ### Examples diff --git a/docs/kcl/segStartX.md b/docs/kcl-std/segStartX.md similarity index 99% rename from docs/kcl/segStartX.md rename to docs/kcl-std/segStartX.md index ccc7ff055..46963c7ee 100644 --- a/docs/kcl/segStartX.md +++ b/docs/kcl-std/segStartX.md @@ -17,11 +17,11 @@ segStartX(tag: TagIdentifier): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/segStartY.md b/docs/kcl-std/segStartY.md similarity index 99% rename from docs/kcl/segStartY.md rename to docs/kcl-std/segStartY.md index 7cf9b259f..847079d2b 100644 --- a/docs/kcl/segStartY.md +++ b/docs/kcl-std/segStartY.md @@ -17,11 +17,11 @@ segStartY(tag: TagIdentifier): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/startProfile.md b/docs/kcl-std/startProfile.md similarity index 99% rename from docs/kcl/startProfile.md rename to docs/kcl-std/startProfile.md index 41fb9074e..6e1c2e1ea 100644 --- a/docs/kcl/startProfile.md +++ b/docs/kcl-std/startProfile.md @@ -21,13 +21,13 @@ startProfile( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketchSurface` | [`Plane`](/docs/kcl/types/std-types-Plane) or [`Face`](/docs/kcl/types/std-types-Face) | What to start the profile on | Yes | -| `at` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | Where to start the profile. An absolute point. | Yes | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Tag this first starting point | No | +| `sketchSurface` | [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | What to start the profile on | Yes | +| `at` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where to start the profile. An absolute point. | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Tag this first starting point | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/startSketchOn.md b/docs/kcl-std/startSketchOn.md similarity index 99% rename from docs/kcl/startSketchOn.md rename to docs/kcl-std/startSketchOn.md index 7069fabc2..81f4c1eb4 100644 --- a/docs/kcl/startSketchOn.md +++ b/docs/kcl-std/startSketchOn.md @@ -28,12 +28,12 @@ startSketchOn( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `planeOrSolid` | [`Plane`](/docs/kcl/types/std-types-Plane) or [`Solid`](/docs/kcl/types/std-types-Solid) | The plane or solid to sketch on | Yes | -| `face` | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) or [`Start`](/docs/kcl/types#Start) or [`End`](/docs/kcl/types#End) | Identify a face of a solid if a solid is specified as the input argument (`plane_or_solid`) | No | +| `planeOrSolid` | [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Solid`](/docs/kcl-std/types/std-types-Solid) | The plane or solid to sketch on | Yes | +| `face` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) or [`Start`](/docs/kcl-lang/types#Start) or [`End`](/docs/kcl-lang/types#End) | Identify a face of a solid if a solid is specified as the input argument (`plane_or_solid`) | No | ### Returns -[`Plane`](/docs/kcl/types/std-types-Plane) or [`Face`](/docs/kcl/types/std-types-Face) - A sketch type. +[`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) - A sketch type. ### Examples diff --git a/docs/kcl/std.json b/docs/kcl-std/std.json similarity index 100% rename from docs/kcl/std.json rename to docs/kcl-std/std.json diff --git a/docs/kcl/subtract.md b/docs/kcl-std/subtract.md similarity index 99% rename from docs/kcl/subtract.md rename to docs/kcl-std/subtract.md index e569afba5..b146d7b0d 100644 --- a/docs/kcl/subtract.md +++ b/docs/kcl-std/subtract.md @@ -21,13 +21,13 @@ subtract( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solids` | [`[Solid]`](/docs/kcl/types/std-types-Solid) | The solids to use as the base to subtract from. | Yes | -| `tools` | [`[Solid]`](/docs/kcl/types/std-types-Solid) | The solids to subtract. | Yes | -| `tolerance` | [`number`](/docs/kcl/types/std-types-number) | The tolerance to use for the subtraction operation. | No | +| `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to use as the base to subtract from. | Yes | +| `tools` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to subtract. | Yes | +| `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the subtraction operation. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/subtract2d.md b/docs/kcl-std/subtract2d.md similarity index 99% rename from docs/kcl/subtract2d.md rename to docs/kcl-std/subtract2d.md index aa3f33f0e..66ec430df 100644 --- a/docs/kcl/subtract2d.md +++ b/docs/kcl-std/subtract2d.md @@ -20,12 +20,12 @@ subtract2d( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `tool` | [`[Sketch]`](/docs/kcl/types/std-types-Sketch) | The shape(s) which should be cut out of the sketch. | Yes | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `tool` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | The shape(s) which should be cut out of the sketch. | Yes | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/sweep.md b/docs/kcl-std/sweep.md similarity index 99% rename from docs/kcl/sweep.md rename to docs/kcl-std/sweep.md index dc2a9b13a..46ee4b850 100644 --- a/docs/kcl/sweep.md +++ b/docs/kcl-std/sweep.md @@ -26,16 +26,16 @@ sweep( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketches` | [`[Sketch]`](/docs/kcl/types/std-types-Sketch) | The sketch or set of sketches that should be swept in space | Yes | -| `path` | [`Sketch`](/docs/kcl/types/std-types-Sketch) or [`Helix`](/docs/kcl/types/std-types-Helix) | The path to sweep the sketch along | Yes | -| `sectional` | [`bool`](/docs/kcl/types/std-types-bool) | If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components. | No | -| `tolerance` | [`number`](/docs/kcl/types/std-types-number) | Tolerance for this operation | No | -| `tagStart` | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | A named tag for the face at the start of the sweep, i.e. the original sketch | No | -| `tagEnd` | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | A named tag for the face at the end of the sweep | No | +| `sketches` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | The sketch or set of sketches that should be swept in space | Yes | +| `path` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Helix`](/docs/kcl-std/types/std-types-Helix) | The path to sweep the sketch along | Yes | +| `sectional` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components. | No | +| `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | Tolerance for this operation | No | +| `tagStart` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the start of the sweep, i.e. the original sketch | No | +| `tagEnd` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the end of the sweep | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/tangentToEnd.md b/docs/kcl-std/tangentToEnd.md similarity index 99% rename from docs/kcl/tangentToEnd.md rename to docs/kcl-std/tangentToEnd.md index e8aa077e6..577d53531 100644 --- a/docs/kcl/tangentToEnd.md +++ b/docs/kcl-std/tangentToEnd.md @@ -17,11 +17,11 @@ tangentToEnd(tag: TagIdentifier): number | Name | Type | Description | Required | |----------|------|-------------|----------| -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagIdentifier`](/docs/kcl/types#TagIdentifier) | The line segment being queried by its tag | Yes | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | ### Returns -[`number`](/docs/kcl/types/std-types-number) +[`number`](/docs/kcl-std/types/std-types-number) ### Examples diff --git a/docs/kcl/tangentialArc.md b/docs/kcl-std/tangentialArc.md similarity index 99% rename from docs/kcl/tangentialArc.md rename to docs/kcl-std/tangentialArc.md index f11113ef9..14e3873d9 100644 --- a/docs/kcl/tangentialArc.md +++ b/docs/kcl-std/tangentialArc.md @@ -24,16 +24,16 @@ tangentialArc( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `endAbsolute` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | Which absolute point should this arc go to? Incompatible with `end`, `radius`, and `offset`. | No | -| `end` | [`Point2d`](/docs/kcl/types/std-types-Point2d) | How far away (along the X and Y axes) should this arc go? Incompatible with `endAbsolute`, `radius`, and `offset`. | No | -| `radius` | [`number`](/docs/kcl/types/std-types-number) | Radius of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute`. | No | -| `angle` | [`number`](/docs/kcl/types/std-types-number) | Offset of the arc in degrees. `radius` must be given. Incompatible with `end` and `endAbsolute`. | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this arc | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Which absolute point should this arc go to? Incompatible with `end`, `radius`, and `offset`. | No | +| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this arc go? Incompatible with `endAbsolute`, `radius`, and `offset`. | No | +| `radius` | [`number`](/docs/kcl-std/types/std-types-number) | Radius of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute`. | No | +| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Offset of the arc in degrees. `radius` must be given. Incompatible with `end` and `endAbsolute`. | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this arc | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/translate.md b/docs/kcl-std/translate.md similarity index 99% rename from docs/kcl/translate.md rename to docs/kcl-std/translate.md index 870d5c69c..925a803f5 100644 --- a/docs/kcl/translate.md +++ b/docs/kcl-std/translate.md @@ -25,15 +25,15 @@ translate( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `objects` | [`[Solid]`](/docs/kcl/types/std-types-Solid) or [`[Sketch]`](/docs/kcl/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) | The solid, sketch, or set of solids or sketches to move. | Yes | -| `x` | [`number`](/docs/kcl/types/std-types-number) | The amount to move the solid or sketch along the x axis. Defaults to 0 if not provided. | No | -| `y` | [`number`](/docs/kcl/types/std-types-number) | The amount to move the solid or sketch along the y axis. Defaults to 0 if not provided. | No | -| `z` | [`number`](/docs/kcl/types/std-types-number) | The amount to move the solid or sketch along the z axis. Defaults to 0 if not provided. | No | -| `global` | [`bool`](/docs/kcl/types/std-types-bool) | If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move. | No | +| `objects` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) | The solid, sketch, or set of solids or sketches to move. | Yes | +| `x` | [`number`](/docs/kcl-std/types/std-types-number) | The amount to move the solid or sketch along the x axis. Defaults to 0 if not provided. | No | +| `y` | [`number`](/docs/kcl-std/types/std-types-number) | The amount to move the solid or sketch along the y axis. Defaults to 0 if not provided. | No | +| `z` | [`number`](/docs/kcl-std/types/std-types-number) | The amount to move the solid or sketch along the z axis. Defaults to 0 if not provided. | No | +| `global` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) or [`[Sketch]`](/docs/kcl/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl/types#ImportedGeometry) - Data for a solid, sketch, or an imported geometry. +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) - Data for a solid, sketch, or an imported geometry. ### Examples diff --git a/docs/kcl/types/std-types-Axis2d.md b/docs/kcl-std/types/std-types-Axis2d.md similarity index 100% rename from docs/kcl/types/std-types-Axis2d.md rename to docs/kcl-std/types/std-types-Axis2d.md diff --git a/docs/kcl/types/std-types-Axis3d.md b/docs/kcl-std/types/std-types-Axis3d.md similarity index 100% rename from docs/kcl/types/std-types-Axis3d.md rename to docs/kcl-std/types/std-types-Axis3d.md diff --git a/docs/kcl/types/std-types-Edge.md b/docs/kcl-std/types/std-types-Edge.md similarity index 100% rename from docs/kcl/types/std-types-Edge.md rename to docs/kcl-std/types/std-types-Edge.md diff --git a/docs/kcl/types/std-types-Face.md b/docs/kcl-std/types/std-types-Face.md similarity index 100% rename from docs/kcl/types/std-types-Face.md rename to docs/kcl-std/types/std-types-Face.md diff --git a/docs/kcl/types/std-types-Helix.md b/docs/kcl-std/types/std-types-Helix.md similarity index 100% rename from docs/kcl/types/std-types-Helix.md rename to docs/kcl-std/types/std-types-Helix.md diff --git a/docs/kcl/types/std-types-Plane.md b/docs/kcl-std/types/std-types-Plane.md similarity index 100% rename from docs/kcl/types/std-types-Plane.md rename to docs/kcl-std/types/std-types-Plane.md diff --git a/docs/kcl-std/types/std-types-Point2d.md b/docs/kcl-std/types/std-types-Point2d.md new file mode 100644 index 000000000..b056fc3d5 --- /dev/null +++ b/docs/kcl-std/types/std-types-Point2d.md @@ -0,0 +1,17 @@ +--- +title: "std::types::Point2d" +excerpt: "A point in two dimensional space." +layout: manual +--- + +A point in two dimensional space. + +```kcl +type Point2d = [number(Length); 2] +``` + +[`Point2d`](/docs/kcl-std/types/std-types-Point2d) is an alias for a two-element array of [number](/docs/kcl-std/types/std-types-number)s. To write a value +with type [`Point2d`](/docs/kcl-std/types/std-types-Point2d), use an array, e.g., `[0, 0]` or `[5.0, 3.14]`. + + + diff --git a/docs/kcl-std/types/std-types-Point3d.md b/docs/kcl-std/types/std-types-Point3d.md new file mode 100644 index 000000000..5f05a84cd --- /dev/null +++ b/docs/kcl-std/types/std-types-Point3d.md @@ -0,0 +1,17 @@ +--- +title: "std::types::Point3d" +excerpt: "A point in three dimensional space." +layout: manual +--- + +A point in three dimensional space. + +```kcl +type Point3d = [number(Length); 3] +``` + +[`Point3d`](/docs/kcl-std/types/std-types-Point3d) is an alias for a three-element array of [number](/docs/kcl-std/types/std-types-number)s. To write a value +with type [`Point3d`](/docs/kcl-std/types/std-types-Point3d), use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`. + + + diff --git a/docs/kcl/types/std-types-Sketch.md b/docs/kcl-std/types/std-types-Sketch.md similarity index 99% rename from docs/kcl/types/std-types-Sketch.md rename to docs/kcl-std/types/std-types-Sketch.md index 5f3368955..975afc3e8 100644 --- a/docs/kcl/types/std-types-Sketch.md +++ b/docs/kcl-std/types/std-types-Sketch.md @@ -17,7 +17,7 @@ mySketch = startSketchOn(XY) |> close() ``` -The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/std-types-Sketch) object. Executed being past +The `mySketch` variable will be an executed [`Sketch`](/docs/kcl-std/types/std-types-Sketch) object. Executed being past tense, because the engine has already executed the commands to create the sketch. The previous sketch commands will never be executed again, in this case. diff --git a/docs/kcl/types/std-types-Solid.md b/docs/kcl-std/types/std-types-Solid.md similarity index 99% rename from docs/kcl/types/std-types-Solid.md rename to docs/kcl-std/types/std-types-Solid.md index c27885419..437cc3f56 100644 --- a/docs/kcl/types/std-types-Solid.md +++ b/docs/kcl-std/types/std-types-Solid.md @@ -18,7 +18,7 @@ myPart = startSketchOn(XY) |> extrude(length = 6) ``` -The `myPart` variable will be an executed [`Solid`](/docs/kcl/types/std-types-Solid) object. Executed being past +The `myPart` variable will be an executed [`Solid`](/docs/kcl-std/types/std-types-Solid) object. Executed being past tense, because the engine has already executed the commands to create the solid. The previous solid commands will never be executed again, in this case. diff --git a/docs/kcl/types/std-types-any.md b/docs/kcl-std/types/std-types-any.md similarity index 100% rename from docs/kcl/types/std-types-any.md rename to docs/kcl-std/types/std-types-any.md diff --git a/docs/kcl/types/std-types-bool.md b/docs/kcl-std/types/std-types-bool.md similarity index 100% rename from docs/kcl/types/std-types-bool.md rename to docs/kcl-std/types/std-types-bool.md diff --git a/docs/kcl/types/std-types-number.md b/docs/kcl-std/types/std-types-number.md similarity index 100% rename from docs/kcl/types/std-types-number.md rename to docs/kcl-std/types/std-types-number.md diff --git a/docs/kcl/types/std-types-string.md b/docs/kcl-std/types/std-types-string.md similarity index 100% rename from docs/kcl/types/std-types-string.md rename to docs/kcl-std/types/std-types-string.md diff --git a/docs/kcl/types/std-types-tag.md b/docs/kcl-std/types/std-types-tag.md similarity index 100% rename from docs/kcl/types/std-types-tag.md rename to docs/kcl-std/types/std-types-tag.md diff --git a/docs/kcl/union.md b/docs/kcl-std/union.md similarity index 99% rename from docs/kcl/union.md rename to docs/kcl-std/union.md index 85920bc9d..53027cb9a 100644 --- a/docs/kcl/union.md +++ b/docs/kcl-std/union.md @@ -20,12 +20,12 @@ union( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `solids` | [`[Solid]`](/docs/kcl/types/std-types-Solid) | The solids to union. | Yes | -| `tolerance` | [`number`](/docs/kcl/types/std-types-number) | The tolerance to use for the union operation. | No | +| `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to union. | Yes | +| `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the union operation. | No | ### Returns -[`[Solid]`](/docs/kcl/types/std-types-Solid) +[`[Solid]`](/docs/kcl-std/types/std-types-Solid) ### Examples diff --git a/docs/kcl/xLine.md b/docs/kcl-std/xLine.md similarity index 99% rename from docs/kcl/xLine.md rename to docs/kcl-std/xLine.md index e927ce01c..d93aeab34 100644 --- a/docs/kcl/xLine.md +++ b/docs/kcl-std/xLine.md @@ -22,14 +22,14 @@ xLine( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `length` | [`number`](/docs/kcl/types/std-types-number) | How far away along the X axis should this line go? Incompatible with `endAbsolute`. | No | -| `endAbsolute` | [`number`](/docs/kcl/types/std-types-number) | Which absolute X value should this line go to? Incompatible with `length`. | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `length` | [`number`](/docs/kcl-std/types/std-types-number) | How far away along the X axis should this line go? Incompatible with `endAbsolute`. | No | +| `endAbsolute` | [`number`](/docs/kcl-std/types/std-types-number) | Which absolute X value should this line go to? Incompatible with `length`. | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/yLine.md b/docs/kcl-std/yLine.md similarity index 99% rename from docs/kcl/yLine.md rename to docs/kcl-std/yLine.md index 5a60f5288..095422c6c 100644 --- a/docs/kcl/yLine.md +++ b/docs/kcl-std/yLine.md @@ -22,14 +22,14 @@ yLine( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `sketch` | [`Sketch`](/docs/kcl/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | -| `length` | [`number`](/docs/kcl/types/std-types-number) | How far away along the Y axis should this line go? Incompatible with `endAbsolute`. | No | -| `endAbsolute` | [`number`](/docs/kcl/types/std-types-number) | Which absolute Y value should this line go to? Incompatible with `length`. | No | -| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No | +| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | +| `length` | [`number`](/docs/kcl-std/types/std-types-number) | How far away along the Y axis should this line go? Incompatible with `endAbsolute`. | No | +| `endAbsolute` | [`number`](/docs/kcl-std/types/std-types-number) | Which absolute Y value should this line go to? Incompatible with `length`. | No | +| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No | ### Returns -[`Sketch`](/docs/kcl/types/std-types-Sketch) +[`Sketch`](/docs/kcl-std/types/std-types-Sketch) ### Examples diff --git a/docs/kcl/index.md b/docs/kcl/index.md deleted file mode 100644 index 8ab35d68c..000000000 --- a/docs/kcl/index.md +++ /dev/null @@ -1,167 +0,0 @@ ---- -title: "KCL Standard Library" -excerpt: "Documentation for the KCL standard library for the Zoo Design Studio." -layout: manual ---- - -## Table of Contents - -### Language - -* [`Types`](kcl/types) -* [`Modules`](kcl/modules) -* [`Settings`](kcl/settings) -* [`Known Issues`](kcl/known-issues) - -### Functions - -* **std** - * [`angledLine`](kcl/angledLine) - * [`angledLineThatIntersects`](kcl/angledLineThatIntersects) - * [`appearance`](kcl/appearance) - * [`arc`](kcl/arc) - * [`assert`](kcl/assert) - * [`assertIs`](kcl/assertIs) - * [`bezierCurve`](kcl/bezierCurve) - * [`circleThreePoint`](kcl/circleThreePoint) - * [`clone`](kcl/clone) - * [`close`](kcl/close) - * [`extrude`](kcl/extrude) - * [`getCommonEdge`](kcl/getCommonEdge) - * [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge) - * [`getOppositeEdge`](kcl/getOppositeEdge) - * [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge) - * [`helix`](kcl/functions/std-helix) - * [`intersect`](kcl/intersect) - * [`involuteCircular`](kcl/involuteCircular) - * [`lastSegX`](kcl/lastSegX) - * [`lastSegY`](kcl/lastSegY) - * [`legAngX`](kcl/legAngX) - * [`legAngY`](kcl/legAngY) - * [`legLen`](kcl/legLen) - * [`line`](kcl/line) - * [`loft`](kcl/loft) - * [`map`](kcl/map) - * [`offsetPlane`](kcl/functions/std-offsetPlane) - * [`patternCircular2d`](kcl/patternCircular2d) - * [`patternCircular3d`](kcl/patternCircular3d) - * [`patternLinear2d`](kcl/patternLinear2d) - * [`patternLinear3d`](kcl/patternLinear3d) - * [`patternTransform`](kcl/patternTransform) - * [`patternTransform2d`](kcl/patternTransform2d) - * [`polygon`](kcl/polygon) - * [`pop`](kcl/pop) - * [`profileStart`](kcl/profileStart) - * [`profileStartX`](kcl/profileStartX) - * [`profileStartY`](kcl/profileStartY) - * [`push`](kcl/push) - * [`reduce`](kcl/reduce) - * [`revolve`](kcl/functions/std-revolve) - * [`rotate`](kcl/rotate) - * [`scale`](kcl/scale) - * [`segAng`](kcl/segAng) - * [`segEnd`](kcl/segEnd) - * [`segEndX`](kcl/segEndX) - * [`segEndY`](kcl/segEndY) - * [`segLen`](kcl/segLen) - * [`segStart`](kcl/segStart) - * [`segStartX`](kcl/segStartX) - * [`segStartY`](kcl/segStartY) - * [`startProfile`](kcl/startProfile) - * [`startSketchOn`](kcl/startSketchOn) - * [`subtract`](kcl/subtract) - * [`subtract2d`](kcl/subtract2d) - * [`sweep`](kcl/sweep) - * [`tangentToEnd`](kcl/tangentToEnd) - * [`tangentialArc`](kcl/tangentialArc) - * [`translate`](kcl/translate) - * [`union`](kcl/union) - * [`xLine`](kcl/xLine) - * [`yLine`](kcl/yLine) -* **std::math** - * [`abs`](kcl/functions/std-math-abs) - * [`acos`](kcl/functions/std-math-acos) - * [`asin`](kcl/functions/std-math-asin) - * [`atan`](kcl/functions/std-math-atan) - * [`atan2`](kcl/functions/std-math-atan2) - * [`ceil`](kcl/functions/std-math-ceil) - * [`cos`](kcl/functions/std-math-cos) - * [`floor`](kcl/functions/std-math-floor) - * [`ln`](kcl/functions/std-math-ln) - * [`log`](kcl/functions/std-math-log) - * [`log10`](kcl/functions/std-math-log10) - * [`log2`](kcl/functions/std-math-log2) - * [`max`](kcl/functions/std-math-max) - * [`min`](kcl/functions/std-math-min) - * [`polar`](kcl/functions/std-math-polar) - * [`pow`](kcl/functions/std-math-pow) - * [`rem`](kcl/functions/std-math-rem) - * [`round`](kcl/functions/std-math-round) - * [`sin`](kcl/functions/std-math-sin) - * [`sqrt`](kcl/functions/std-math-sqrt) - * [`tan`](kcl/functions/std-math-tan) -* **std::sketch** - * [`circle`](kcl/functions/std-sketch-circle) - * [`mirror2d`](kcl/functions/std-sketch-mirror2d) -* **std::solid** - * [`chamfer`](kcl/functions/std-solid-chamfer) - * [`fillet`](kcl/functions/std-solid-fillet) - * [`hollow`](kcl/functions/std-solid-hollow) - * [`shell`](kcl/functions/std-solid-shell) -* **std::units** - * [`units::toCentimeters`](kcl/functions/std-units-toCentimeters) - * [`units::toDegrees`](kcl/functions/std-units-toDegrees) - * [`units::toFeet`](kcl/functions/std-units-toFeet) - * [`units::toInches`](kcl/functions/std-units-toInches) - * [`units::toMeters`](kcl/functions/std-units-toMeters) - * [`units::toMillimeters`](kcl/functions/std-units-toMillimeters) - * [`units::toRadians`](kcl/functions/std-units-toRadians) - * [`units::toYards`](kcl/functions/std-units-toYards) - -### Constants - -* **std** - * [`END`](kcl/consts/std-END) - * [`START`](kcl/consts/std-START) - * [`X`](kcl/consts/std-X) - * [`XY`](kcl/consts/std-XY) - * [`XZ`](kcl/consts/std-XZ) - * [`Y`](kcl/consts/std-Y) - * [`YZ`](kcl/consts/std-YZ) - * [`Z`](kcl/consts/std-Z) -* **std::math** - * [`E`](kcl/consts/std-math-E) - * [`PI`](kcl/consts/std-math-PI) - * [`TAU`](kcl/consts/std-math-TAU) -* **std::turns** - * [`turns::HALF_TURN`](kcl/consts/std-turns-HALF_TURN) - * [`turns::QUARTER_TURN`](kcl/consts/std-turns-QUARTER_TURN) - * [`turns::THREE_QUARTER_TURN`](kcl/consts/std-turns-THREE_QUARTER_TURN) - * [`turns::ZERO`](kcl/consts/std-turns-ZERO) - -### Types - -See also the [types overview](types) - -* **Primitive types** - * [`End`](kcl/types#End) - * [`ImportedGeometry`](kcl/types#ImportedGeometry) - * [`Start`](kcl/types#Start) - * [`TagDeclarator`](kcl/types#TagDeclarator) - * [`TagIdentifier`](kcl/types#TagIdentifier) - * [`any`](kcl/types/std-types-any) - * [`bool`](kcl/types/std-types-bool) - * [`number`](kcl/types/std-types-number) - * [`string`](kcl/types/std-types-string) - * [`tag`](kcl/types/std-types-tag) -* **std::types** - * [`Axis2d`](kcl/types/std-types-Axis2d) - * [`Axis3d`](kcl/types/std-types-Axis3d) - * [`Edge`](kcl/types/std-types-Edge) - * [`Face`](kcl/types/std-types-Face) - * [`Helix`](kcl/types/std-types-Helix) - * [`Plane`](kcl/types/std-types-Plane) - * [`Point2d`](kcl/types/std-types-Point2d) - * [`Point3d`](kcl/types/std-types-Point3d) - * [`Sketch`](kcl/types/std-types-Sketch) - * [`Solid`](kcl/types/std-types-Solid) diff --git a/docs/kcl/known-issues.md b/docs/kcl/known-issues.md deleted file mode 100644 index eb3025d07..000000000 --- a/docs/kcl/known-issues.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "KCL Known Issues" -excerpt: "Known issues with the KCL standard library for the Zoo Design Studio." -layout: manual ---- - -The following are bugs that are not in modeling-app or kcl itself. These bugs -once fixed in engine will just start working here with no language changes. - -- **Sketch on Face**: If your sketch is outside the edges of the face (on which you - are sketching) you will get multiple models returned instead of one single - model for that sketch and its underlying 3D object. - If you see a red line around your model, it means this is happening. - -- **Import**: Right now you can import a file, even if that file has brep data - you cannot edit it, after v1, the engine will account for this. - -- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet - cases work currently. - -- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple - chamfer cases work currently. - -- **Appearance**: Changing the appearance on a loft does not work. - -- **CSG Booleans**: Coplanar (bodies that share a plane) unions, subtractions, and intersections are not currently supported. diff --git a/docs/kcl/modules.md b/docs/kcl/modules.md deleted file mode 100644 index 47c4daa9a..000000000 --- a/docs/kcl/modules.md +++ /dev/null @@ -1,365 +0,0 @@ ---- -title: "KCL Modules" -excerpt: "Documentation of modules for the KCL language for the Zoo Design Studio." -layout: manual ---- - -`KCL` allows splitting code up into multiple files. Each file is somewhat -isolated from other files as a separate module. - -When you define a function, you can use `export` before it to make it available -to other modules. - -```kcl -// util.kcl -export fn increment(@x) { - return x + 1 -} -``` - -Other files in the project can now import functions that have been exported. -This makes them available to use in another file. - -```norun -// main.kcl -import increment from "util.kcl" - -answer = increment(41) -``` - -Imported files _must_ be in the same project so that units are uniform across -modules. This means that it must be in the same directory. - -Import statements must be at the top-level of a file. It is not allowed to have -an `import` statement inside a function or in the body of an if‑else. - -Multiple functions can be exported in a file. - -```kcl -// util.kcl -export fn increment(@x) { - return x + 1 -} - -export fn decrement(@x) { - return x - 1 -} -``` - -When importing, you can import multiple functions at once. - -```norun -import increment, decrement from "util.kcl" -``` - -Imported symbols can be renamed for convenience or to avoid name collisions. - -```norun -import increment as inc, decrement as dec from "util.kcl" -``` - ---- - -## Functions vs `clone` - -There are two common patterns for re‑using geometry: - -1. **Wrap the construction in a function** – flexible and fully parametric. -2. **Duplicate an existing object with `clone`** – lightning‑fast, but an exact - duplicate. - -### Parametric function example - -```kcl -fn cube(center) { - return startSketchOn(XY) - |> startProfile(at = [center[0] - 10, center[1] - 10]) - |> line(endAbsolute = [center[0] + 10, center[1] - 10]) - |> line(endAbsolute = [center[0] + 10, center[1] + 10]) - |> line(endAbsolute = [center[0] - 10, center[1] + 10]) - |> close() - |> extrude(length = 10) -} - -myCube = cube(center = [0, 0]) -``` - -*Pros* -- Any argument can be a parameter – size, position, appearance, etc. -- Works great inside loops, arrays, or optimisation sweeps. - -*Cons* -- Every invocation rebuilds the entire feature tree. -- **Slower** than a straight duplicate – each call is its own render job. - -### `clone` example - -```kcl -sketch001 = startSketchOn(-XZ) - |> circle(center = [0, 0], radius = 10) - |> extrude(length = 5) - |> appearance(color = "#ff0000", metalness = 90, roughness = 90) - -sketch002 = clone(sketch001) // ✓ instant copy -``` - -*Pros* -- Roughly an O(1) operation – we just duplicate the underlying engine handle. -- Perfect when you need ten identical bolts or two copies of the same imported STEP file. - -*Cons* -- **Not parametric** – the clone is exactly the same shape as the source. -- If you need to tweak dimensions per‑instance, you’re back to a function. - -> **Rule of thumb** – Reach for `clone` when the geometry is already what you want. Reach for a function when you need customisation. - ---- - -## Module‑level parallelism - -Under the hood, the Design Studio runs **every module in parallel** where it can. This means: - -- The top‑level code of `foo.kcl`, `bar.kcl`, and `baz.kcl` all start executing immediately and concurrently. -- Imports that read foreign files (STEP/OBJ/…) overlap their I/O and background render. -- CPU‑bound calculations in separate modules get their own worker threads. - -### Why modules beat one‑big‑file - -If you shoe‑horn everything into `main.kcl`, each statement runs sequentially: - -```norun -import "big.step" as gizmo // blocks main while reading - -gizmo |> translate(x=50) // blocks again while waiting for render -``` - -Split `gizmo` into its own file and the read/render can overlap whatever else `main.kcl` is doing. - -```norun -// gizmo.kcl (worker A) -import "big.step" - -// main.kcl (worker B) -import "gizmo.kcl" as gizmo // non‑blocking - -// ... other setup ... - -gizmo |> translate(x=50) // only blocks here -``` - -### Gotcha: defining but **not** calling functions - -Defining a function inside a module is instantaneous – we just record the byte‑code. The heavy lifting happens when the function is **called**. So: - -```norun -// util.kcl -export fn makeBolt(size) { /* … expensive CAD … */ } -``` - -If `main.kcl` waits until the very end to call `makeBolt`, *none* of that work was parallelised – you’ve pushed the cost back onto the serial tail of your script. - -**Better:** call it early or move the invocation into another module. - -```norun -// bolt_instance.kcl -import makeBolt from "util.kcl" -bolt = makeBolt(5) // executed in parallel -bolt -``` - -Now `main.kcl` can `import "bolt_instance.kcl" as bolt` and get the result that was rendered while it was busy doing other things. - ---- - -## Whole module import - -You can also import the whole module. This is useful if you want to use the -result of a module as a variable, like a part. - -```norun -import "tests/inputs/cube.kcl" as cube -cube - |> translate(x=10) -``` - -This imports the whole module and makes it available as `cube`. You can then -use it like any other object. The `cube` variable is now a reference to the -result of the module. This means that if you change the module, the `cube` -variable will change as well. - -In `cube.kcl`, you cannot have multiple objects. It has to be a single part. If -you have multiple objects, you will get an error. This is because the module is -expected to return a single object that can be used as a variable. - -The last expression or variable definition becomes the module's return value. -The module is expected to return a single object that can be used as a variable -by whatever imports it. - -So for example, this is allowed: - -```norun -... a bunch of code to create cube and cube2 ... - -myUnion = union([cube, cube2]) -``` - -You can also do this: - -```norun -... a bunch of code to create cube and cube2 ... - -union([cube, cube2]) -``` - -Either way, the last line will return the union of the two objects. - -Or what you could do instead is: - -```norun -... a bunch of code to create cube and cube2 ... - -myUnion = union([cube, cube2]) -myUnion -``` - -This will assign the union of the two objects to a variable, and then return it -on the last statement. It's simply another way of doing the same thing. - -The final statement is what's important because it's the return value of the -entire module. The module is expected to return a single object that can be used -as a variable by the file that imports it. - ---- - -## Multiple instances of the same import - -Whether you are importing a file from another CAD system or a KCL file, that -file represents object(s) in memory. If you import the same file multiple times, -it will only be rendered once. - -If you want to have multiple instances of the same object, you can use the -[`clone`](/docs/kcl/clone) function. This will render a new instance of the object in memory. - -```norun -import cube from "tests/inputs/cube.kcl" - -cube - |> translate(x=10) -clone(cube) - |> translate(x=20) -``` - -In the sample above, the `cube` object is imported from a KCL file. The first -instance is translated 10 units in the x direction. The second instance is -cloned and translated 20 units in the x direction. The two instances are now -separate objects in memory, and can be manipulated independently. - -Here is an example with a file from another CAD system: - -```kcl -import "tests/inputs/cube.step" as cube - -cube - |> translate(x=10) -clone(cube) - |> translate(x=20) -``` - ---- - -## Importing files from other CAD systems - -`import` can also be used to import files from other CAD systems. The format of the statement is the -same as for KCL files. You can only import the whole file, not items from it. E.g., - -```norun -import "tests/inputs/cube.obj" - -// Use `cube` just like a KCL object. -``` - -```kcl -import "tests/inputs/cube.sldprt" as cube - -// Use `cube` just like a KCL object. -``` - -For formats lacking unit data (such as STL, OBJ, or PLY files), the default -unit of measurement is millimeters. Alternatively you may specify the unit -by using an attribute. Likewise, you can also specify a coordinate system. E.g., - -```kcl -@(lengthUnit = ft, coords = opengl) -import "tests/inputs/cube.obj" -``` - -When importing a GLTF file, the bin file will be imported as well. - -Import paths are relative to the current project directory. Imports currently only work when -using the native Design Studio, not in the browser. - -### Supported values - -File formats: `fbx`, `gltf`/`glb`, `obj`+, `ply`+, `sldprt`, `step`/`stp`, `stl`+. (Those marked with a -'+' support customising the length unit and coordinate system). - -Length units: `mm` (the default), `cm`, `m`, `inch`, `ft`, `yd`. - -Coordinate systems: - -- `zoo` (the default), forward: -Y, up: +Z, handedness: right -- `opengl`, forward: +Z, up: +Y, handedness: right -- `vulkan`, forward: +Z, up: -Y, handedness: left - ---- - -## Performance deep‑dive for foreign‑file imports - -Parallelized foreign‑file imports now let you overlap file reads, initialization, -and rendering. To maximize throughput, you need to understand the three distinct -stages—reading, initializing (background render start), and invocation (blocking) -—and structure your code to defer blocking operations until the end. - -### Foreign import execution stages - -1. **Import (Read / Initialization) Stage** - ```kcl - import "tests/inputs/cube.step" as cube - ``` - - Reads the file from disk and makes its API available. - - Starts engine rendering but **does not block** your script. - - This kick‑starts the render pipeline while you keep executing other code. - -2. **Invocation (Blocking) Stage** - ```kcl - import "tests/inputs/cube.step" as cube - - cube - |> translate(z=10) // ← blocks here only - ``` - - Any method call (e.g., `translate`, `scale`, `rotate`) waits for the background render to finish before applying transformations. - -### Best practices - -#### 1. Defer blocking calls - -```kcl -import "tests/inputs/cube.step" as cube // 1) Read / Background render starts - - -// --- perform other operations and calculations here --- - - -cube - |> translate(z=10) // 2) Blocks only here -``` - -#### 2. Split heavy work into separate modules - -Place computationally expensive or IO‑heavy work into its own module so it can render in parallel while `main.kcl` continues. - -#### Future improvements - -Upcoming releases will auto‑analyse dependencies and only block when truly necessary. Until then, explicit deferral will give you the best performance. - - diff --git a/docs/kcl/settings.md b/docs/kcl/settings.md deleted file mode 100644 index fef877621..000000000 --- a/docs/kcl/settings.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: "KCL Settings" -excerpt: "Documentation of settings for the KCL language and Zoo Design Studio." -layout: manual ---- - -# KCL Settings - -There are three levels of settings available in Zoo Design Studio: - -1. [User Settings](/docs/kcl/settings-user): Global settings that apply to all projects, stored in `user.toml` -2. [Project Settings](/docs/kcl/settings-project): Settings specific to a project, stored in `project.toml` -3. Per-file Settings: Settings that apply to a single KCL file, specified using the `@settings` attribute - -## Configuration Files - -Zoo Design Studio uses TOML files for configuration: - -* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings-user) -* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings-project) - -## Per-file settings - -Settings which affect a single file are configured using the settings attribute. -This must be at the top of the KCL file (comments before the attribute are permitted). -For example: - -```kcl -// The settings attribute. -@settings(defaultLengthUnit = in) - -// The rest of your KCL code goes below... - -x = 42 // Represents 42 inches. -``` - -The settings attribute may contain multiple properties separated by commas. -Valid properties are: - -- `defaultLengthUnit`: the default length unit to use for numbers declared in this file. - - Accepted values: `mm`, `cm`, `m`, `in` (inches), `ft` (feet), `yd` (yards). -- `defaultAngleUnit`: the default angle unit to use for numbers declared in this file. - - Accepted values: `deg` (degrees), `rad` (radians). - -These settings override any project-wide settings (configured in project.toml or via the UI). diff --git a/docs/kcl/types.md b/docs/kcl/types.md deleted file mode 100644 index 2bcee03ce..000000000 --- a/docs/kcl/types.md +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: "KCL Types" -excerpt: "Documentation of types for the KCL standard library for the Zoo Design Studio." -layout: manual ---- - -`KCL` defines the following types and keywords the language. - -All these types can be nested in various forms where nesting applies. Like -arrays can hold objects and vice versa. - -## Constant declaration - -Constants are defined with a name and a value, like so: - -``` -myBool = false -``` - -Currently you cannot redeclare a constant. - -## Arrays - -An array is defined with `[]` braces. What is inside the brackets can -be of any type. For example, the following is completely valid: - -``` -myArray = ["thing", 2, false] -``` - -If you want to get a value from an array you can use the index like so: -`myArray[0]`. - - -## Objects - -An object is defined with `{}` braces. Here is an example object: - -``` -myObj = { a = 0, b = "thing" } -``` - -We support two different ways of getting properties from objects, you can call -`myObj.a` or `myObj["a"]` both work. - -## `ImportedGeometry` - -Using `import` you can import geometry defined using other CAD software. In KCL, -these objects have type `ImportedGeometry` and can mostly be treated like any -other solid (they can be rotated, scaled, etc.), although there is no access to -their internal components. See the [modules and imports docs](modules) for more -detail on importing geometry. - - -## Binary expressions - -You can also do math! Let's show an example below: - -``` -myMathExpression = 3 + 1 * 2 / 3 - 7 -``` - -You can nest expressions in parenthesis as well: - -``` -myMathExpression = 3 + (1 * 2 / (3 - 7)) -``` - -## Functions - -We also have support for defining your own functions. Functions can take in any -type of argument. Below is an example of the syntax: - -``` -fn myFn(x) { - return x -} -``` - -As you can see above `myFn` just returns whatever it is given. - -KCL's early drafts used positional arguments, but we now use keyword arguments: - -``` -// If you declare a function like this -fn add(left, right) { - return left + right -} - -// You can call it like this: -total = add(left = 1, right = 2) -``` - -Functions can also declare one *unlabeled* arg. If you do want to declare an unlabeled arg, it must -be the first arg declared. - -``` -// The @ indicates an argument can be used without a label. -// Note that only the first argument can use @. -fn increment(@x) { - return x + 1 -} - -fn add(@x, delta) { - return x + delta -} - -two = increment(1) -three = add(1, delta = 2) -``` - -## Pipelines - -It can be hard to read repeated function calls, because of all the nested brackets. - -```norun -i = 1 -x = h(g(f(i))) -``` - -You can make this easier to read by breaking it into many declarations, but that is a bit annoying. - -```norun -i = 1 -x0 = f(i) -x1 = g(x0) -x = h(x1) -``` - -Instead, you can use the pipeline operator (`|>`) to simplify this. - -Basically, `x |> f(%)` is a shorthand for `f(x)`. The left-hand side of the `|>` gets put into -the `%` in the right-hand side. - -So, this means `x |> f(%) |> g(%)` is shorthand for `g(f(x))`. The code example above, with its -somewhat-clunky `x0` and `x1` constants could be rewritten as - -```norun -i = 1 -x = i - |> f(%) - |> g(%) - |> h(%) -``` - -This helps keep your code neat and avoid unnecessary declarations. - -## Pipelines and keyword arguments - -Say you have a long pipeline of sketch functions, like this: - -```norun -startSketchOn(XZ) - |> line(%, end = [3, 4]) - |> line(%, end = [10, 10]) - |> line(%, end = [-13, -14]) - |> close(%) -``` - -In this example, each function call outputs a sketch, and it gets put into the next function call via -the `%`, into the first (unlabeled) argument. - -If a function call uses an unlabeled first parameter, it will default to `%` if it's not given. This -means that `|> line(%, end = [3, 4])` and `|> line(end = [3, 4])` are equivalent! So the above -could be rewritten as - -```norun -startSketchOn(XZ) - |> line(end = [3, 4]) - |> line(end = [10, 10]) - |> line(end = [-13, -14]) - |> close() -``` - -Note that we are still in the process of migrating KCL's standard library to use keyword arguments. So some -functions are still unfortunately using positional arguments. We're moving them over, so keep checking back. -Some functions are still using the old positional argument syntax. -Check the docs page for each function and look at its examples to see. - -## Tags - -Tags are used to give a name (tag) to a specific path. - -### `TagDeclarator` - -The syntax for declaring a tag is `$myTag` you would use it in the following -way: - -```norun -startSketchOn(XZ) - |> startProfile(at = origin) - |> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001) - |> angledLine( - angle = segAng(rectangleSegmentA001) - 90, - length = 196.99, - tag = $rectangleSegmentB001, - ) - |> angledLine( - angle = segAng(rectangleSegmentA001), - length = -segLen(rectangleSegmentA001), - tag = $rectangleSegmentC001, - ) - |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) - |> close() -``` - -### `TagIdentifier` - -As per the example above you can use the tag identifier to get a reference to the -tagged object. The syntax for this is `myTag`. - -In the example above we use the tag identifier to get the angle of the segment -`segAng(rectangleSegmentA001)`. - -### `Start` - -There is a special tag, `START` (with type `Start`, although under the cover, it's a string) -for identifying the face of a solid which was the start of an extrusion (i.e., the surface which -is extruded). - -### `End` - -There is a special tag, `END` (with type `End`, although under the cover, it's a string) -for identifying the face of a solid which was finishes an extrusion. - -### Tag Scope - -Tags are scoped globally if in the root context meaning in this example you can -use the tag `rectangleSegmentA001` in any function or expression in the file. - -However if the code was written like this: - -```norun -fn rect(origin) { - return startSketchOn(XZ) - |> startProfile(at = origin) - |> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001) - |> angledLine( - angle = segAng(rectangleSegmentA001) - 90, - length = 196.99, - tag = $rectangleSegmentB001, - ) - |> angledLine( - angle = segAng(rectangleSegmentA001), - length = -segLen(rectangleSegmentA001), - tag = $rectangleSegmentC001, - ) - |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) - |> close() -} - -rect(origin = [0, 0]) -rect(origin = [20, 0]) -``` - -Those tags would only be available in the `rect` function and not globally. - -However you likely want to use those tags somewhere outside the `rect` function. - -Tags are accessible through the sketch group they are declared in. -For example the following code works. - -```norun -fn rect(origin) { - return startSketchOn(XZ) - |> startProfile(at = origin) - |> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001) - |> angledLine( - angle = segAng(rectangleSegmentA001) - 90, - length = 196.99, - tag = $rectangleSegmentB001, - ) - |> angledLine( - angle = segAng(rectangleSegmentA001), - length = -segLen(rectangleSegmentA001), - tag = $rectangleSegmentC001, - ) - |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) - |> close() -} - -rect(origin = [0, 0]) -myRect = rect(origin = [20, 0]) - -myRect - |> extrude(length = 10) - |> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001]) -``` - -See how we use the tag `rectangleSegmentA001` in the `fillet` function outside -the `rect` function. This is because the `rect` function is returning the -sketch group that contains the tags. - - ---- - -If you find any issues using any of the above expressions or syntax, -please file an issue with the `ast` label on the [modeling-app -repo](https://github.com/KittyCAD/modeling-app/issues/new). diff --git a/docs/kcl/types/std-types-Point2d.md b/docs/kcl/types/std-types-Point2d.md deleted file mode 100644 index ebeb4a3dc..000000000 --- a/docs/kcl/types/std-types-Point2d.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "std::types::Point2d" -excerpt: "A point in two dimensional space." -layout: manual ---- - -A point in two dimensional space. - -```kcl -type Point2d = [number(Length); 2] -``` - -[`Point2d`](/docs/kcl/types/std-types-Point2d) is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value -with type [`Point2d`](/docs/kcl/types/std-types-Point2d), use an array, e.g., `[0, 0]` or `[5.0, 3.14]`. - - - diff --git a/docs/kcl/types/std-types-Point3d.md b/docs/kcl/types/std-types-Point3d.md deleted file mode 100644 index ea23e7c86..000000000 --- a/docs/kcl/types/std-types-Point3d.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "std::types::Point3d" -excerpt: "A point in three dimensional space." -layout: manual ---- - -A point in three dimensional space. - -```kcl -type Point3d = [number(Length); 3] -``` - -[`Point3d`](/docs/kcl/types/std-types-Point3d) is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value -with type [`Point3d`](/docs/kcl/types/std-types-Point3d), use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`. - - - diff --git a/rust/kcl-lib/src/docs/gen_std_tests.rs b/rust/kcl-lib/src/docs/gen_std_tests.rs index c4f5a477f..bf2631e00 100644 --- a/rust/kcl-lib/src/docs/gen_std_tests.rs +++ b/rust/kcl-lib/src/docs/gen_std_tests.rs @@ -8,10 +8,9 @@ use itertools::Itertools; use serde_json::json; use tokio::task::JoinSet; -use super::kcl_doc::{ConstData, DocData, ExampleProperties, FnData, TyData}; +use super::kcl_doc::{ConstData, DocData, ExampleProperties, FnData, ModData, TyData}; use crate::{docs::StdLibFn, std::StdLib, ExecutorContext}; -const LANG_TOPICS: [&str; 4] = ["Types", "Modules", "Settings", "Known Issues"]; // These types are declared in (KCL) std. const DECLARED_TYPES: [&str; 15] = [ "any", "number", "string", "tag", "bool", "Sketch", "Solid", "Plane", "Helix", "Face", "Edge", "Point2d", @@ -101,12 +100,13 @@ fn init_handlebars() -> Result> { hbs.register_template_string("index", include_str!("templates/index.hbs"))?; hbs.register_template_string("function", include_str!("templates/function.hbs"))?; hbs.register_template_string("const", include_str!("templates/const.hbs"))?; + hbs.register_template_string("module", include_str!("templates/module.hbs"))?; hbs.register_template_string("kclType", include_str!("templates/kclType.hbs"))?; Ok(hbs) } -fn generate_index(combined: &IndexMap>, kcl_lib: &[DocData]) -> Result<()> { +fn generate_index(combined: &IndexMap>, kcl_lib: &ModData) -> Result<()> { let hbs = init_handlebars()?; let mut functions = HashMap::new(); @@ -139,7 +139,7 @@ fn generate_index(combined: &IndexMap>, kcl_lib: &[Doc .push((name.to_owned(), format!("types#{name}"))); } - for d in kcl_lib { + for d in kcl_lib.all_docs() { if d.hide() { continue; } @@ -148,6 +148,7 @@ fn generate_index(combined: &IndexMap>, kcl_lib: &[Doc DocData::Fn(_) => functions.entry(d.mod_name()).or_default(), DocData::Ty(_) => types.entry(d.mod_name()).or_default(), DocData::Const(_) => constants.entry(d.mod_name()).or_default(), + DocData::Mod(_) => continue, }; group.push((d.preferred_name().to_owned(), d.file_name())); @@ -159,6 +160,7 @@ fn generate_index(combined: &IndexMap>, kcl_lib: &[Doc fns.sort(); let val = json!({ "name": m, + "file_name": m.replace("::", "-"), "items": fns.into_iter().map(|(n, f)| json!({ "name": n, "file_name": f, @@ -176,6 +178,7 @@ fn generate_index(combined: &IndexMap>, kcl_lib: &[Doc consts.sort(); let val = json!({ "name": m, + "file_name": m.replace("::", "-"), "items": consts.into_iter().map(|(n, f)| json!({ "name": n, "file_name": f, @@ -193,6 +196,7 @@ fn generate_index(combined: &IndexMap>, kcl_lib: &[Doc tys.sort(); let val = json!({ "name": m, + "file_name": m.replace("::", "-"), "items": tys.into_iter().map(|(n, f)| json!({ "name": n, "file_name": f, @@ -204,18 +208,7 @@ fn generate_index(combined: &IndexMap>, kcl_lib: &[Doc sorted_types.sort_by(|t1, t2| t1.0.cmp(&t2.0)); let types_data: Vec<_> = sorted_types.into_iter().map(|(_, val)| val).collect(); - let topics: Vec<_> = LANG_TOPICS - .iter() - .map(|name| { - json!({ - "name": name, - "file_name": name.to_lowercase().replace(' ', "-"), - }) - }) - .collect(); - let data = json!({ - "lang_topics": topics, "functions": functions_data, "consts": consts_data, "types": types_data, @@ -223,7 +216,7 @@ fn generate_index(combined: &IndexMap>, kcl_lib: &[Doc let output = hbs.render("index", &data)?; - expectorate::assert_contents("../../docs/kcl/index.md", &output); + expectorate::assert_contents("../../docs/kcl-std/index.md", &output); Ok(()) } @@ -280,7 +273,48 @@ fn generate_type_from_kcl(ty: &TyData, file_name: String, example_name: String) let output = hbs.render("kclType", &data)?; let output = cleanup_types(&output); - expectorate::assert_contents(format!("../../docs/kcl/{}.md", file_name), &output); + expectorate::assert_contents(format!("../../docs/kcl-std/{}.md", file_name), &output); + + Ok(()) +} + +fn generate_mod_from_kcl(m: &ModData, file_name: String) -> Result<()> { + fn list_items(m: &ModData, namespace: &str) -> Vec { + let mut items: Vec<_> = m + .children + .iter() + .filter(|(k, _)| k.starts_with(namespace)) + .map(|(_, v)| (v.preferred_name(), v.file_name())) + .collect(); + items.sort(); + items + .into_iter() + .map(|(n, f)| { + json!({ + "name": n, + "file_name": f, + }) + }) + .collect() + } + let hbs = init_handlebars()?; + + // TODO for prelude, items from Rust + let functions = list_items(m, "I:"); + let modules = list_items(m, "M:"); + let types = list_items(m, "T:"); + + let data = json!({ + "name": m.qual_name, + "summary": m.summary, + "description": m.description, + "modules": modules, + "functions": functions, + "types": types, + }); + + let output = hbs.render("module", &data)?; + expectorate::assert_contents(format!("../../docs/kcl-std/{}.md", file_name), &output); Ok(()) } @@ -326,7 +360,7 @@ fn generate_function_from_kcl(function: &FnData, file_name: String, example_name let output = hbs.render("function", &data)?; let output = &cleanup_types(&output); - expectorate::assert_contents(format!("../../docs/kcl/{}.md", file_name), output); + expectorate::assert_contents(format!("../../docs/kcl-std/{}.md", file_name), output); Ok(()) } @@ -355,7 +389,7 @@ fn generate_const_from_kcl(cnst: &ConstData, file_name: String, example_name: St }); let output = hbs.render("const", &data)?; - expectorate::assert_contents(format!("../../docs/kcl/{}.md", file_name), &output); + expectorate::assert_contents(format!("../../docs/kcl-std/{}.md", file_name), &output); Ok(()) } @@ -425,7 +459,7 @@ fn generate_function(internal_fn: Box) -> Result<()> { // Fix the links to the types. output = cleanup_types(&output); - expectorate::assert_contents(format!("../../docs/kcl/{}.md", fn_name), &output); + expectorate::assert_contents(format!("../../docs/kcl-std/{}.md", fn_name), &output); Ok(()) } @@ -577,9 +611,9 @@ fn cleanup_type_string(input: &str, fmt_for_text: bool) -> String { // we might want to restore the links by not checking `fmt_for_text` here. if fmt_for_text && SPECIAL_TYPES.contains(&ty) { - format!("[{prefix}{ty}{suffix}](/docs/kcl/types#{ty})") + format!("[{prefix}{ty}{suffix}](/docs/kcl-lang/types#{ty})") } else if fmt_for_text && DECLARED_TYPES.contains(&ty) { - format!("[{prefix}{ty}{suffix}](/docs/kcl/types/std-types-{ty})") + format!("[{prefix}{ty}{suffix}](/docs/kcl-std/types/std-types-{ty})") } else { format!("{prefix}{ty}{suffix}") } @@ -624,26 +658,22 @@ fn test_generate_stdlib_markdown_docs() { generate_function(internal_fn.clone()).unwrap(); } - for d in &kcl_std { + for d in kcl_std.all_docs() { match d { DocData::Fn(f) => generate_function_from_kcl(f, d.file_name(), d.example_name()).unwrap(), DocData::Const(c) => generate_const_from_kcl(c, d.file_name(), d.example_name()).unwrap(), DocData::Ty(t) => generate_type_from_kcl(t, d.file_name(), d.example_name()).unwrap(), + DocData::Mod(m) => generate_mod_from_kcl(m, d.file_name()).unwrap(), } } - - // Copy manually written docs to the output directory. - for entry in fs::read_dir("../../docs/kcl-src").unwrap() { - let path = entry.unwrap().path(); - fs::copy(&path, Path::new("../../docs/kcl").join(path.file_name().unwrap())).unwrap(); - } + generate_mod_from_kcl(&kcl_std, "modules/std".to_owned()).unwrap(); } #[test] fn test_generate_stdlib_json_schema() { // If this test fails and you've modified the AST or something else which affects the json repr // of stdlib functions, you should rerun the test with `EXPECTORATE=overwrite` to create new - // test data, then check `/docs/kcl/std.json` to ensure the changes are expected. + // test data, then check `/docs/kcl-std/std.json` to ensure the changes are expected. // Alternatively, run `just redo-kcl-stdlib-docs` (make sure to have just installed). let stdlib = StdLib::new(); let combined = stdlib.combined(); @@ -657,7 +687,7 @@ fn test_generate_stdlib_json_schema() { }) .collect(); expectorate::assert_contents( - "../../docs/kcl/std.json", + "../../docs/kcl-std/std.json", &serde_json::to_string_pretty(&json_data).unwrap(), ); } @@ -665,16 +695,16 @@ fn test_generate_stdlib_json_schema() { #[tokio::test(flavor = "multi_thread")] async fn test_code_in_topics() { let mut join_set = JoinSet::new(); - for name in LANG_TOPICS { - let filename = format!("../../docs/kcl/{}.md", name.to_lowercase().replace(' ', "-")); - let text = std::fs::read_to_string(&filename).unwrap(); + for entry in fs::read_dir("../../docs/kcl-lang").unwrap() { + let path = entry.unwrap().path(); + let text = std::fs::read_to_string(&path).unwrap(); - for (i, (eg, attr)) in find_examples(&text, &filename).into_iter().enumerate() { - if attr == "norun" { + for (i, (eg, attr)) in find_examples(&text, &path).into_iter().enumerate() { + if attr.contains("norun") || !attr.contains("kcl") { continue; } - let f = filename.clone(); + let f = path.display().to_string(); join_set.spawn(async move { (format!("{f}, example {i}"), run_example(&eg).await) }); } } @@ -687,7 +717,7 @@ async fn test_code_in_topics() { assert!(results.is_empty(), "Failures: {}", results.join(", ")) } -fn find_examples(text: &str, filename: &str) -> Vec<(String, String)> { +fn find_examples(text: &str, filename: &Path) -> Vec<(String, String)> { let mut buf = String::new(); let mut attr = String::new(); let mut in_eg = false; @@ -711,7 +741,7 @@ fn find_examples(text: &str, filename: &str) -> Vec<(String, String)> { } } - assert!(!in_eg, "Unclosed code tags in {}", filename); + assert!(!in_eg, "Unclosed code tags in {}", filename.display()); result } diff --git a/rust/kcl-lib/src/docs/kcl_doc.rs b/rust/kcl-lib/src/docs/kcl_doc.rs index e01e8b72b..4c2822e23 100644 --- a/rust/kcl-lib/src/docs/kcl_doc.rs +++ b/rust/kcl-lib/src/docs/kcl_doc.rs @@ -9,23 +9,14 @@ use tower_lsp::lsp_types::{ use crate::{ execution::annotations, parsing::{ - ast::types::{Annotation, ImportSelector, ItemVisibility, Node, VariableKind}, + ast::types::{Annotation, ImportSelector, ItemVisibility, Node, NonCodeValue, VariableKind}, token::NumericSuffix, }, ModuleId, }; -pub fn walk_prelude() -> Vec { - let mut visitor = CollectionVisitor::default(); - visitor.visit_module("prelude", "", WalkForNames::All).unwrap(); - visitor.result.into_values().collect() -} - -#[derive(Debug, Clone, Default)] -struct CollectionVisitor { - name: String, - result: HashMap, - id: usize, +pub fn walk_prelude() -> ModData { + visit_module("prelude", "", WalkForNames::All).unwrap() } #[derive(Clone, Debug)] @@ -50,93 +41,122 @@ impl<'a> WalkForNames<'a> { } } -impl CollectionVisitor { - fn visit_module(&mut self, name: &str, preferred_prefix: &str, names: WalkForNames) -> Result<(), String> { - let old_name = std::mem::replace(&mut self.name, name.to_owned()); - let source = crate::modules::read_std(name).unwrap(); - let parsed = crate::parsing::parse_str(source, ModuleId::from_usize(self.id)) - .parse_errs_as_err() - .unwrap(); - self.id += 1; +fn visit_module(name: &str, preferred_prefix: &str, names: WalkForNames) -> Result { + let mut result = ModData::new(name, preferred_prefix); - for n in &parsed.body { - if n.visibility() != ItemVisibility::Export { - continue; + let source = crate::modules::read_std(name).unwrap(); + let parsed = crate::parsing::parse_str(source, ModuleId::from_usize(0)) + .parse_errs_as_err() + .unwrap(); + + // TODO handle examples; use with_comments + let mut summary = String::new(); + let mut description = None; + for n in &parsed.non_code_meta.start_nodes { + match &n.value { + NonCodeValue::BlockComment { value, .. } if value.starts_with('/') => { + let line = value[1..].trim(); + if line.is_empty() { + match &mut description { + None => description = Some(String::new()), + Some(d) => d.push_str("\n\n"), + } + } else { + match &mut description { + None => { + summary.push_str(line); + summary.push(' '); + } + Some(d) => { + d.push_str(line); + d.push(' '); + } + } + } } - match n { - crate::parsing::ast::types::BodyItem::ImportStatement(import) => match &import.path { - crate::parsing::ast::types::ImportPath::Std { path } => match &import.selector { - ImportSelector::Glob(..) => self.visit_module(&path[1], "", names.clone())?, + _ => break, + } + } + if !summary.is_empty() { + result.summary = Some(summary); + } + result.description = description; + + for n in &parsed.body { + if n.visibility() != ItemVisibility::Export { + continue; + } + match n { + crate::parsing::ast::types::BodyItem::ImportStatement(import) => match &import.path { + crate::parsing::ast::types::ImportPath::Std { path } => { + let m = match &import.selector { + ImportSelector::Glob(..) => Some(visit_module(&path[1], "", names.clone())?), ImportSelector::None { .. } => { let name = import.module_name().unwrap(); if names.contains(&name) { - self.visit_module(&path[1], &format!("{}::", name), WalkForNames::All)?; + Some(visit_module(&path[1], &format!("{}::", name), WalkForNames::All)?) + } else { + None } } - ImportSelector::List { items } => { - self.visit_module(&path[1], "", names.intersect(items.iter().map(|n| &*n.name.name)))? - } - }, - p => return Err(format!("Unexpected import: `{p}`")), - }, - crate::parsing::ast::types::BodyItem::VariableDeclaration(var) => { - if !names.contains(var.name()) { - continue; - } - let qual_name = if self.name == "prelude" { - "std::".to_owned() - } else { - format!("std::{}::", self.name) + ImportSelector::List { items } => Some(visit_module( + &path[1], + "", + names.intersect(items.iter().map(|n| &*n.name.name)), + )?), }; - let mut dd = match var.kind { - VariableKind::Fn => DocData::Fn(FnData::from_ast(var, qual_name, preferred_prefix, name)), - VariableKind::Const => { - DocData::Const(ConstData::from_ast(var, qual_name, preferred_prefix, name)) - } - }; - let key = format!("I:{}", dd.qual_name()); - if self.result.contains_key(&key) { - continue; + if let Some(m) = m { + result.children.insert(format!("M:{}", m.qual_name), DocData::Mod(m)); } - - dd.with_meta(&var.outer_attrs); - for a in &var.outer_attrs { - dd.with_comments(&a.pre_comments); - } - dd.with_comments(n.get_comments()); - - self.result.insert(key, dd); } - crate::parsing::ast::types::BodyItem::TypeDeclaration(ty) => { - if !names.contains(ty.name()) { - continue; - } - let qual_name = if self.name == "prelude" { - "std::".to_owned() - } else { - format!("std::{}::", self.name) - }; - let mut dd = DocData::Ty(TyData::from_ast(ty, qual_name, preferred_prefix, name)); - let key = format!("T:{}", dd.qual_name()); - if self.result.contains_key(&key) { - continue; - } - - dd.with_meta(&ty.outer_attrs); - for a in &ty.outer_attrs { - dd.with_comments(&a.pre_comments); - } - dd.with_comments(n.get_comments()); - - self.result.insert(key, dd); + p => return Err(format!("Unexpected import: `{p}`")), + }, + crate::parsing::ast::types::BodyItem::VariableDeclaration(var) => { + if !names.contains(var.name()) { + continue; } - _ => {} + let qual = format!("{}::", &result.qual_name); + let mut dd = match var.kind { + VariableKind::Fn => DocData::Fn(FnData::from_ast(var, qual, preferred_prefix, name)), + VariableKind::Const => DocData::Const(ConstData::from_ast(var, qual, preferred_prefix, name)), + }; + let key = format!("I:{}", dd.qual_name()); + if result.children.contains_key(&key) { + continue; + } + + dd.with_meta(&var.outer_attrs); + for a in &var.outer_attrs { + dd.with_comments(&a.pre_comments); + } + dd.with_comments(n.get_comments()); + + result.children.insert(key, dd); } - } + crate::parsing::ast::types::BodyItem::TypeDeclaration(ty) => { + if !names.contains(ty.name()) { + continue; + } + let qual = format!("{}::", &result.qual_name); + let mut dd = DocData::Ty(TyData::from_ast(ty, qual, preferred_prefix, name)); + let key = format!("T:{}", dd.qual_name()); + if result.children.contains_key(&key) { + continue; + } - self.name = old_name; - Ok(()) + dd.with_meta(&ty.outer_attrs); + for a in &ty.outer_attrs { + dd.with_comments(&a.pre_comments); + } + dd.with_comments(n.get_comments()); + + result.children.insert(key, dd); + } + _ => {} + } } + + Ok(result) } #[derive(Debug, Clone)] @@ -144,6 +164,7 @@ pub enum DocData { Fn(FnData), Const(ConstData), Ty(TyData), + Mod(ModData), } impl DocData { @@ -152,6 +173,7 @@ impl DocData { DocData::Fn(f) => &f.name, DocData::Const(c) => &c.name, DocData::Ty(t) => &t.name, + DocData::Mod(m) => &m.name, } } @@ -161,6 +183,7 @@ impl DocData { DocData::Fn(f) => &f.preferred_name, DocData::Const(c) => &c.preferred_name, DocData::Ty(t) => &t.preferred_name, + DocData::Mod(m) => &m.preferred_name, } } @@ -169,6 +192,7 @@ impl DocData { DocData::Fn(f) => &f.qual_name, DocData::Const(c) => &c.qual_name, DocData::Ty(t) => &t.qual_name, + DocData::Mod(m) => &m.qual_name, } } @@ -179,6 +203,7 @@ impl DocData { DocData::Fn(f) => &f.module_name, DocData::Const(c) => &c.module_name, DocData::Ty(t) => &t.module_name, + DocData::Mod(m) => &m.module_name, } } @@ -188,6 +213,7 @@ impl DocData { DocData::Fn(f) => format!("functions/{}", f.qual_name.replace("::", "-")), DocData::Const(c) => format!("consts/{}", c.qual_name.replace("::", "-")), DocData::Ty(t) => format!("types/{}", t.qual_name.replace("::", "-")), + DocData::Mod(m) => format!("modules/{}", m.qual_name.replace("::", "-")), } } @@ -197,6 +223,7 @@ impl DocData { DocData::Fn(f) => format!("fn_{}", f.qual_name.replace("::", "-")), DocData::Const(c) => format!("const_{}", c.qual_name.replace("::", "-")), DocData::Ty(t) => format!("ty_{}", t.qual_name.replace("::", "-")), + DocData::Mod(_) => unimplemented!(), } } @@ -212,6 +239,7 @@ impl DocData { } &t.qual_name } + DocData::Mod(m) => &m.qual_name, }; q[0..q.rfind("::").unwrap()].to_owned() } @@ -222,14 +250,16 @@ impl DocData { DocData::Fn(f) => f.properties.doc_hidden || f.properties.deprecated, DocData::Const(c) => c.properties.doc_hidden || c.properties.deprecated, DocData::Ty(t) => t.properties.doc_hidden || t.properties.deprecated, + DocData::Mod(_) => false, } } - pub fn to_completion_item(&self) -> CompletionItem { + pub fn to_completion_item(&self) -> Option { match self { - DocData::Fn(f) => f.to_completion_item(), - DocData::Const(c) => c.to_completion_item(), - DocData::Ty(t) => t.to_completion_item(), + DocData::Fn(f) => Some(f.to_completion_item()), + DocData::Const(c) => Some(c.to_completion_item()), + DocData::Ty(t) => Some(t.to_completion_item()), + DocData::Mod(_) => None, } } @@ -238,6 +268,7 @@ impl DocData { DocData::Fn(f) => Some(f.to_signature_help()), DocData::Const(_) => None, DocData::Ty(_) => None, + DocData::Mod(_) => None, } } @@ -246,6 +277,7 @@ impl DocData { DocData::Fn(f) => f.with_meta(attrs), DocData::Const(c) => c.with_meta(attrs), DocData::Ty(t) => t.with_meta(attrs), + DocData::Mod(m) => m.with_meta(attrs), } } @@ -254,6 +286,7 @@ impl DocData { DocData::Fn(f) => f.with_comments(comments), DocData::Const(c) => c.with_comments(comments), DocData::Ty(t) => t.with_comments(comments), + DocData::Mod(m) => m.with_comments(comments), } } @@ -263,9 +296,17 @@ impl DocData { DocData::Fn(f) => f.examples.iter(), DocData::Const(c) => c.examples.iter(), DocData::Ty(t) => t.examples.iter(), + DocData::Mod(_) => unimplemented!(), } .filter_map(|(s, p)| (!p.norun).then_some(s)) } + + fn expect_mod(&self) -> &ModData { + match self { + DocData::Mod(m) => m, + _ => unreachable!(), + } + } } #[derive(Debug, Clone)] @@ -384,6 +425,70 @@ impl ConstData { } } +#[derive(Debug, Clone)] +pub struct ModData { + pub name: String, + /// How the module is indexed, etc. + pub preferred_name: String, + /// The fully qualified name. + pub qual_name: String, + /// The summary of the module. + pub summary: Option, + /// The description of the module. + pub description: Option, + pub module_name: String, + + pub children: HashMap, +} + +impl ModData { + fn new(name: &str, preferred_prefix: &str) -> Self { + let (qual_name, module_name) = if name == "prelude" { + ("std".to_owned(), String::new()) + } else { + (format!("std::{}", name), "std".to_owned()) + }; + Self { + preferred_name: format!("{preferred_prefix}{name}"), + name: name.to_owned(), + qual_name, + summary: None, + description: None, + children: HashMap::new(), + module_name, + } + } + + #[cfg(test)] + pub fn find_by_name(&self, name: &str) -> Option<&DocData> { + if let Some(result) = self.children.values().find(|dd| dd.name() == name) { + return Some(result); + } + + #[allow(clippy::iter_over_hash_type)] + for (k, v) in &self.children { + if k.starts_with("M:") { + if let Some(result) = v.expect_mod().find_by_name(name) { + return Some(result); + } + } + } + + None + } + + pub fn all_docs(&self) -> impl Iterator { + let result = self.children.values(); + // TODO really this should be recursive, currently assume std is only one module deep. + result.chain( + self.children + .iter() + .filter(|(k, _)| k.starts_with("M:")) + .flat_map(|(_, d)| d.expect_mod().children.values()), + ) + } +} + #[derive(Debug, Clone)] pub struct FnData { /// The name of the function. @@ -985,6 +1090,29 @@ impl ApplyMeta for FnData { } } +impl ApplyMeta for ModData { + fn apply_docs( + &mut self, + summary: Option, + description: Option, + examples: Vec<(String, ExampleProperties)>, + ) { + self.summary = summary; + self.description = description; + assert!(examples.is_empty()); + } + + fn deprecated(&mut self, deprecated: bool) { + assert!(!deprecated); + } + + fn doc_hidden(&mut self, doc_hidden: bool) { + assert!(!doc_hidden); + } + + fn impl_kind(&mut self, _: annotations::Impl) {} +} + impl ApplyMeta for TyData { fn apply_docs( &mut self, @@ -1050,16 +1178,14 @@ mod test { #[test] fn smoke() { let result = walk_prelude(); - for d in result { - if let DocData::Const(d) = d { - if d.name == "PI" { - assert!(d.value.unwrap().starts_with('3')); - assert_eq!(d.ty, Some("number(_?)".to_owned())); - assert_eq!(d.qual_name, "std::math::PI"); - assert!(d.summary.is_some()); - assert!(!d.examples.is_empty()); - return; - } + if let DocData::Const(d) = result.find_by_name("PI").unwrap() { + if d.name == "PI" { + assert!(d.value.as_ref().unwrap().starts_with('3')); + assert_eq!(d.ty, Some("number(_?)".to_owned())); + assert_eq!(d.qual_name, "std::math::PI"); + assert!(d.summary.is_some()); + assert!(!d.examples.is_empty()); + return; } } panic!("didn't find PI"); @@ -1088,8 +1214,19 @@ mod test { async fn kcl_test_examples() { let std = walk_prelude(); let mut errs = Vec::new(); - for d in std { - if d.module_name() != STD_MOD_NAME { + + let data = if STD_MOD_NAME == "prelude" { + &std + } else { + std.children + .get(&format!("M:std::{STD_MOD_NAME}")) + .unwrap() + .expect_mod() + }; + + #[allow(clippy::iter_over_hash_type)] + for d in data.children.values() { + if let DocData::Mod(_) = d { continue; } diff --git a/rust/kcl-lib/src/docs/mod.rs b/rust/kcl-lib/src/docs/mod.rs index b05ff0d95..4fd1d7c97 100644 --- a/rust/kcl-lib/src/docs/mod.rs +++ b/rust/kcl-lib/src/docs/mod.rs @@ -918,7 +918,7 @@ mod tests { #[test] fn get_autocomplete_snippet_fillet() { let data = kcl_doc::walk_prelude(); - let DocData::Fn(fillet_fn) = data.into_iter().find(|d| d.name() == "fillet").unwrap() else { + let DocData::Fn(fillet_fn) = data.find_by_name("fillet").unwrap() else { panic!(); }; let snippet = fillet_fn.to_autocomplete_snippet(); @@ -946,7 +946,7 @@ mod tests { #[test] fn get_autocomplete_snippet_revolve() { let data = kcl_doc::walk_prelude(); - let DocData::Fn(revolve_fn) = data.into_iter().find(|d| d.name() == "revolve").unwrap() else { + let DocData::Fn(revolve_fn) = data.find_by_name("revolve").unwrap() else { panic!(); }; let snippet = revolve_fn.to_autocomplete_snippet(); @@ -956,7 +956,7 @@ mod tests { #[test] fn get_autocomplete_snippet_circle() { let data = kcl_doc::walk_prelude(); - let DocData::Fn(circle_fn) = data.into_iter().find(|d| d.name() == "circle").unwrap() else { + let DocData::Fn(circle_fn) = data.find_by_name("circle").unwrap() else { panic!(); }; let snippet = circle_fn.to_autocomplete_snippet(); @@ -1027,7 +1027,7 @@ mod tests { #[test] fn get_autocomplete_snippet_helix() { let data = kcl_doc::walk_prelude(); - let DocData::Fn(helix_fn) = data.into_iter().find(|d| d.name() == "helix").unwrap() else { + let DocData::Fn(helix_fn) = data.find_by_name("helix").unwrap() else { panic!(); }; let snippet = helix_fn.to_autocomplete_snippet(); diff --git a/rust/kcl-lib/src/docs/templates/index.hbs b/rust/kcl-lib/src/docs/templates/index.hbs index f03800824..50bb94ac6 100644 --- a/rust/kcl-lib/src/docs/templates/index.hbs +++ b/rust/kcl-lib/src/docs/templates/index.hbs @@ -6,37 +6,31 @@ layout: manual ## Table of Contents -### Language - -{{#each lang_topics}} -* [`{{name}}`](kcl/{{file_name}}) -{{/each}} - ### Functions {{#each functions}} -* **{{name}}** +* [**{{name}}**](/docs/kcl-std/modules/{{file_name}}) {{#each items}} - * [`{{name}}`](kcl/{{file_name}}) + * [`{{name}}`](/docs/kcl-std/{{file_name}}) {{/each}} {{/each}} ### Constants {{#each consts}} -* **{{name}}** +* [**{{name}}**](/docs/kcl-std/modules/{{file_name}}) {{#each items}} - * [`{{name}}`](kcl/{{file_name}}) + * [`{{name}}`](/docs/kcl-std/{{file_name}}) {{/each}} {{/each}} ### Types -See also the [types overview](types) +See also the [types overview](/docs/kcl-lang/types) {{#each types}} -* **{{name}}** +* [**{{name}}**](/docs/kcl-std/modules/{{file_name}}) {{#each items}} - * [`{{name}}`](kcl/{{file_name}}) + * [`{{name}}`](/docs/kcl-std/{{file_name}}) {{/each}} {{/each}} \ No newline at end of file diff --git a/rust/kcl-lib/src/docs/templates/module.hbs b/rust/kcl-lib/src/docs/templates/module.hbs new file mode 100644 index 000000000..40e266677 --- /dev/null +++ b/rust/kcl-lib/src/docs/templates/module.hbs @@ -0,0 +1,33 @@ +--- +title: "{{name}}" +excerpt: "{{safe_yaml summary}}" +layout: manual +--- + +{{{summary}}} + +{{{description}}} + +{{#if modules}} +## Modules + +{{#each modules}} +* [`{{name}}`](/docs/kcl-std/{{file_name}}) +{{/each}} +{{/if}} + +{{#if functions}} +## Functions and constants + +{{#each functions}} +* [`{{name}}`](/docs/kcl-std/{{file_name}}) +{{/each}} +{{/if}} + +{{#if types}} +## Types + +{{#each types}} +* [`{{name}}`](/docs/kcl-std/{{file_name}}) +{{/each}} +{{/if}} diff --git a/rust/kcl-lib/src/lsp/kcl/mod.rs b/rust/kcl-lib/src/lsp/kcl/mod.rs index 51149fd2f..97564f136 100644 --- a/rust/kcl-lib/src/lsp/kcl/mod.rs +++ b/rust/kcl-lib/src/lsp/kcl/mod.rs @@ -41,7 +41,7 @@ use tower_lsp::{ }; use crate::{ - docs::kcl_doc::DocData, + docs::kcl_doc::ModData, errors::LspSuggestion, exec::KclValue, execution::{cache, kcl_value::FunctionSource}, @@ -1636,7 +1636,7 @@ impl LanguageServer for Backend { /// Get completions from our stdlib. pub fn get_completions_from_stdlib( stdlib: &crate::std::StdLib, - kcl_std: &[DocData], + kcl_std: &ModData, ) -> Result> { let mut completions = HashMap::new(); let combined = stdlib.combined(); @@ -1645,8 +1645,10 @@ pub fn get_completions_from_stdlib( completions.insert(internal_fn.name(), internal_fn.to_completion_item()?); } - for d in kcl_std { - completions.insert(d.name().to_owned(), d.to_completion_item()); + for d in kcl_std.all_docs() { + if let Some(ci) = d.to_completion_item() { + completions.insert(d.name().to_owned(), ci); + } } let variable_kinds = VariableKind::to_completion_items(); @@ -1658,7 +1660,7 @@ pub fn get_completions_from_stdlib( } /// Get signatures from our stdlib. -pub fn get_signatures_from_stdlib(stdlib: &crate::std::StdLib, kcl_std: &[DocData]) -> HashMap { +pub fn get_signatures_from_stdlib(stdlib: &crate::std::StdLib, kcl_std: &ModData) -> HashMap { let mut signatures = HashMap::new(); let combined = stdlib.combined(); @@ -1666,7 +1668,7 @@ pub fn get_signatures_from_stdlib(stdlib: &crate::std::StdLib, kcl_std: &[DocDat signatures.insert(internal_fn.name(), internal_fn.to_signature_help()); } - for d in kcl_std { + for d in kcl_std.all_docs() { if let Some(sig) = d.to_signature_help() { signatures.insert(d.name().to_owned(), sig); } @@ -1678,7 +1680,7 @@ pub fn get_signatures_from_stdlib(stdlib: &crate::std::StdLib, kcl_std: &[DocDat /// Get signatures from our stdlib. pub fn get_arg_maps_from_stdlib( stdlib: &crate::std::StdLib, - kcl_std: &[DocData], + kcl_std: &ModData, ) -> HashMap> { let mut result = HashMap::new(); let combined = stdlib.combined(); @@ -1712,7 +1714,7 @@ pub fn get_arg_maps_from_stdlib( } } - for _d in kcl_std { + for _d in kcl_std.all_docs() { // TODO add KCL std fns } diff --git a/rust/kcl-lib/src/settings/generate_settings_docs.rs b/rust/kcl-lib/src/settings/generate_settings_docs.rs index 20695567e..461bd7878 100644 --- a/rust/kcl-lib/src/settings/generate_settings_docs.rs +++ b/rust/kcl-lib/src/settings/generate_settings_docs.rs @@ -1,4 +1,4 @@ -use std::{fs, path::PathBuf}; +use std::path::PathBuf; use schemars::{gen::SchemaGenerator, JsonSchema}; use serde_json::{json, Value}; @@ -39,8 +39,8 @@ base_unit = "mm" text_wrapping = false "#; -const PROJECT_SETTINGS_DOC_PATH: &str = "../../docs/kcl/settings-project.md"; -const USER_SETTINGS_DOC_PATH: &str = "../../docs/kcl/settings-user.md"; +const PROJECT_SETTINGS_DOC_PATH: &str = "../../docs/kcl-lang/settings-project.md"; +const USER_SETTINGS_DOC_PATH: &str = "../../docs/kcl-lang/settings-user.md"; fn init_handlebars() -> handlebars::Handlebars<'static> { let mut hbs = handlebars::Handlebars::new(); @@ -118,15 +118,7 @@ fn init_handlebars() -> handlebars::Handlebars<'static> { hbs } -fn ensure_settings_dir() { - let settings_dir = PathBuf::from("../../docs/kcl/settings"); - if !settings_dir.exists() { - fs::create_dir_all(&settings_dir).expect("Failed to create settings directory"); - } -} - pub fn generate_settings_docs() { - ensure_settings_dir(); let hbs = init_handlebars(); // Generate project settings documentation diff --git a/rust/kcl-lib/std/prelude.kcl b/rust/kcl-lib/std/prelude.kcl index 258739885..752d92fc1 100644 --- a/rust/kcl-lib/std/prelude.kcl +++ b/rust/kcl-lib/std/prelude.kcl @@ -1,3 +1,8 @@ +/// The KCL standard library +/// +/// Contains frequently used constants, functions for interacting with the KittyCAD servers to +/// create sketches and geometry, and utility functions. + @no_std @settings(defaultLengthUnit = mm, kclVersion = 1.0) diff --git a/rust/kcl-lib/std/types.kcl b/rust/kcl-lib/std/types.kcl index 314fe4c12..c41102d37 100644 --- a/rust/kcl-lib/std/types.kcl +++ b/rust/kcl-lib/std/types.kcl @@ -240,13 +240,13 @@ export type Edge /// A point in two dimensional space. /// -/// `Point2d` is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value +/// `Point2d` is an alias for a two-element array of [number](/docs/kcl-std/types/std-types-number)s. To write a value /// with type `Point2d`, use an array, e.g., `[0, 0]` or `[5.0, 3.14]`. export type Point2d = [number(Length); 2] /// A point in three dimensional space. /// -/// `Point3d` is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value +/// `Point3d` is an alias for a three-element array of [number](/docs/kcl-std/types/std-types-number)s. To write a value /// with type `Point3d`, use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`. export type Point3d = [number(Length); 3] diff --git a/rust/kcl-lib/std/units.kcl b/rust/kcl-lib/std/units.kcl index fc0e98d14..6f4aaca69 100644 --- a/rust/kcl-lib/std/units.kcl +++ b/rust/kcl-lib/std/units.kcl @@ -1,3 +1,5 @@ +/// Functions for converting numbers to different units. + @no_std @settings(defaultLengthUnit = mm, kclVersion = 1.0)