* make everything in engine a rwlock and cleanup repetitive code Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * docs Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
78 lines
163 KiB
Markdown
78 lines
163 KiB
Markdown
---
|
|
title: "extrude"
|
|
excerpt: "Extend a 2-dimensional sketch through a third dimension in order to"
|
|
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.
|
|
|
|
```js
|
|
extrude(sketch_set: SketchSet, length: number) -> SolidSet
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketches should be extruded | Yes |
|
|
| `length` | `number` | How far to extrude the given sketches | Yes |
|
|
|
|
### Returns
|
|
|
|
[`SolidSet`](/docs/kcl/types/SolidSet) - A solid or a group of solids.
|
|
|
|
|
|
### 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)
|
|
```
|
|
|
|

|
|
|
|
|