* Automatic fixing of deprecations and use non-quoted default planes by default Signed-off-by: Nick Cameron <nrc@ncameron.org> * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
85 lines
164 KiB
Markdown
85 lines
164 KiB
Markdown
---
|
|
title: "extrude"
|
|
excerpt: "Extend a 2-dimensional sketch through a third dimension in order to create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid."
|
|
layout: manual
|
|
---
|
|
|
|
Extend a 2-dimensional sketch through a third dimension in order to create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.
|
|
|
|
You can provide more than one sketch to extrude, and they will all be extruded in the same direction.
|
|
|
|
```js
|
|
extrude(
|
|
sketches: [Sketch],
|
|
length: number,
|
|
tagStart?: TagDeclarator,
|
|
tagEnd?: TagDeclarator,
|
|
): [Solid]
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `sketches` | [`[Sketch]`](/docs/kcl/types/Sketch) | Which sketch or sketches should be extruded | Yes |
|
|
| `length` | [`number`](/docs/kcl/types/number) | How far to extrude the given sketches | Yes |
|
|
| `tagStart` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | A named tag for the face at the start of the extrusion, i.e. the original sketch | No |
|
|
| `tagEnd` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch | No |
|
|
|
|
### Returns
|
|
|
|
[`[Solid]`](/docs/kcl/types/Solid)
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
example = startSketchOn(XZ)
|
|
|> startProfileAt([0, 0], %)
|
|
|> line(end = [10, 0])
|
|
|> arc({
|
|
angleStart = 120,
|
|
angleEnd = 0,
|
|
radius = 5
|
|
}, %)
|
|
|> line(end = [5, 0])
|
|
|> line(end = [0, 10])
|
|
|> bezierCurve({
|
|
control1 = [-10, 0],
|
|
control2 = [2, 10],
|
|
to = [-5, 10]
|
|
}, %)
|
|
|> line(end = [-5, -2])
|
|
|> close()
|
|
|> extrude(length = 10)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
exampleSketch = startSketchOn(XZ)
|
|
|> startProfileAt([-10, 0], %)
|
|
|> arc({
|
|
angleStart = 120,
|
|
angleEnd = -60,
|
|
radius = 5
|
|
}, %)
|
|
|> line(end = [10, 0])
|
|
|> line(end = [5, 0])
|
|
|> bezierCurve({
|
|
control1 = [-3, 0],
|
|
control2 = [2, 10],
|
|
to = [-5, 10]
|
|
}, %)
|
|
|> line(end = [-4, 10])
|
|
|> line(end = [-5, -2])
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 10)
|
|
```
|
|
|
|

|
|
|
|
|