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

View File

@ -249,8 +249,8 @@ fn rect(origin) {
|> close()
}
rect([0, 0])
rect([20, 0])
rect(origin = [0, 0])
rect(origin = [20, 0])
```
Those tags would only be available in the `rect` function and not globally.
@ -279,8 +279,8 @@ fn rect(origin) {
|> close()
}
rect([0, 0])
myRect = rect([20, 0])
rect(origin = [0, 0])
myRect = rect(origin = [20, 0])
myRect
|> 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
angledLine(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch),
angle: [number](/docs/kcl/types/std-types-number),
length?: [number](/docs/kcl/types/std-types-number),
lengthX?: [number](/docs/kcl/types/std-types-number),
lengthY?: [number](/docs/kcl/types/std-types-number),
endAbsoluteX?: [number](/docs/kcl/types/std-types-number),
endAbsoluteY?: [number](/docs/kcl/types/std-types-number),
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator),
): [Sketch](/docs/kcl/types/std-types-Sketch)
sketch: Sketch,
angle: number,
length?: number,
lengthX?: number,
lengthY?: number,
endAbsoluteX?: number,
endAbsoluteY?: number,
tag?: TagDeclarator,
): Sketch
```

View File

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

View File

@ -10,11 +10,11 @@ This will work on any solid, including extruded solids, revolved solids, and she
```kcl
appearance(
solids: [[Solid]](/docs/kcl/types/std-types-Solid) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry),
color: [string](/docs/kcl/types/std-types-string),
metalness?: [number](/docs/kcl/types/std-types-number),
roughness?: [number](/docs/kcl/types/std-types-number),
): [[Solid]](/docs/kcl/types/std-types-Solid) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry)
solids: [Solid] | ImportedGeometry,
color: string,
metalness?: number,
roughness?: number,
): [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
arc(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch),
angleStart?: [number](/docs/kcl/types/std-types-number),
angleEnd?: [number](/docs/kcl/types/std-types-number),
radius?: [number](/docs/kcl/types/std-types-number),
interiorAbsolute?: [Point2d](/docs/kcl/types/std-types-Point2d),
endAbsolute?: [Point2d](/docs/kcl/types/std-types-Point2d),
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator),
): [Sketch](/docs/kcl/types/std-types-Sketch)
sketch: Sketch,
angleStart?: number,
angleEnd?: number,
radius?: number,
interiorAbsolute?: Point2d,
endAbsolute?: Point2d,
tag?: TagDeclarator,
): Sketch
```

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ Compute the absolute value of a number.
```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
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
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
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
log(
@input: [number](/docs/kcl/types/std-types-number),
@input: 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
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
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
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
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(
angle: number(rad),
length: number(Length),
): [Point2d](/docs/kcl/types/std-types-Point2d)
): Point2d
```

View File

@ -10,9 +10,9 @@ Compute the number to a power.
```kcl
pow(
@input: [number](/docs/kcl/types/std-types-number),
@input: 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
rem(
@num: [number](/docs/kcl/types/std-types-number),
divisor: [number](/docs/kcl/types/std-types-number),
): [number](/docs/kcl/types/std-types-number)
@num: number,
divisor: number,
): number
```

View File

@ -9,7 +9,7 @@ Round a number to the nearest integer.
```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
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
offsetPlane(
@plane: [Plane](/docs/kcl/types/std-types-Plane),
@plane: Plane,
offset: number(Length),
): [Plane](/docs/kcl/types/std-types-Plane)
): Plane
```

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,9 +11,9 @@ provided thickness remains around the exterior of the shape.
```kcl
hollow(
@solid: [Solid](/docs/kcl/types/std-types-Solid),
@solid: Solid,
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
shell(
@solids: [[Solid; 1+]](/docs/kcl/types/std-types-Solid),
@solids: [Solid; 1+],
thickness: number(Length),
faces: [[tag; 1+]](/docs/kcl/types/std-types-tag),
): [[Solid]](/docs/kcl/types/std-types-Solid)
faces: [tag; 1+],
): [Solid]
```

View File

@ -9,7 +9,7 @@ Get the shared edge between two faces.
```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
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
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
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
intersect(
solids: [[Solid]](/docs/kcl/types/std-types-Solid),
tolerance?: [number](/docs/kcl/types/std-types-number),
): [[Solid]](/docs/kcl/types/std-types-Solid)
solids: [Solid],
tolerance?: number,
): [Solid]
```

View File

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

View File

@ -9,7 +9,7 @@ Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
```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
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
legAngX(
hypotenuse: [number](/docs/kcl/types/std-types-number),
leg: [number](/docs/kcl/types/std-types-number),
): [number](/docs/kcl/types/std-types-number)
hypotenuse: number,
leg: number,
): number
```
### Tags

View File

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

View File

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

View File

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

View File

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

View File

@ -6,13 +6,13 @@ layout: manual
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
map(
array: [[any]](/docs/kcl/types/std-types-any),
array: [any],
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
patternCircular2d(
sketchSet: [[Sketch]](/docs/kcl/types/std-types-Sketch),
instances: [number](/docs/kcl/types/std-types-number),
center: [Point2d](/docs/kcl/types/std-types-Point2d),
arcDegrees: [number](/docs/kcl/types/std-types-number),
rotateDuplicates: [bool](/docs/kcl/types/std-types-bool),
useOriginal?: [bool](/docs/kcl/types/std-types-bool),
): [[Sketch]](/docs/kcl/types/std-types-Sketch)
sketchSet: [Sketch],
instances: number,
center: Point2d,
arcDegrees: number,
rotateDuplicates: bool,
useOriginal?: bool,
): [Sketch]
```

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ Remove the last element from an array.
Returns a new array with the last element removed.
```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
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
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
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
push(
array: [[any]](/docs/kcl/types/std-types-any),
item: [any](/docs/kcl/types/std-types-any),
): [any](/docs/kcl/types/std-types-any)
array: [any],
item: any,
): any
```

View File

@ -10,10 +10,10 @@ Take a starting value. Then, for each element of an array, calculate the next va
```kcl
reduce(
array: [[any]](/docs/kcl/types/std-types-any),
initial: [any](/docs/kcl/types/std-types-any),
array: [any],
initial: any,
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
rotate(
objects: [[Solid]](/docs/kcl/types/std-types-Solid) | [[Sketch]](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry),
roll?: [number](/docs/kcl/types/std-types-number),
pitch?: [number](/docs/kcl/types/std-types-number),
yaw?: [number](/docs/kcl/types/std-types-number),
axis?: [[number]](/docs/kcl/types/std-types-number),
angle?: [number](/docs/kcl/types/std-types-number),
global?: [bool](/docs/kcl/types/std-types-bool),
): [[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,
pitch?: number,
yaw?: number,
axis?: [number],
angle?: number,
global?: bool,
): [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
scale(
objects: [[Solid]](/docs/kcl/types/std-types-Solid) | [[Sketch]](/docs/kcl/types/std-types-Sketch) | [ImportedGeometry](/docs/kcl/types#ImportedGeometry),
x?: [number](/docs/kcl/types/std-types-number),
y?: [number](/docs/kcl/types/std-types-number),
z?: [number](/docs/kcl/types/std-types-number),
global?: [bool](/docs/kcl/types/std-types-bool),
): [[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,
y?: number,
z?: number,
global?: bool,
): [Solid] | [Sketch] | ImportedGeometry
```

View File

@ -9,7 +9,7 @@ Compute the angle (in degrees) of the provided line segment.
```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
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
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
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
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
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
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
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
startProfile(
sketchSurface: [Plane](/docs/kcl/types/std-types-Plane) | [Face](/docs/kcl/types/std-types-Face),
at: [Point2d](/docs/kcl/types/std-types-Point2d),
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator),
): [Sketch](/docs/kcl/types/std-types-Sketch)
sketchSurface: Plane | Face,
at: Point2d,
tag?: TagDeclarator,
): 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
startSketchOn(
planeOrSolid: [Plane](/docs/kcl/types/std-types-Plane) | [Solid](/docs/kcl/types/std-types-Solid),
face?: [TagIdentifier](/docs/kcl/types#TagIdentifier) | [Start](/docs/kcl/types#Start) | [End](/docs/kcl/types#End),
): [Plane](/docs/kcl/types/std-types-Plane) | [Face](/docs/kcl/types/std-types-Face)
planeOrSolid: Plane | Solid,
face?: TagIdentifier | Start | End,
): Plane | Face
```

View File

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

View File

@ -10,9 +10,9 @@ Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.
```kcl
subtract2d(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch),
tool: [[Sketch]](/docs/kcl/types/std-types-Sketch),
): [Sketch](/docs/kcl/types/std-types-Sketch)
sketch: Sketch,
tool: [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
sweep(
sketches: [[Sketch]](/docs/kcl/types/std-types-Sketch),
path: [Sketch](/docs/kcl/types/std-types-Sketch) | [Helix](/docs/kcl/types/std-types-Helix),
sectional?: [bool](/docs/kcl/types/std-types-bool),
tolerance?: [number](/docs/kcl/types/std-types-number),
tagStart?: [TagDeclarator](/docs/kcl/types#TagDeclarator),
tagEnd?: [TagDeclarator](/docs/kcl/types#TagDeclarator),
): [[Solid]](/docs/kcl/types/std-types-Solid)
sketches: [Sketch],
path: Sketch | Helix,
sectional?: bool,
tolerance?: number,
tagStart?: TagDeclarator,
tagEnd?: TagDeclarator,
): [Solid]
```

View File

@ -9,7 +9,7 @@ Returns the angle coming out of the end of the segment in degrees.
```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
tangentialArc(
sketch: [Sketch](/docs/kcl/types/std-types-Sketch),
endAbsolute?: [Point2d](/docs/kcl/types/std-types-Point2d),
end?: [Point2d](/docs/kcl/types/std-types-Point2d),
radius?: [number](/docs/kcl/types/std-types-number),
angle?: [number](/docs/kcl/types/std-types-number),
tag?: [TagDeclarator](/docs/kcl/types#TagDeclarator),
): [Sketch](/docs/kcl/types/std-types-Sketch)
sketch: Sketch,
endAbsolute?: Point2d,
end?: Point2d,
radius?: number,
angle?: number,
tag?: TagDeclarator,
): Sketch
```

View File

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

View File

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

View File

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

View File

@ -577,12 +577,16 @@ fn cleanup_type_string(input: &str, fmt_for_text: bool) -> String {
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})")
} 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})")
} else {
format!("{prefix}{input}{suffix}")
format!("{prefix}{ty}{suffix}")
}
})
.collect();