* 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>
51 lines
84 KiB
Markdown
51 lines
84 KiB
Markdown
---
|
|
title: "union"
|
|
excerpt: "Union two or more solids into a single solid."
|
|
layout: manual
|
|
---
|
|
|
|
**WARNING:** This function is deprecated.
|
|
|
|
Union two or more solids into a single solid.
|
|
|
|
|
|
|
|
```js
|
|
union(solids: [Solid]): [Solid]
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `solids` | [`[Solid]`](/docs/kcl/types/Solid) | The solids to union. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`[Solid]`](/docs/kcl/types/Solid)
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
fn cube(center) {
|
|
return startSketchOn(XY)
|
|
|> startProfileAt([center[0] - 10, center[1] - 10], %)
|
|
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|
|
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|
|
|> line(endAbsolute = [center[0] - 10, center[1] + 10])
|
|
|> close()
|
|
|> extrude(length = 10)
|
|
}
|
|
|
|
part001 = cube([0, 0])
|
|
part002 = cube([20, 10])
|
|
|
|
unionedPart = union([part001, part002])
|
|
```
|
|
|
|

|
|
|
|
|