Docs content (#6792)
* Add documentation to modules, and some constants and types Signed-off-by: Nick Cameron <nrc@ncameron.org> * Improve the language reference Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Axis2d"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "An infinite line in 2d space."
|
||||
excerpt: "An abstract and infinite line in 2d space."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
An infinite line in 2d space.
|
||||
An abstract and infinite line in 2d space.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Axis3d"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "An infinite line in 3d space."
|
||||
excerpt: "An abstract and infinite line in 3d space."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
An infinite line in 3d space.
|
||||
An abstract and infinite line in 3d space.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Edge"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "The edge of a solid."
|
||||
excerpt: "An edge of a solid."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
The edge of a solid.
|
||||
An edge of a solid.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Face"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A face."
|
||||
excerpt: "A face of a solid."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A face.
|
||||
A face of a solid.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Helix"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A helix."
|
||||
excerpt: "A helix; created by the `helix` function."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A helix.
|
||||
A helix; created by the `helix` function.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
---
|
||||
title: "Plane"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A plane."
|
||||
excerpt: "An abstract plane."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A plane.
|
||||
|
||||
|
||||
An abstract plane.
|
||||
|
||||
A plane has a position and orientation in space defined by its origin and axes. A plane can be used
|
||||
to sketch on.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "Solid"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A solid is a collection of extrude surfaces."
|
||||
excerpt: "A solid is a collection of extruded surfaces."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A solid is a collection of extrude surfaces.
|
||||
A solid is a collection of extruded surfaces.
|
||||
|
||||
When you define a solid to a variable like:
|
||||
|
||||
|
||||
@ -1,13 +1,28 @@
|
||||
---
|
||||
title: "any"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Any value."
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Any value.
|
||||
|
||||
|
||||
|
||||
|
||||
The [`any`](/docs/kcl-std/types/std-types-any) type is the type of all possible values in KCL. I.e., if a function accepts an argument
|
||||
with type [`any`](/docs/kcl-std/types/std-types-any), then it can accept any value.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
```kcl
|
||||
fn acceptAnything(@input: any) {
|
||||
return true
|
||||
}
|
||||
|
||||
acceptAnything(42)
|
||||
acceptAnything('hello')
|
||||
acceptAnything(XY)
|
||||
acceptAnything([0, 1, 2])
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ layout: manual
|
||||
|
||||
A boolean value.
|
||||
|
||||
`true` or `false`
|
||||
`true` or `false`.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,15 +1,28 @@
|
||||
---
|
||||
title: "number"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A number"
|
||||
excerpt: "A number."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A number
|
||||
A number.
|
||||
|
||||
May be signed or unsigned, an integer or decimal value.
|
||||
|
||||
You may see a number type with units, e.g., [`number(mm)`](/docs/kcl-std/types/std-types-number). These are currently experimental.
|
||||
KCL numbers always include units, e.g., the number `42` is always '42 mm' or '42 degrees', etc.
|
||||
it is never just '42'. The [`number`](/docs/kcl-std/types/std-types-number) type may or may not include units, if none are specified, then
|
||||
it is the type of any number. E.g.,
|
||||
|
||||
- [`number`](/docs/kcl-std/types/std-types-number): the type of any numbers,
|
||||
- [`number(mm)`](/docs/kcl-std/types/std-types-number): the type of numbers in millimeters,
|
||||
- [`number(in)`](/docs/kcl-std/types/std-types-number): the type of numbers in inches,
|
||||
- [`number(Length)`](/docs/kcl-std/types/std-types-number): the type of numbers in any length unit,
|
||||
- [`number(deg)`](/docs/kcl-std/types/std-types-number): the type of numbers in degrees,
|
||||
- [`number(Angle)`](/docs/kcl-std/types/std-types-number): the type of numbers in any angle unit,
|
||||
- [`number(_)`](/docs/kcl-std/types/std-types-number) or [`number(Count)`](/docs/kcl-std/types/std-types-number): the type of unit-less numbers, representing a count of things,
|
||||
or a ratio, etc.
|
||||
|
||||
For more information, see [numeric types](/docs/kcl-lang/numeric).
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user