Files
modeling-app/docs/kcl/extrude.md
Nick Cameron a8b0e1a771 Use arrays for multiple geometry (#5770)
* 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>
2025-03-17 17:57:26 +13:00

163 KiB

title, excerpt, layout
title excerpt layout
extrude 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. 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.

You can provide more than one sketch to extrude, and they will all be extruded in the same direction.

extrude(
  sketches: [Sketch],
  length: number,
): [Solid]

Arguments

Name Type Description Required
sketches [Sketch] Which sketch or sketches should be extruded Yes
length number How far to extrude the given sketches Yes

Returns

[Solid]

Examples

example = startSketchOn('XZ')
  |> startProfileAt([0, 0], %)
  |> line(end = [10, 0])
  |> arc({
       angleStart = 120,
       angleEnd = 0,
       radius = 5
     }, %)
  |> line(end = [5, 0])
  |> line(end = [0, 10])
  |> bezierCurve({
       control1 = [-10, 0],
       control2 = [2, 10],
       to = [-5, 10]
     }, %)
  |> line(end = [-5, -2])
  |> close()
  |> extrude(length = 10)

Rendered example of extrude 0

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

example = extrude(exampleSketch, length = 10)

Rendered example of extrude 1