Files
modeling-app/docs/kcl/offsetPlane.md
Jess Frazelle aa9abbe83f Loft (#3681)
* add loft

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add offsetPlane as well

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix offset

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* change to 2

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add-docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-09-04 14:34:33 -07:00

421 KiB
Raw Blame History

title, excerpt, layout
title excerpt layout
offsetPlane Offset a plane by a distance along its normal. manual

Offset a plane by a distance along its normal.

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.

offsetPlane(std_plane: StandardPlane, offset: number) -> PlaneData

Examples

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

const circleSketch = startSketchOn(offsetPlane('XY', 150))
  |> circle([0, 100], 50, %)

loft([squareSketch, circleSketch])

Rendered example of offsetPlane 0

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

const circleSketch = startSketchOn(offsetPlane('XZ', 150))
  |> circle([0, 100], 50, %)

loft([squareSketch, circleSketch])

Rendered example of offsetPlane 1

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

const circleSketch = startSketchOn(offsetPlane('YZ', 150))
  |> circle([0, 100], 50, %)

loft([squareSketch, circleSketch])

Rendered example of offsetPlane 2

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

const circleSketch = startSketchOn(offsetPlane('-XZ', -150))
  |> circle([0, 100], 50, %)

loft([squareSketch, circleSketch])

Rendered example of offsetPlane 3

Arguments

  • std_plane: StandardPlane - One of the standard planes. (REQUIRED)
"XY" | "-XY" | "XZ" | "-XZ" | "YZ" | "-YZ"
  • offset: number (REQUIRED)

Returns

PlaneData - Data for a plane.

"XY" |
"-XY" |
"XZ" |
"-XZ" |
"YZ" |
"-YZ" |
{
	plane: {
	// Origin of the plane.
	origin: {
	x: number,
	y: number,
	z: number,
},
	// What should the planes X axis be?
	xAxis: {
	x: number,
	y: number,
	z: number,
},
	// What should the planes Y axis be?
	yAxis: {
	x: number,
	y: number,
	z: number,
},
	// The z-axis (normal).
	zAxis: {
	x: number,
	y: number,
	z: number,
},
},
}