Files
modeling-app/docs/kcl/translate.md
Nick Cameron 1104d908c0 Improve hover tool tips and function docs (#5538)
* Improve hover tool tips and function docs

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

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-27 22:03:37 +13:00

104 KiB

title, excerpt, layout
title excerpt layout
translate Move a solid. manual

Move a solid.

translate(
  solid: Solid,
  translate: [number],
  global?: bool,
) -> Solid

Arguments

Name Type Description Required
solid Solid The solid to move. Yes
translate [number] The amount to move the solid in all three axes. Yes
global bool If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move. No

Returns

Solid - A solid is a collection of extrude surfaces.

Examples

// Move a pipe.


// Create a path for the sweep.
sweepPath = startSketchOn('XZ')
  |> startProfileAt([0.05, 0.05], %)
  |> line(end = [0, 7])
  |> tangentialArc({ offset = 90, radius = 5 }, %)
  |> line(end = [-3, 0])
  |> tangentialArc({ offset = -90, radius = 5 }, %)
  |> line(end = [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)
  |> translate(translate = [1.0, 1.0, 2.5])

Rendered example of translate 0