Files
modeling-app/docs/kcl-std/extrude.md
Nick Cameron 1841e63021 Misc docs polishing (#6712)
* Fake modules for Rust std lib functions

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

* Include the missing @ in Rust std lib fns

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

* Move revolve and mirror2d to better modules

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

* Use docs from KCL mods for type summaries

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

* Use type docs to describe types from KCL std lib

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 16:09:59 +12:00

342 KiB

title, excerpt, layout
title excerpt layout
std::sketch::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,
  symmetric?: bool,
  bidirectionalLength?: number,
  tagStart?: TagDeclarator,
  tagEnd?: TagDeclarator,
): [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
symmetric bool If true, the extrusion will happen symmetrically around the sketch. Otherwise, the No
bidirectionalLength number If specified, will also extrude in the opposite direction to 'distance' to the specified distance. If 'symmetric' is true, this value is ignored. No
tagStart TagDeclarator A named tag for the face at the start of the extrusion, i.e. the original sketch No
tagEnd TagDeclarator A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch No

Returns

[Solid]

Examples

example = startSketchOn(XZ)
  |> startProfile(at = [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], end = [-5, 10])
  |> line(end = [-5, -2])
  |> close()
  |> extrude(length = 10)

Rendered example of std::sketch::extrude 0

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [-10, 0])
  |> arc(angleStart = 120, angleEnd = -60, radius = 5)
  |> line(end = [10, 0])
  |> line(end = [5, 0])
  |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])
  |> line(end = [-4, 10])
  |> line(end = [-5, -2])
  |> close()

example = extrude(exampleSketch, length = 10)

Rendered example of std::sketch::extrude 1

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [-10, 0])
  |> arc(angleStart = 120, angleEnd = -60, radius = 5)
  |> line(end = [10, 0])
  |> line(end = [5, 0])
  |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])
  |> line(end = [-4, 10])
  |> line(end = [-5, -2])
  |> close()

example = extrude(exampleSketch, length = 20, symmetric = true)

Rendered example of std::sketch::extrude 2

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [-10, 0])
  |> arc(angleStart = 120, angleEnd = -60, radius = 5)
  |> line(end = [10, 0])
  |> line(end = [5, 0])
  |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])
  |> line(end = [-4, 10])
  |> line(end = [-5, -2])
  |> close()

example = extrude(exampleSketch, length = 10, bidirectionalLength = 50)

Rendered example of std::sketch::extrude 3