* Parse [T] instead of T[] for array types Signed-off-by: Nick Cameron <nrc@ncameron.org> * homogenous arrays, type coercion, remove solid set and sketch set, etc Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
68 lines
192 KiB
Markdown
68 lines
192 KiB
Markdown
---
|
|
title: "hole"
|
|
excerpt: "Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch."
|
|
layout: manual
|
|
---
|
|
|
|
Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.
|
|
|
|
|
|
|
|
```js
|
|
hole(
|
|
holeSketch: [Sketch],
|
|
sketch: Sketch,
|
|
): Sketch
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `holeSketch` | [`[Sketch]`](/docs/kcl/types/Sketch) | | Yes |
|
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
|
|
|
### Returns
|
|
|
|
[`Sketch`](/docs/kcl/types/Sketch)
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
exampleSketch = startSketchOn(XY)
|
|
|> startProfileAt([0, 0], %)
|
|
|> line(end = [0, 5])
|
|
|> line(end = [5, 0])
|
|
|> line(end = [0, -5])
|
|
|> close()
|
|
|> hole(circle(center = [1, 1], radius = .25), %)
|
|
|> hole(circle(center = [1, 4], radius = .25), %)
|
|
|
|
example = extrude(exampleSketch, length = 1)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
fn squareHoleSketch() {
|
|
squareSketch = startSketchOn(-XZ)
|
|
|> startProfileAt([-1, -1], %)
|
|
|> line(end = [2, 0])
|
|
|> line(end = [0, 2])
|
|
|> line(end = [-2, 0])
|
|
|> close()
|
|
return squareSketch
|
|
}
|
|
|
|
exampleSketch = startSketchOn(-XZ)
|
|
|> circle(center = [0, 0], radius = 3)
|
|
|> hole(squareHoleSketch(), %)
|
|
example = extrude(exampleSketch, length = 1)
|
|
```
|
|
|
|

|
|
|
|
|