Fix bad links in docs code blocks (#6649)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-02 16:00:27 +12:00
committed by GitHub
parent 819ee23565
commit 6866c9d418
87 changed files with 289 additions and 285 deletions

View File

@ -12,7 +12,7 @@ to other modules.
```kcl ```kcl
// util.kcl // util.kcl
export fn increment(x) { export fn increment(@x) {
return x + 1 return x + 1
} }
``` ```
@ -37,11 +37,11 @@ Multiple functions can be exported in a file.
```kcl ```kcl
// util.kcl // util.kcl
export fn increment(x) { export fn increment(@x) {
return x + 1 return x + 1
} }
export fn decrement(x) { export fn decrement(@x) {
return x - 1 return x - 1
} }
``` ```
@ -81,7 +81,7 @@ fn cube(center) {
|> extrude(length = 10) |> extrude(length = 10)
} }
myCube = cube([0, 0]) myCube = cube(center = [0, 0])
``` ```
*Pros* *Pros*

View File

@ -249,8 +249,8 @@ fn rect(origin) {
|> close() |> close()
} }
rect([0, 0]) rect(origin = [0, 0])
rect([20, 0]) rect(origin = [20, 0])
``` ```
Those tags would only be available in the `rect` function and not globally. Those tags would only be available in the `rect` function and not globally.
@ -279,8 +279,8 @@ fn rect(origin) {
|> close() |> close()
} }
rect([0, 0]) rect(origin = [0, 0])
myRect = rect([20, 0]) myRect = rect(origin = [20, 0])
myRect myRect
|> extrude(length = 10) |> extrude(length = 10)

View File

@ -10,15 +10,15 @@ Draw a line segment relative to the current origin using the polar measure of so
```kcl ```kcl
angledLine( angledLine(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
angle: [number](/docs/kcl/types/std-types-number), angle: number,
length?: [number](/docs/kcl/types/std-types-number), length?: number,
lengthX?: [number](/docs/kcl/types/std-types-number), lengthX?: number,
lengthY?: [number](/docs/kcl/types/std-types-number), lengthY?: number,
endAbsoluteX?: [number](/docs/kcl/types/std-types-number), endAbsoluteX?: number,
endAbsoluteY?: [number](/docs/kcl/types/std-types-number), endAbsoluteY?: number,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -10,12 +10,12 @@ Draw an angled line from the current origin, constructing a line segment such th
```kcl ```kcl
angledLineThatIntersects( angledLineThatIntersects(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
angle: [number](/docs/kcl/types/std-types-number), angle: number,
intersectTag: [TagIdentifier](/docs/kcl/types#TagIdentifier), intersectTag: TagIdentifier,
offset?: [number](/docs/kcl/types/std-types-number), offset?: number,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -10,11 +10,11 @@ This will work on any solid, including extruded solids, revolved solids, and she
```kcl ```kcl
appearance( appearance(
solids: [[Solid]](/docs/kcl/types/std-types-Solid) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry), solids: [Solid] | ImportedGeometry,
color: [string](/docs/kcl/types/std-types-string), color: string,
metalness?: [number](/docs/kcl/types/std-types-number), metalness?: number,
roughness?: [number](/docs/kcl/types/std-types-number), roughness?: number,
): [[Solid]](/docs/kcl/types/std-types-Solid) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry) ): [Solid] | ImportedGeometry
``` ```

View File

@ -12,14 +12,14 @@ Unless this makes a lot of sense and feels like what you're looking for to const
```kcl ```kcl
arc( arc(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
angleStart?: [number](/docs/kcl/types/std-types-number), angleStart?: number,
angleEnd?: [number](/docs/kcl/types/std-types-number), angleEnd?: number,
radius?: [number](/docs/kcl/types/std-types-number), radius?: number,
interiorAbsolute?: [Point2d](/docs/kcl/types/std-types-Point2d), interiorAbsolute?: Point2d,
endAbsolute?: [Point2d](/docs/kcl/types/std-types-Point2d), endAbsolute?: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -10,14 +10,14 @@ Check a value meets some expected conditions at runtime. Program terminates with
```kcl ```kcl
assert( assert(
actual: [number](/docs/kcl/types/std-types-number), actual: number,
isGreaterThan?: [number](/docs/kcl/types/std-types-number), isGreaterThan?: number,
isLessThan?: [number](/docs/kcl/types/std-types-number), isLessThan?: number,
isGreaterThanOrEqual?: [number](/docs/kcl/types/std-types-number), isGreaterThanOrEqual?: number,
isLessThanOrEqual?: [number](/docs/kcl/types/std-types-number), isLessThanOrEqual?: number,
isEqualTo?: [number](/docs/kcl/types/std-types-number), isEqualTo?: number,
tolerance?: [number](/docs/kcl/types/std-types-number), tolerance?: number,
error?: [string](/docs/kcl/types/std-types-string), error?: string,
): () ): ()
``` ```

View File

@ -10,8 +10,8 @@ Asserts that a value is the boolean value true.
```kcl ```kcl
assertIs( assertIs(
actual: [bool](/docs/kcl/types/std-types-bool), actual: bool,
error?: [string](/docs/kcl/types/std-types-string), error?: string,
): () ): ()
``` ```

View File

@ -10,12 +10,12 @@ Draw a smooth, continuous, curved line segment from the current origin to the de
```kcl ```kcl
bezierCurve( bezierCurve(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
control1: [Point2d](/docs/kcl/types/std-types-Point2d), control1: Point2d,
control2: [Point2d](/docs/kcl/types/std-types-Point2d), control2: Point2d,
end: [Point2d](/docs/kcl/types/std-types-Point2d), end: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -10,12 +10,12 @@ Construct a circle derived from 3 points.
```kcl ```kcl
circleThreePoint( circleThreePoint(
sketchSurfaceOrGroup: [Sketch](/docs/kcl/types/std-types-Sketch) | [Plane](/docs/kcl/types/std-types-Plane) | [Face](/docs/kcl/types/std-types-Face), sketchSurfaceOrGroup: Sketch | Plane | Face,
p1: [Point2d](/docs/kcl/types/std-types-Point2d), p1: Point2d,
p2: [Point2d](/docs/kcl/types/std-types-Point2d), p2: Point2d,
p3: [Point2d](/docs/kcl/types/std-types-Point2d), p3: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -13,7 +13,7 @@ This doesn't really have much utility unless you need the equivalent of a double
Really only use this function if YOU ARE SURE you need it. In most cases you do not need clone and using a pattern with `instance = 2` is more appropriate. Really only use this function if YOU ARE SURE you need it. In most cases you do not need clone and using a pattern with `instance = 2` is more appropriate.
```kcl ```kcl
clone(geometry: [Solid](/docs/kcl/types/std-types-Solid) | [Sketch](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry)): [Solid](/docs/kcl/types/std-types-Solid) | [Sketch](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry) clone(geometry: Solid | Sketch | ImportedGeometry): Solid | Sketch | ImportedGeometry
``` ```

View File

@ -10,9 +10,9 @@ Construct a line segment from the current origin back to the profile's origin, e
```kcl ```kcl
close( close(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -10,13 +10,13 @@ You can provide more than one sketch to extrude, and they will all be extruded i
```kcl ```kcl
extrude( extrude(
sketches: [[Sketch]](/docs/kcl/types/std-types-Sketch), sketches: [Sketch],
length: [number](/docs/kcl/types/std-types-number), length: number,
symmetric?: [bool](/docs/kcl/types/std-types-bool), symmetric?: bool,
bidirectionalLength?: [number](/docs/kcl/types/std-types-number), bidirectionalLength?: number,
tagStart?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tagStart?: TagDeclarator,
tagEnd?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tagEnd?: TagDeclarator,
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -12,12 +12,12 @@ Create a helix.
helix( helix(
revolutions: number(_), revolutions: number(_),
angleStart: number(Angle), angleStart: number(Angle),
ccw?: [bool](/docs/kcl/types/std-types-bool), ccw?: bool,
radius?: number(Length), radius?: number(Length),
axis?: [Axis3d](/docs/kcl/types/std-types-Axis3d) | [Edge](/docs/kcl/types/std-types-Edge), axis?: Axis3d | Edge,
length?: number(Length), length?: number(Length),
cylinder?: [Solid](/docs/kcl/types/std-types-Solid), cylinder?: Solid,
): [Helix](/docs/kcl/types/std-types-Helix) ): Helix
``` ```

View File

@ -9,7 +9,7 @@ Compute the absolute value of a number.
```kcl ```kcl
abs(@input: [number](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) abs(@input: number): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the smallest integer greater than or equal to a number.
```kcl ```kcl
ceil(@input: [number](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) ceil(@input: number): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the largest integer less than or equal to a number.
```kcl ```kcl
floor(@input: [number](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) floor(@input: number): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the natural logarithm of the number.
```kcl ```kcl
ln(@input: [number](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) ln(@input: number): number
``` ```

View File

@ -12,9 +12,9 @@ and `log10` can produce more accurate results for base 10.
```kcl ```kcl
log( log(
@input: [number](/docs/kcl/types/std-types-number), @input: number,
base: number(_), base: number(_),
): [number](/docs/kcl/types/std-types-number) ): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the base 10 logarithm of the number.
```kcl ```kcl
log10(@input: [number](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) log10(@input: number): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the base 2 logarithm of the number.
```kcl ```kcl
log2(@input: [number](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) log2(@input: number): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the maximum of the given arguments.
```kcl ```kcl
max(@input: [[number; 1+]](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) max(@input: [number; 1+]): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the minimum of the given arguments.
```kcl ```kcl
min(@input: [[number; 1+]](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) min(@input: [number; 1+]): number
``` ```

View File

@ -13,7 +13,7 @@ cartesian (x/y/z grid) coordinates.
polar( polar(
angle: number(rad), angle: number(rad),
length: number(Length), length: number(Length),
): [Point2d](/docs/kcl/types/std-types-Point2d) ): Point2d
``` ```

View File

@ -10,9 +10,9 @@ Compute the number to a power.
```kcl ```kcl
pow( pow(
@input: [number](/docs/kcl/types/std-types-number), @input: number,
exp: number(_), exp: number(_),
): [number](/docs/kcl/types/std-types-number) ): number
``` ```

View File

@ -11,9 +11,9 @@ If `num` is negative, the result will be too.
```kcl ```kcl
rem( rem(
@num: [number](/docs/kcl/types/std-types-number), @num: number,
divisor: [number](/docs/kcl/types/std-types-number), divisor: number,
): [number](/docs/kcl/types/std-types-number) ): number
``` ```

View File

@ -9,7 +9,7 @@ Round a number to the nearest integer.
```kcl ```kcl
round(@input: [number](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) round(@input: number): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the square root of a number.
```kcl ```kcl
sqrt(@input: [number](/docs/kcl/types/std-types-number)): [number](/docs/kcl/types/std-types-number) sqrt(@input: number): number
``` ```

View File

@ -11,9 +11,9 @@ plane and 10 units away from it.
```kcl ```kcl
offsetPlane( offsetPlane(
@plane: [Plane](/docs/kcl/types/std-types-Plane), @plane: Plane,
offset: number(Length), offset: number(Length),
): [Plane](/docs/kcl/types/std-types-Plane) ): Plane
``` ```

View File

@ -19,15 +19,15 @@ revolved around the same axis.
```kcl ```kcl
revolve( revolve(
@sketches: [[Sketch; 1+]](/docs/kcl/types/std-types-Sketch), @sketches: [Sketch; 1+],
axis: [Axis2d](/docs/kcl/types/std-types-Axis2d) | [Edge](/docs/kcl/types/std-types-Edge), axis: Axis2d | Edge,
angle?: number(Angle), angle?: number(Angle),
tolerance?: number(Length), tolerance?: number(Length),
symmetric?: [bool](/docs/kcl/types/std-types-bool), symmetric?: bool,
bidirectionalAngle?: number(Angle), bidirectionalAngle?: number(Angle),
tagStart?: [tag](/docs/kcl/types/std-types-tag), tagStart?: tag,
tagEnd?: [tag](/docs/kcl/types/std-types-tag), tagEnd?: tag,
): [Solid](/docs/kcl/types/std-types-Solid) ): Solid
``` ```

View File

@ -11,11 +11,11 @@ the provided (x, y) origin point.
```kcl ```kcl
circle( circle(
@sketch_or_surface: [Sketch](/docs/kcl/types/std-types-Sketch) | [Plane](/docs/kcl/types/std-types-Plane) | [Face](/docs/kcl/types/std-types-Face), @sketch_or_surface: Sketch | Plane | Face,
center: [Point2d](/docs/kcl/types/std-types-Point2d), center: Point2d,
radius: number(Length), radius: number(Length),
tag?: [tag](/docs/kcl/types/std-types-tag), tag?: tag,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -12,9 +12,9 @@ Mirror occurs around a local sketch axis rather than a global axis.
```kcl ```kcl
mirror2d( mirror2d(
@sketches: [[Sketch; 1+]](/docs/kcl/types/std-types-Sketch), @sketches: [Sketch; 1+],
axis: [Axis2d](/docs/kcl/types/std-types-Axis2d) | [Edge](/docs/kcl/types/std-types-Edge), axis: Axis2d | Edge,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -12,11 +12,11 @@ a sharp, straight transitional edge.
```kcl ```kcl
chamfer( chamfer(
@solid: [Solid](/docs/kcl/types/std-types-Solid), @solid: Solid,
length: number(Length), length: number(Length),
tags: [[Edge; 1+]](/docs/kcl/types/std-types-Edge), tags: [Edge; 1+],
tag?: [tag](/docs/kcl/types/std-types-tag), tag?: tag,
): [Solid](/docs/kcl/types/std-types-Solid) ): Solid
``` ```

View File

@ -12,12 +12,12 @@ will smoothly blend the transition.
```kcl ```kcl
fillet( fillet(
@solid: [Solid](/docs/kcl/types/std-types-Solid), @solid: Solid,
radius: number(Length), radius: number(Length),
tags: [[Edge; 1+]](/docs/kcl/types/std-types-Edge), tags: [Edge; 1+],
tolerance?: number(Length), tolerance?: number(Length),
tag?: [tag](/docs/kcl/types/std-types-tag), tag?: tag,
): [Solid](/docs/kcl/types/std-types-Solid) ): Solid
``` ```

View File

@ -11,9 +11,9 @@ provided thickness remains around the exterior of the shape.
```kcl ```kcl
hollow( hollow(
@solid: [Solid](/docs/kcl/types/std-types-Solid), @solid: Solid,
thickness: number(Length), thickness: number(Length),
): [Solid](/docs/kcl/types/std-types-Solid) ): Solid
``` ```

View File

@ -11,10 +11,10 @@ provided thickness remains, taking volume starting at the providedface, leaving
```kcl ```kcl
shell( shell(
@solids: [[Solid; 1+]](/docs/kcl/types/std-types-Solid), @solids: [Solid; 1+],
thickness: number(Length), thickness: number(Length),
faces: [[tag; 1+]](/docs/kcl/types/std-types-tag), faces: [tag; 1+],
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -9,7 +9,7 @@ Get the shared edge between two faces.
```kcl ```kcl
getCommonEdge(faces: [[TagIdentifier]](/docs/kcl/types#TagIdentifier)): Uuid getCommonEdge(faces: [TagIdentifier]): Uuid
``` ```

View File

@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
```kcl ```kcl
getNextAdjacentEdge(edge: [TagIdentifier](/docs/kcl/types#TagIdentifier)): Uuid getNextAdjacentEdge(edge: TagIdentifier): Uuid
``` ```

View File

@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
```kcl ```kcl
getOppositeEdge(edge: [TagIdentifier](/docs/kcl/types#TagIdentifier)): Uuid getOppositeEdge(edge: TagIdentifier): Uuid
``` ```

View File

@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
```kcl ```kcl
getPreviousAdjacentEdge(edge: [TagIdentifier](/docs/kcl/types#TagIdentifier)): Uuid getPreviousAdjacentEdge(edge: TagIdentifier): Uuid
``` ```

View File

@ -10,9 +10,9 @@ Intersect computes the geometric intersection of multiple solid bodies, returnin
```kcl ```kcl
intersect( intersect(
solids: [[Solid]](/docs/kcl/types/std-types-Solid), solids: [Solid],
tolerance?: [number](/docs/kcl/types/std-types-number), tolerance?: number,
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -10,13 +10,13 @@ Extend the current sketch with a new involute circular curve.
```kcl ```kcl
involuteCircular( involuteCircular(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
startRadius: [number](/docs/kcl/types/std-types-number), startRadius: number,
endRadius: [number](/docs/kcl/types/std-types-number), endRadius: number,
angle: [number](/docs/kcl/types/std-types-number), angle: number,
reverse?: [bool](/docs/kcl/types/std-types-bool), reverse?: bool,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -9,7 +9,7 @@ Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
```kcl ```kcl
lastSegX(sketch: [Sketch](/docs/kcl/types/std-types-Sketch)): [number](/docs/kcl/types/std-types-number) lastSegX(sketch: Sketch): number
``` ```

View File

@ -9,7 +9,7 @@ Extract the 'y' axis value of the last line segment in the provided 2-d sketch.
```kcl ```kcl
lastSegY(sketch: [Sketch](/docs/kcl/types/std-types-Sketch)): [number](/docs/kcl/types/std-types-number) lastSegY(sketch: Sketch): number
``` ```

View File

@ -10,9 +10,9 @@ Compute the angle of the given leg for x.
```kcl ```kcl
legAngX( legAngX(
hypotenuse: [number](/docs/kcl/types/std-types-number), hypotenuse: number,
leg: [number](/docs/kcl/types/std-types-number), leg: number,
): [number](/docs/kcl/types/std-types-number) ): number
``` ```
### Tags ### Tags

View File

@ -10,9 +10,9 @@ Compute the angle of the given leg for y.
```kcl ```kcl
legAngY( legAngY(
hypotenuse: [number](/docs/kcl/types/std-types-number), hypotenuse: number,
leg: [number](/docs/kcl/types/std-types-number), leg: number,
): [number](/docs/kcl/types/std-types-number) ): number
``` ```
### Tags ### Tags

View File

@ -10,9 +10,9 @@ Compute the length of the given leg.
```kcl ```kcl
legLen( legLen(
hypotenuse: [number](/docs/kcl/types/std-types-number), hypotenuse: number,
leg: [number](/docs/kcl/types/std-types-number), leg: number,
): [number](/docs/kcl/types/std-types-number) ): number
``` ```
### Tags ### Tags

View File

@ -10,11 +10,11 @@ Extend the current sketch with a new straight line.
```kcl ```kcl
line( line(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
endAbsolute?: [Point2d](/docs/kcl/types/std-types-Point2d), endAbsolute?: Point2d,
end?: [Point2d](/docs/kcl/types/std-types-Point2d), end?: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -10,14 +10,14 @@ The sketches need to closed and on the same plane.
```kcl ```kcl
loft( loft(
sketches: [[Sketch]](/docs/kcl/types/std-types-Sketch), sketches: [Sketch],
vDegree: [number](/docs/kcl/types/std-types-number), vDegree: number,
bezApproximateRational: [bool](/docs/kcl/types/std-types-bool), bezApproximateRational: bool,
baseCurveIndex?: [number](/docs/kcl/types/std-types-number), baseCurveIndex?: number,
tolerance?: [number](/docs/kcl/types/std-types-number), tolerance?: number,
tagStart?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tagStart?: TagDeclarator,
tagEnd?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tagEnd?: TagDeclarator,
): [Solid](/docs/kcl/types/std-types-Solid) ): Solid
``` ```

View File

@ -6,13 +6,13 @@ layout: manual
Apply a function to every element of a list. Apply a function to every element of a list.
Given a list like `[[a, b, c]]`, and a function like `f`, returns `[[f(a), f(b), f(c)]]` Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(c)]`
```kcl ```kcl
map( map(
array: [[any]](/docs/kcl/types/std-types-any), array: [any],
f: FunctionSource, f: FunctionSource,
): [[any]](/docs/kcl/types/std-types-any) ): [any]
``` ```

View File

@ -10,13 +10,13 @@ Repeat a 2-dimensional sketch some number of times along a partial or complete c
```kcl ```kcl
patternCircular2d( patternCircular2d(
sketchSet: [[Sketch]](/docs/kcl/types/std-types-Sketch), sketchSet: [Sketch],
instances: [number](/docs/kcl/types/std-types-number), instances: number,
center: [Point2d](/docs/kcl/types/std-types-Point2d), center: Point2d,
arcDegrees: [number](/docs/kcl/types/std-types-number), arcDegrees: number,
rotateDuplicates: [bool](/docs/kcl/types/std-types-bool), rotateDuplicates: bool,
useOriginal?: [bool](/docs/kcl/types/std-types-bool), useOriginal?: bool,
): [[Sketch]](/docs/kcl/types/std-types-Sketch) ): [Sketch]
``` ```

View File

@ -10,14 +10,14 @@ Repeat a 3-dimensional solid some number of times along a partial or complete ci
```kcl ```kcl
patternCircular3d( patternCircular3d(
solids: [[Solid]](/docs/kcl/types/std-types-Solid), solids: [Solid],
instances: [number](/docs/kcl/types/std-types-number), instances: number,
axis: [[number]](/docs/kcl/types/std-types-number), axis: [number],
center: [Point3d](/docs/kcl/types/std-types-Point3d), center: Point3d,
arcDegrees: [number](/docs/kcl/types/std-types-number), arcDegrees: number,
rotateDuplicates: [bool](/docs/kcl/types/std-types-bool), rotateDuplicates: bool,
useOriginal?: [bool](/docs/kcl/types/std-types-bool), useOriginal?: bool,
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -10,12 +10,12 @@ Repeat a 2-dimensional sketch along some dimension, with a dynamic amount of dis
```kcl ```kcl
patternLinear2d( patternLinear2d(
sketches: [[Sketch]](/docs/kcl/types/std-types-Sketch), sketches: [Sketch],
instances: [number](/docs/kcl/types/std-types-number), instances: number,
distance: [number](/docs/kcl/types/std-types-number), distance: number,
axis: [Point2d](/docs/kcl/types/std-types-Point2d), axis: Point2d,
useOriginal?: [bool](/docs/kcl/types/std-types-bool), useOriginal?: bool,
): [[Sketch]](/docs/kcl/types/std-types-Sketch) ): [Sketch]
``` ```

View File

@ -10,12 +10,12 @@ Repeat a 3-dimensional solid along a linear path, with a dynamic amount of dista
```kcl ```kcl
patternLinear3d( patternLinear3d(
solids: [[Solid]](/docs/kcl/types/std-types-Solid), solids: [Solid],
instances: [number](/docs/kcl/types/std-types-number), instances: number,
distance: [number](/docs/kcl/types/std-types-number), distance: number,
axis: [Point3d](/docs/kcl/types/std-types-Point3d), axis: Point3d,
useOriginal?: [bool](/docs/kcl/types/std-types-bool), useOriginal?: bool,
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -36,11 +36,11 @@ The transform function returns a transform object. All properties of the object
```kcl ```kcl
patternTransform( patternTransform(
solids: [[Solid]](/docs/kcl/types/std-types-Solid), solids: [Solid],
instances: [number](/docs/kcl/types/std-types-number), instances: number,
transform: FunctionSource, transform: FunctionSource,
useOriginal?: [bool](/docs/kcl/types/std-types-bool), useOriginal?: bool,
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -10,11 +10,11 @@ Just like patternTransform, but works on 2D sketches not 3D solids.
```kcl ```kcl
patternTransform2d( patternTransform2d(
sketches: [[Sketch]](/docs/kcl/types/std-types-Sketch), sketches: [Sketch],
instances: [number](/docs/kcl/types/std-types-number), instances: number,
transform: FunctionSource, transform: FunctionSource,
useOriginal?: [bool](/docs/kcl/types/std-types-bool), useOriginal?: bool,
): [[Sketch]](/docs/kcl/types/std-types-Sketch) ): [Sketch]
``` ```

View File

@ -10,12 +10,12 @@ Create a regular polygon with the specified number of sides that is either inscr
```kcl ```kcl
polygon( polygon(
sketchSurfaceOrGroup: [Sketch](/docs/kcl/types/std-types-Sketch) | [Plane](/docs/kcl/types/std-types-Plane) | [Face](/docs/kcl/types/std-types-Face), sketchSurfaceOrGroup: Sketch | Plane | Face,
radius: [number](/docs/kcl/types/std-types-number), radius: number,
numSides: u64, numSides: u64,
center: [Point2d](/docs/kcl/types/std-types-Point2d), center: Point2d,
inscribed?: [bool](/docs/kcl/types/std-types-bool), inscribed?: bool,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -9,7 +9,7 @@ Remove the last element from an array.
Returns a new array with the last element removed. Returns a new array with the last element removed.
```kcl ```kcl
pop(array: [[any]](/docs/kcl/types/std-types-any)): [any](/docs/kcl/types/std-types-any) pop(array: [any]): any
``` ```

View File

@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin value.
```kcl ```kcl
profileStart(profile: [Sketch](/docs/kcl/types/std-types-Sketch)): [[number]](/docs/kcl/types/std-types-number) profileStart(profile: Sketch): [number]
``` ```

View File

@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin's 'x' value.
```kcl ```kcl
profileStartX(profile: [Sketch](/docs/kcl/types/std-types-Sketch)): [number](/docs/kcl/types/std-types-number) profileStartX(profile: Sketch): number
``` ```

View File

@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin's 'y' value.
```kcl ```kcl
profileStartY(profile: [Sketch](/docs/kcl/types/std-types-Sketch)): [number](/docs/kcl/types/std-types-number) profileStartY(profile: Sketch): number
``` ```

View File

@ -10,9 +10,9 @@ Returns a new array with the element appended.
```kcl ```kcl
push( push(
array: [[any]](/docs/kcl/types/std-types-any), array: [any],
item: [any](/docs/kcl/types/std-types-any), item: any,
): [any](/docs/kcl/types/std-types-any) ): any
``` ```

View File

@ -10,10 +10,10 @@ Take a starting value. Then, for each element of an array, calculate the next va
```kcl ```kcl
reduce( reduce(
array: [[any]](/docs/kcl/types/std-types-any), array: [any],
initial: [any](/docs/kcl/types/std-types-any), initial: any,
f: FunctionSource, f: FunctionSource,
): [any](/docs/kcl/types/std-types-any) ): any
``` ```

View File

@ -28,14 +28,14 @@ When rotating a part around an axis, you specify the axis of rotation and the an
```kcl ```kcl
rotate( rotate(
objects: [[Solid]](/docs/kcl/types/std-types-Solid) | [[Sketch]](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry), objects: [Solid] | [Sketch] | ImportedGeometry,
roll?: [number](/docs/kcl/types/std-types-number), roll?: number,
pitch?: [number](/docs/kcl/types/std-types-number), pitch?: number,
yaw?: [number](/docs/kcl/types/std-types-number), yaw?: number,
axis?: [[number]](/docs/kcl/types/std-types-number), axis?: [number],
angle?: [number](/docs/kcl/types/std-types-number), angle?: number,
global?: [bool](/docs/kcl/types/std-types-bool), global?: bool,
): [[Solid]](/docs/kcl/types/std-types-Solid) | [[Sketch]](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry) ): [Solid] | [Sketch] | ImportedGeometry
``` ```

View File

@ -16,12 +16,12 @@ If you want to apply the transform in global space, set `global` to `true`. The
```kcl ```kcl
scale( scale(
objects: [[Solid]](/docs/kcl/types/std-types-Solid) | [[Sketch]](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry), objects: [Solid] | [Sketch] | ImportedGeometry,
x?: [number](/docs/kcl/types/std-types-number), x?: number,
y?: [number](/docs/kcl/types/std-types-number), y?: number,
z?: [number](/docs/kcl/types/std-types-number), z?: number,
global?: [bool](/docs/kcl/types/std-types-bool), global?: bool,
): [[Solid]](/docs/kcl/types/std-types-Solid) | [[Sketch]](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry) ): [Solid] | [Sketch] | ImportedGeometry
``` ```

View File

@ -9,7 +9,7 @@ Compute the angle (in degrees) of the provided line segment.
```kcl ```kcl
segAng(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [number](/docs/kcl/types/std-types-number) segAng(tag: TagIdentifier): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the ending point of the provided line segment.
```kcl ```kcl
segEnd(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [Point2d](/docs/kcl/types/std-types-Point2d) segEnd(tag: TagIdentifier): Point2d
``` ```

View File

@ -9,7 +9,7 @@ Compute the ending point of the provided line segment along the 'x' axis.
```kcl ```kcl
segEndX(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [number](/docs/kcl/types/std-types-number) segEndX(tag: TagIdentifier): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the ending point of the provided line segment along the 'y' axis.
```kcl ```kcl
segEndY(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [number](/docs/kcl/types/std-types-number) segEndY(tag: TagIdentifier): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the length of the provided line segment.
```kcl ```kcl
segLen(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [number](/docs/kcl/types/std-types-number) segLen(tag: TagIdentifier): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the starting point of the provided line segment.
```kcl ```kcl
segStart(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [Point2d](/docs/kcl/types/std-types-Point2d) segStart(tag: TagIdentifier): Point2d
``` ```

View File

@ -9,7 +9,7 @@ Compute the starting point of the provided line segment along the 'x' axis.
```kcl ```kcl
segStartX(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [number](/docs/kcl/types/std-types-number) segStartX(tag: TagIdentifier): number
``` ```

View File

@ -9,7 +9,7 @@ Compute the starting point of the provided line segment along the 'y' axis.
```kcl ```kcl
segStartY(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [number](/docs/kcl/types/std-types-number) segStartY(tag: TagIdentifier): number
``` ```

View File

@ -10,10 +10,10 @@ Start a new profile at a given point.
```kcl ```kcl
startProfile( startProfile(
sketchSurface: [Plane](/docs/kcl/types/std-types-Plane) | [Face](/docs/kcl/types/std-types-Face), sketchSurface: Plane | Face,
at: [Point2d](/docs/kcl/types/std-types-Point2d), at: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -18,9 +18,9 @@ The point is if you want to export the result of a sketch on a face, you only ne
```kcl ```kcl
startSketchOn( startSketchOn(
planeOrSolid: [Plane](/docs/kcl/types/std-types-Plane) | [Solid](/docs/kcl/types/std-types-Solid), planeOrSolid: Plane | Solid,
face?: [TagIdentifier](/docs/kcl/types#TagIdentifier) | [Start](/docs/kcl/types#Start) | [End](/docs/kcl/types#End), face?: TagIdentifier | Start | End,
): [Plane](/docs/kcl/types/std-types-Plane) | [Face](/docs/kcl/types/std-types-Face) ): Plane | Face
``` ```

View File

@ -10,10 +10,10 @@ Performs a boolean subtraction operation, removing the volume of one or more too
```kcl ```kcl
subtract( subtract(
solids: [[Solid]](/docs/kcl/types/std-types-Solid), solids: [Solid],
tools: [[Solid]](/docs/kcl/types/std-types-Solid), tools: [Solid],
tolerance?: [number](/docs/kcl/types/std-types-number), tolerance?: number,
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -10,9 +10,9 @@ Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.
```kcl ```kcl
subtract2d( subtract2d(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
tool: [[Sketch]](/docs/kcl/types/std-types-Sketch), tool: [Sketch],
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -12,13 +12,13 @@ You can provide more than one sketch to sweep, and they will all be swept along
```kcl ```kcl
sweep( sweep(
sketches: [[Sketch]](/docs/kcl/types/std-types-Sketch), sketches: [Sketch],
path: [Sketch](/docs/kcl/types/std-types-Sketch) | [Helix](/docs/kcl/types/std-types-Helix), path: Sketch | Helix,
sectional?: [bool](/docs/kcl/types/std-types-bool), sectional?: bool,
tolerance?: [number](/docs/kcl/types/std-types-number), tolerance?: number,
tagStart?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tagStart?: TagDeclarator,
tagEnd?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tagEnd?: TagDeclarator,
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -9,7 +9,7 @@ Returns the angle coming out of the end of the segment in degrees.
```kcl ```kcl
tangentToEnd(tag: [TagIdentifier](/docs/kcl/types#TagIdentifier)): [number](/docs/kcl/types/std-types-number) tangentToEnd(tag: TagIdentifier): number
``` ```

View File

@ -10,13 +10,13 @@ When using radius and angle, draw a curved line segment along part of an imagina
```kcl ```kcl
tangentialArc( tangentialArc(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
endAbsolute?: [Point2d](/docs/kcl/types/std-types-Point2d), endAbsolute?: Point2d,
end?: [Point2d](/docs/kcl/types/std-types-Point2d), end?: Point2d,
radius?: [number](/docs/kcl/types/std-types-number), radius?: number,
angle?: [number](/docs/kcl/types/std-types-number), angle?: number,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -12,12 +12,12 @@ Translate is really useful for sketches if you want to move a sketch and then ro
```kcl ```kcl
translate( translate(
objects: [[Solid]](/docs/kcl/types/std-types-Solid) | [[Sketch]](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry), objects: [Solid] | [Sketch] | ImportedGeometry,
x?: [number](/docs/kcl/types/std-types-number), x?: number,
y?: [number](/docs/kcl/types/std-types-number), y?: number,
z?: [number](/docs/kcl/types/std-types-number), z?: number,
global?: [bool](/docs/kcl/types/std-types-bool), global?: bool,
): [[Solid]](/docs/kcl/types/std-types-Solid) | [[Sketch]](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry) ): [Solid] | [Sketch] | ImportedGeometry
``` ```

View File

@ -11,7 +11,7 @@ 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 [`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]]`. with type [`Point2d`](/docs/kcl/types/std-types-Point2d), use an array, e.g., `[0, 0]` or `[5.0, 3.14]`.

View File

@ -11,7 +11,7 @@ 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 [`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]]`. with type [`Point3d`](/docs/kcl/types/std-types-Point3d), use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`.

View File

@ -10,9 +10,9 @@ Union two or more solids into a single solid.
```kcl ```kcl
union( union(
solids: [[Solid]](/docs/kcl/types/std-types-Solid), solids: [Solid],
tolerance?: [number](/docs/kcl/types/std-types-number), tolerance?: number,
): [[Solid]](/docs/kcl/types/std-types-Solid) ): [Solid]
``` ```

View File

@ -10,11 +10,11 @@ Draw a line relative to the current origin to a specified distance away from the
```kcl ```kcl
xLine( xLine(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
length?: [number](/docs/kcl/types/std-types-number), length?: number,
endAbsolute?: [number](/docs/kcl/types/std-types-number), endAbsolute?: number,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -10,11 +10,11 @@ Draw a line relative to the current origin to a specified distance away from the
```kcl ```kcl
yLine( yLine(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch), sketch: Sketch,
length?: [number](/docs/kcl/types/std-types-number), length?: number,
endAbsolute?: [number](/docs/kcl/types/std-types-number), endAbsolute?: number,
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/std-types-Sketch) ): Sketch
``` ```

View File

@ -577,12 +577,16 @@ fn cleanup_type_string(input: &str, fmt_for_text: bool) -> String {
ty ty
}; };
if SPECIAL_TYPES.contains(&ty) { // TODO markdown links in code blocks are not turned into links by our website stack.
// If we can handle signatures more manually we could get highlighting and links and
// 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/types#{ty})")
} else if DECLARED_TYPES.contains(&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/types/std-types-{ty})")
} else { } else {
format!("{prefix}{input}{suffix}") format!("{prefix}{ty}{suffix}")
} }
}) })
.collect(); .collect();