Make the function signature less prominent, add an early example to docs

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-06-19 17:08:46 +12:00
parent 6358eed7e4
commit ff1be99351
99 changed files with 2137 additions and 686 deletions

View File

@ -8,29 +8,20 @@ layout: manual
Rotate a sketch around some provided axis, creating a solid from its extent.
```kcl
revolve(
@sketches: [Sketch; 1+],
axis: Axis2d | Edge,
angle?: number(Angle),
tolerance?: number(Length),
symmetric?: bool,
bidirectionalAngle?: number(Angle),
tagStart?: TagDecl,
tagEnd?: TagDecl,
): [Solid; 1+]
part001 = startSketchOn(XY)
|> startProfile(at = [4, 12])
|> line(end = [2, 0])
|> line(end = [0, -6])
|> line(end = [4, -6])
|> line(end = [0, -6])
|> line(end = [-3.75, -4.5])
|> line(end = [0, -5.5])
|> line(end = [-2, 0])
|> close()
|> revolve(axis = Y) // default angle is 360deg
```
This, like extrude, is able to create a 3-dimensional solid from a
2-dimensional sketch. However, unlike extrude, this creates a solid
by using the extent of the sketch as its revolved around an axis rather
than using the extent of the sketch linearly translated through a third
dimension.
Revolve occurs around a local sketch axis rather than a global axis.
You can provide more than one sketch to revolve, and they will all be
revolved around the same axis.
### Arguments
| Name | Type | Description | Required |
@ -48,6 +39,33 @@ revolved around the same axis.
[`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid)
### Description
This, like extrude, is able to create a 3-dimensional solid from a
2-dimensional sketch. However, unlike extrude, this creates a solid
by using the extent of the sketch as its revolved around an axis rather
than using the extent of the sketch linearly translated through a third
dimension.
Revolve occurs around a local sketch axis rather than a global axis.
You can provide more than one sketch to revolve, and they will all be
revolved around the same axis.
### Function signature
```kcl
revolve(
@sketches: [Sketch; 1+],
axis: Axis2d | Edge,
angle?: number(Angle),
tolerance?: number(Length),
symmetric?: bool,
bidirectionalAngle?: number(Angle),
tagStart?: TagDecl,
tagEnd?: TagDecl,
): [Solid; 1+]
```
### Examples