Skip to content

Commit c605389

Browse files
committed
Turn on uom checks
Signed-off-by: Nick Cameron <[email protected]>
1 parent 1628ea8 commit c605389

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+16835
-2074
lines changed

Diff for: docs/kcl/fromCm.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ excerpt: "Converts a number from centimeters to the current default unit."
44
layout: manual
55
---
66

7+
**WARNING:** This function is deprecated.
8+
79
Converts a number from centimeters to the current default unit.
810

11+
*DEPRECATED* prefer using explicit numberic suffixes (e.g., `42cm`) or the `to...` conversion functions.
12+
913
No matter what units the current file uses, this function will always return a number equivalent to the input in centimeters.
1014

1115
For example, if the current file uses inches, `fromCm(1)` will return `0.393701`. If the current file uses millimeters, `fromCm(1)` will return `10`. If the current file uses centimeters, `fromCm(1)` will return `1`.

Diff for: docs/kcl/fromFt.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ excerpt: "Converts a number from feet to the current default unit."
44
layout: manual
55
---
66

7+
**WARNING:** This function is deprecated.
8+
79
Converts a number from feet to the current default unit.
810

11+
*DEPRECATED* prefer using explicit numberic suffixes (e.g., `42ft`) or the `to...` conversion functions.
12+
913
No matter what units the current file uses, this function will always return a number equivalent to the input in feet.
1014

1115
For example, if the current file uses inches, `fromFt(1)` will return `12`. If the current file uses millimeters, `fromFt(1)` will return `304.8`. If the current file uses feet, `fromFt(1)` will return `1`.

Diff for: docs/kcl/fromInches.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ excerpt: "Converts a number from inches to the current default unit."
44
layout: manual
55
---
66

7+
**WARNING:** This function is deprecated.
8+
79
Converts a number from inches to the current default unit.
810

11+
*DEPRECATED* prefer using explicit numberic suffixes (e.g., `42inch`) or the `to...` conversion functions.
12+
913
No matter what units the current file uses, this function will always return a number equivalent to the input in inches.
1014

1115
For example, if the current file uses inches, `fromInches(1)` will return `1`. If the current file uses millimeters, `fromInches(1)` will return `25.4`.

Diff for: docs/kcl/fromM.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ excerpt: "Converts a number from meters to the current default unit."
44
layout: manual
55
---
66

7+
**WARNING:** This function is deprecated.
8+
79
Converts a number from meters to the current default unit.
810

11+
*DEPRECATED* prefer using explicit numberic suffixes (e.g., `42m`) or the `to...` conversion functions.
12+
913
No matter what units the current file uses, this function will always return a number equivalent to the input in meters.
1014

1115
For example, if the current file uses inches, `fromM(1)` will return `39.3701`. If the current file uses millimeters, `fromM(1)` will return `1000`. If the current file uses meters, `fromM(1)` will return `1`.

Diff for: docs/kcl/fromMm.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ excerpt: "Converts a number from mm to the current default unit."
44
layout: manual
55
---
66

7+
**WARNING:** This function is deprecated.
8+
79
Converts a number from mm to the current default unit.
810

11+
*DEPRECATED* prefer using explicit numberic suffixes (e.g., `42mm`) or the `to...` conversion functions.
12+
913
No matter what units the current file uses, this function will always return a number equivalent to the input in millimeters.
1014

1115
For example, if the current file uses inches, `fromMm(1)` will return `1/25.4`. If the current file uses millimeters, `fromMm(1)` will return `1`.

Diff for: docs/kcl/fromYd.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ excerpt: "Converts a number from yards to the current default unit."
44
layout: manual
55
---
66

7+
**WARNING:** This function is deprecated.
8+
79
Converts a number from yards to the current default unit.
810

11+
*DEPRECATED* prefer using explicit numberic suffixes (e.g., `42yd`) or the `to...` conversion functions.
12+
913
No matter what units the current file uses, this function will always return a number equivalent to the input in yards.
1014

1115
For example, if the current file uses inches, `fromYd(1)` will return `36`. If the current file uses millimeters, `fromYd(1)` will return `914.4`. If the current file uses yards, `fromYd(1)` will return `1`.

Diff for: docs/kcl/index.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ layout: manual
6666
* [`extrude`](kcl/extrude)
6767
* [`fillet`](kcl/fillet)
6868
* [`floor`](kcl/floor)
69-
* [`fromCm`](kcl/fromCm)
70-
* [`fromFt`](kcl/fromFt)
71-
* [`fromInches`](kcl/fromInches)
72-
* [`fromM`](kcl/fromM)
73-
* [`fromMm`](kcl/fromMm)
74-
* [`fromYd`](kcl/fromYd)
7569
* [`getCommonEdge`](kcl/getCommonEdge)
7670
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
7771
* [`getOppositeEdge`](kcl/getOppositeEdge)
@@ -131,8 +125,14 @@ layout: manual
131125
* [`sweep`](kcl/sweep)
132126
* [`tangentToEnd`](kcl/tangentToEnd)
133127
* [`tangentialArc`](kcl/tangentialArc)
134-
* [`toDegrees`](kcl/toDegrees)
135-
* [`toRadians`](kcl/toRadians)
128+
* [`toCentimeters`](kcl/std-toCentimeters)
129+
* [`toDegrees`](kcl/std-toDegrees)
130+
* [`toFeet`](kcl/std-toFeet)
131+
* [`toInches`](kcl/std-toInches)
132+
* [`toMeters`](kcl/std-toMeters)
133+
* [`toMillimeters`](kcl/std-toMillimeters)
134+
* [`toRadians`](kcl/std-toRadians)
135+
* [`toYards`](kcl/std-toYards)
136136
* [`translate`](kcl/translate)
137137
* [`union`](kcl/union)
138138
* [`xLine`](kcl/xLine)

Diff for: docs/kcl/patternTransform.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ t = 0.005 // taper factor [0-1)
174174
// Defines how to modify each layer of the vase.
175175
// Each replica is shifted up the Z axis, and has a smoothly-varying radius
176176
fn transform(replicaId) {
177-
scale = r * abs(1 - (t * replicaId)) * (5 + cos(replicaId / 8))
177+
scale = r * abs(1 - (t * replicaId)) * (5 + cos(replicaId / 8: number(rad)))
178178
return {
179179
translate = [0, 0, replicaId * 10],
180180
scale = [scale, scale, 0]

Diff for: docs/kcl/std-helix.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ helix(
2626
| Name | Type | Description | Required |
2727
|----------|------|-------------|----------|
2828
| `revolutions` | `number(_)` | Number of revolutions. | Yes |
29-
| `angleStart` | `number(Angle)` | Start angle (in degrees). | Yes |
29+
| `angleStart` | `number(Angle)` | Start angle. | Yes |
3030
| `ccw` | [`bool`](/docs/kcl/types/bool) | Is the helix rotation counter clockwise? The default is `false`. | No |
3131
| `radius` | `number(Length)` | Radius of the helix. | No |
3232
| `axis` | `Axis3d | Edge` | Axis to use for the helix. | No |

Diff for: docs/kcl/std-math-cos.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exampleSketch = startSketchOn(XZ)
3131
|> startProfileAt([0, 0], %)
3232
|> angledLine(
3333
angle = 30,
34-
length = 3 / cos(toRadians(30)),
34+
length = 3 / cos(30deg),
3535
)
3636
|> yLine(endAbsolute = 0)
3737
|> close()

Diff for: docs/kcl/std-math-polar.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cartesian (x/y/z grid) coordinates.
1111

1212
```js
1313
polar(
14-
angle: number(Angle),
14+
angle: number(rad),
1515
length: number(Length),
1616
): Point2d
1717
```
@@ -21,7 +21,7 @@ polar(
2121

2222
| Name | Type | Description | Required |
2323
|----------|------|-------------|----------|
24-
| `angle` | `number(Angle)` | | Yes |
24+
| `angle` | `number(rad)` | | Yes |
2525
| `length` | `number(Length)` | | Yes |
2626

2727
### Returns

Diff for: docs/kcl/std-math-sin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exampleSketch = startSketchOn(XZ)
3131
|> startProfileAt([0, 0], %)
3232
|> angledLine(
3333
angle = 50,
34-
length = 15 / sin(toRadians(135)),
34+
length = 15 / sin(135deg),
3535
)
3636
|> yLine(endAbsolute = 0)
3737
|> close()

Diff for: docs/kcl/std-math-tan.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exampleSketch = startSketchOn(XZ)
3131
|> startProfileAt([0, 0], %)
3232
|> angledLine(
3333
angle = 50,
34-
length = 50 * tan(1/2),
34+
length = 50 * tan((1/2): number(rad)),
3535
)
3636
|> yLine(endAbsolute = 0)
3737
|> close()

Diff for: docs/kcl/std-toCentimeters.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "std::toCentimeters"
3+
excerpt: "Convert a number to centimeters from its current units."
4+
layout: manual
5+
---
6+
7+
Convert a number to centimeters from its current units.
8+
9+
10+
11+
```js
12+
toCentimeters(@num: number(cm)): number(cm)
13+
```
14+
15+
16+
### Arguments
17+
18+
| Name | Type | Description | Required |
19+
|----------|------|-------------|----------|
20+
| `num` | `number(cm)` | | Yes |
21+
22+
### Returns
23+
24+
`number(cm)`
25+
26+
27+

Diff for: docs/kcl/std-toDegrees.md

+44
Large diffs are not rendered by default.

Diff for: docs/kcl/std-toFeet.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "std::toFeet"
3+
excerpt: "Convert a number to feet from its current units."
4+
layout: manual
5+
---
6+
7+
Convert a number to feet from its current units.
8+
9+
10+
11+
```js
12+
toFeet(@num: number(ft)): number(ft)
13+
```
14+
15+
16+
### Arguments
17+
18+
| Name | Type | Description | Required |
19+
|----------|------|-------------|----------|
20+
| `num` | `number(ft)` | | Yes |
21+
22+
### Returns
23+
24+
`number(ft)`
25+
26+
27+

Diff for: docs/kcl/std-toInches.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "std::toInches"
3+
excerpt: "Convert a number to inches from its current units."
4+
layout: manual
5+
---
6+
7+
Convert a number to inches from its current units.
8+
9+
10+
11+
```js
12+
toInches(@num: number(in)): number(in)
13+
```
14+
15+
16+
### Arguments
17+
18+
| Name | Type | Description | Required |
19+
|----------|------|-------------|----------|
20+
| `num` | `number(in)` | | Yes |
21+
22+
### Returns
23+
24+
`number(in)`
25+
26+
27+

Diff for: docs/kcl/std-toMeters.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "std::toMeters"
3+
excerpt: "Convert a number to meters from its current units."
4+
layout: manual
5+
---
6+
7+
Convert a number to meters from its current units.
8+
9+
10+
11+
```js
12+
toMeters(@num: number(m)): number(m)
13+
```
14+
15+
16+
### Arguments
17+
18+
| Name | Type | Description | Required |
19+
|----------|------|-------------|----------|
20+
| `num` | `number(m)` | | Yes |
21+
22+
### Returns
23+
24+
`number(m)`
25+
26+
27+

Diff for: docs/kcl/std-toMillimeters.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "std::toMillimeters"
3+
excerpt: "Convert a number to millimeters from its current units."
4+
layout: manual
5+
---
6+
7+
Convert a number to millimeters from its current units.
8+
9+
10+
11+
```js
12+
toMillimeters(@num: number(mm)): number(mm)
13+
```
14+
15+
16+
### Arguments
17+
18+
| Name | Type | Description | Required |
19+
|----------|------|-------------|----------|
20+
| `num` | `number(mm)` | | Yes |
21+
22+
### Returns
23+
24+
`number(mm)`
25+
26+
27+

Diff for: docs/kcl/std-toRadians.md

+44
Large diffs are not rendered by default.

Diff for: docs/kcl/std-toYards.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "std::toYards"
3+
excerpt: "Converts a number to yards from its current units."
4+
layout: manual
5+
---
6+
7+
Converts a number to yards from its current units.
8+
9+
10+
11+
```js
12+
toYards(@num: number(yd)): number(yd)
13+
```
14+
15+
16+
### Arguments
17+
18+
| Name | Type | Description | Required |
19+
|----------|------|-------------|----------|
20+
| `num` | `number(yd)` | | Yes |
21+
22+
### Returns
23+
24+
`number(yd)`
25+
26+
27+

0 commit comments

Comments
 (0)