* 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> * allow a helix to go into a sweep Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy 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> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * snapshots Signed-off-by: Jess Frazelle <github@jessfraz.com> * docs Signed-off-by: Jess Frazelle <github@jessfraz.com> * docs Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix 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> * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * 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> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * em,pty * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * 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
343 KiB
Markdown
78 lines
343 KiB
Markdown
---
|
|
title: "sweep"
|
|
excerpt: "Extrude a sketch along a path."
|
|
layout: manual
|
|
---
|
|
|
|
Extrude a sketch along a path.
|
|
|
|
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 path. This is useful for creating more complex shapes that can't be created with a simple extrusion.
|
|
|
|
```js
|
|
sweep(data: SweepData, sketch: Sketch) -> Solid
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `data` | [`SweepData`](/docs/kcl/types/SweepData) | Data for a sweep. | Yes |
|
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
// Create a pipe using a sweep.
|
|
|
|
|
|
// Create a path for the sweep.
|
|
sweepPath = startSketchOn('XZ')
|
|
|> startProfileAt([0.05, 0.05], %)
|
|
|> line([0, 7], %)
|
|
|> tangentialArc({ offset = 90, radius = 5 }, %)
|
|
|> line([-3, 0], %)
|
|
|> tangentialArc({ offset = -90, radius = 5 }, %)
|
|
|> line([0, 7], %)
|
|
|
|
// Create a hole for the pipe.
|
|
pipeHole = startSketchOn('XY')
|
|
|> circle({ center = [0, 0], radius = 1.5 }, %)
|
|
|
|
sweepSketch = startSketchOn('XY')
|
|
|> circle({ center = [0, 0], radius = 2 }, %)
|
|
|> hole(pipeHole, %)
|
|
|> sweep({ path = sweepPath }, %)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
// Create a spring by sweeping around a helix path.
|
|
|
|
|
|
// Create a helix around the Z axis.
|
|
helixPath = helix({
|
|
angleStart = 0,
|
|
ccw = true,
|
|
revolutions = 16,
|
|
length = 10,
|
|
radius = 5,
|
|
axis = 'Z'
|
|
})
|
|
|
|
// Create a spring by sweeping around the helix path.
|
|
springSketch = startSketchOn('YZ')
|
|
|> circle({ center = [0, 0], radius = 1 }, %)
|
|
// |> sweep({ path = helixPath }, %)
|
|
```
|
|
|
|

|
|
|
|
|