Files
modeling-app/docs/kcl-std/functions/std-offsetPlane.md
2025-06-19 17:08:46 +12:00

510 KiB

title, subtitle, excerpt, layout
title subtitle excerpt layout
offsetPlane Function in std Offset a plane by a distance along its normal. manual

Offset a plane by a distance along its normal.

// Loft a square and a circle on the `XY` plane using offset.
squareSketch = startSketchOn(XY)
  |> startProfile(at = [-100, 200])
  |> line(end = [200, 0])
  |> line(end = [0, -200])
  |> line(end = [-200, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

circleSketch = startSketchOn(offsetPlane(XY, offset = 150))
  |> circle(center = [0, 100], radius = 50)

loft([squareSketch, circleSketch])

Arguments

Name Type Description Required
plane Plane The plane (e.g. XY) which this new plane is created from. Yes
offset number(Length) Distance from the standard plane this new plane will be created at. Yes

Returns

Plane - An abstract plane.

Description

For example, if you offset the XZ plane by 10, the new plane will be parallel to the XZ plane and 10 units away from it.

Function signature

offsetPlane(
  @plane: Plane,
  offset: number(Length),
): Plane

Examples

// Loft a square and a circle on the `XY` plane using offset.
squareSketch = startSketchOn(XY)
  |> startProfile(at = [-100, 200])
  |> line(end = [200, 0])
  |> line(end = [0, -200])
  |> line(end = [-200, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

circleSketch = startSketchOn(offsetPlane(XY, offset = 150))
  |> circle(center = [0, 100], radius = 50)

loft([squareSketch, circleSketch])

Rendered example of offsetPlane 0

// Loft a square and a circle on the `XZ` plane using offset.
squareSketch = startSketchOn(XZ)
  |> startProfile(at = [-100, 200])
  |> line(end = [200, 0])
  |> line(end = [0, -200])
  |> line(end = [-200, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

circleSketch = startSketchOn(offsetPlane(XZ, offset = 150))
  |> circle(center = [0, 100], radius = 50)

loft([squareSketch, circleSketch])

Rendered example of offsetPlane 1

// Loft a square and a circle on the `YZ` plane using offset.
squareSketch = startSketchOn(YZ)
  |> startProfile(at = [-100, 200])
  |> line(end = [200, 0])
  |> line(end = [0, -200])
  |> line(end = [-200, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

circleSketch = startSketchOn(offsetPlane(YZ, offset = 150))
  |> circle(center = [0, 100], radius = 50)

loft([squareSketch, circleSketch])

Rendered example of offsetPlane 2

// Loft a square and a circle on the `-XZ` plane using offset.
squareSketch = startSketchOn(-XZ)
  |> startProfile(at = [-100, 200])
  |> line(end = [200, 0])
  |> line(end = [0, -200])
  |> line(end = [-200, 0])
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()

circleSketch = startSketchOn(offsetPlane(-XZ, offset = 150))
  |> circle(center = [0, 100], radius = 50)

loft([squareSketch, circleSketch])

Rendered example of offsetPlane 3

// A circle on the XY plane
startSketchOn(XY)
  |> startProfile(at = [0, 0])
  |> circle(radius = 10, center = [0, 0])

// Triangle on the plane 4 units above
startSketchOn(offsetPlane(XY, offset = 4))
  |> startProfile(at = [0, 0])
  |> line(end = [10, 0])
  |> line(end = [0, 10])
  |> close()

Rendered example of offsetPlane 4