Files
modeling-app/docs/kcl/hole.md
Nick Cameron 5d25f4a0e5 Support types in the standard library (#5651)
* Parse an unparse type decls (and refactor impl attributes slightly)

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Remove special treatment of geometric types from parser and executor

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Generate docs for std types

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Hover tool-tips for types and fixup the frontend

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Fixes

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-07 09:53:34 -05:00

192 KiB

title, excerpt, layout
title excerpt layout
hole Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch. manual

Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.

hole(
  holeSketch: SketchSet,
  sketch: Sketch,
): Sketch

Arguments

Name Type Description Required
holeSketch SketchSet A sketch or a group of sketches. Yes
sketch Sketch Yes

Returns

Sketch

Examples

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)

Rendered example of hole 0

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)

Rendered example of hole 1