* updates 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> * updates 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> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * comment out Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * update artifacts Signed-off-by: Jess Frazelle <github@jessfraz.com> * small 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> * last of the artifacts Signed-off-by: Jess Frazelle <github@jessfraz.com> * update playwirght Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * add crazy multi-profile test Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * steps Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix artifact graph Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates ; Signed-off-by: Jess Frazelle <github@jessfraz.com> * more artifact grph Signed-off-by: Jess Frazelle <github@jessfraz.com> * turn back on playwright Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * playwright fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * playwright fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
122 lines
483 KiB
Markdown
122 lines
483 KiB
Markdown
---
|
|
title: "offsetPlane"
|
|
excerpt: "Offset a plane by a distance along its normal."
|
|
layout: 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.
|
|
|
|
```js
|
|
offsetPlane(
|
|
plane: PlaneData,
|
|
offset: number,
|
|
): Plane
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. 'XY') which this new plane is created from. | Yes |
|
|
| `offset` | [`number`](/docs/kcl/types/number) | Distance from the standard plane this new plane will be created at. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`Plane`](/docs/kcl/types/Plane)
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
// Loft a square and a circle on the `XY` plane using offset.
|
|
squareSketch = startSketchOn('XY')
|
|
|> startProfileAt([-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])
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
// Loft a square and a circle on the `XZ` plane using offset.
|
|
squareSketch = startSketchOn('XZ')
|
|
|> startProfileAt([-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])
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
// Loft a square and a circle on the `YZ` plane using offset.
|
|
squareSketch = startSketchOn('YZ')
|
|
|> startProfileAt([-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])
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
// Loft a square and a circle on the `-XZ` plane using offset.
|
|
squareSketch = startSketchOn('-XZ')
|
|
|> startProfileAt([-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])
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
// A circle on the XY plane
|
|
startSketchOn("XY")
|
|
|> startProfileAt([0, 0], %)
|
|
|> circle(radius = 10, center = [0, 0])
|
|
|
|
// Triangle on the plane 4 units above
|
|
startSketchOn(offsetPlane("XY", offset = 4))
|
|
|> startProfileAt([0, 0], %)
|
|
|> line(end = [10, 0])
|
|
|> line(end = [0, 10])
|
|
|> close()
|
|
```
|
|
|
|

|
|
|
|
|