2023-05-07 08:37:03 -07:00
|
|
|
---
|
|
|
|
title: Stack
|
|
|
|
---
|
|
|
|
|
2023-05-26 18:42:20 -07:00
|
|
|
A Stack object represents a collection of parts within a pattern.
|
|
|
|
Stacks are used when laying out the pattern.
|
2023-05-07 08:37:03 -07:00
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::note RELATED
|
2023-05-07 08:37:03 -07:00
|
|
|
|
2023-05-31 21:44:58 -07:00
|
|
|
See [Stacks](/guides/designs/stacks)
|
2023-05-26 18:42:20 -07:00
|
|
|
for information about how stacks are used in a pattern.
|
2023-05-07 08:37:03 -07:00
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::
|
2023-05-07 08:37:03 -07:00
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
|
|
|
```js
|
|
|
|
Stack new Stack(String name)
|
|
|
|
```
|
|
|
|
|
|
|
|
The stack constructor takes a single argument, a String containing the name
|
|
|
|
of the stack.
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
Stack objects come with the following properties:
|
|
|
|
|
2023-05-26 18:42:20 -07:00
|
|
|
- `attributes` : An [Attributes](/reference/api/attributes) instance holding the stack's attributes
|
2023-05-07 08:37:03 -07:00
|
|
|
- `parts` : A set of parts in the stack
|
|
|
|
- `name` : The name of the stack
|
|
|
|
- `topleft` : A [Point](/reference/api/point) that is the top left of the stack's bounding box
|
|
|
|
- `bottomRight` : A [Point](/reference/api/point) that is the bottom right of the stack's bounding box
|
|
|
|
- `width` : The width of the stack in mm
|
|
|
|
- `height` : The height of the stack in mm
|
|
|
|
- `anchor` : A [Point](/reference/api/point) that is used as the anchor to align parts in the stack
|
|
|
|
|
|
|
|
|
|
|
|
## Methods
|
|
|
|
|
|
|
|
A Stack object exposes the following methods:
|
|
|
|
|
2024-01-29 08:43:38 -08:00
|
|
|
<ReadMore />
|