* renames 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> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> udpates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix parse Signed-off-by: Jess Frazelle <github@jessfraz.com> fix typos Signed-off-by: Jess Frazelle <github@jessfraz.com> docs Signed-off-by: Jess Frazelle <github@jessfraz.com> update tests Signed-off-by: Jess Frazelle <github@jessfraz.com> empty * fix; Signed-off-by: Jess Frazelle <github@jessfraz.com> * new Signed-off-by: Jess Frazelle <github@jessfraz.com> * add the types pages Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * Look at this (photo)Graph *in the voice of Nickelback* * empty * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
78 lines
158 KiB
Markdown
78 lines
158 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(length: number, sketch_set: SketchSet) -> SolidSet
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `length` | `number` | | Yes |
|
|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`SolidSet`](/docs/kcl/types/SolidSet) - A solid or a group of solids.
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
const example = startSketchOn('XZ')
|
|
|> startProfileAt([0, 0], %)
|
|
|> line([10, 0], %)
|
|
|> arc({
|
|
angleStart: 120,
|
|
angleEnd: 0,
|
|
radius: 5
|
|
}, %)
|
|
|> line([5, 0], %)
|
|
|> line([0, 10], %)
|
|
|> bezierCurve({
|
|
control1: [-10, 0],
|
|
control2: [2, 10],
|
|
to: [-5, 10]
|
|
}, %)
|
|
|> line([-5, -2], %)
|
|
|> close(%)
|
|
|> extrude(10, %)
|
|
```
|
|
|
|

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

|
|
|
|
|