2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
title: Pattern
|
|
|
|
order: 15
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-10-17 18:26:00 +02:00
|
|
|
The `Pattern` object in FreeSewing's core library holds all data and logic of a pattern.
|
2021-09-25 17:05:18 +02:00
|
|
|
It is the parametric blueprint that when instantiated with a user's measurements and
|
|
|
|
objects will generated a made-to-measure pattern.
|
|
|
|
|
|
|
|
## Pattern constructor
|
|
|
|
|
|
|
|
```js
|
|
|
|
function freesewing.Pattern(object settings)
|
|
|
|
```
|
|
|
|
|
2022-01-12 19:27:07 +01:00
|
|
|
A pattern is instantiated by passing a [settings object](/reference/api/settings/) to the pattern constructor.
|
2021-09-25 17:05:18 +02:00
|
|
|
|
|
|
|
This settings objects holds, amongst other things, the measurements and options chosen by the user.
|
2022-01-12 19:27:07 +01:00
|
|
|
Refer to the [settings documentation](/reference/api/settings/) for an exhaustive list.
|
2021-09-25 17:05:18 +02:00
|
|
|
|
2021-10-17 18:26:00 +02:00
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
## Pattern properties
|
|
|
|
|
|
|
|
| Property | Description |
|
|
|
|
| --------:| ----------- |
|
|
|
|
| `config` | The pattern configuration |
|
|
|
|
| `is` | A string that will be set to `draft` or `sample` when you respectively draft or sample a pattern. |
|
|
|
|
| `options` | The options as set by the user |
|
|
|
|
| `parts` | A plain object to hold your parts |
|
2022-01-12 19:27:07 +01:00
|
|
|
| `Part` | The [Part](/reference/api/part) constructor |
|
2021-09-25 17:05:18 +02:00
|
|
|
| `settings` | The settings as set by the user |
|
2022-01-12 19:27:07 +01:00
|
|
|
| `store` | A [Store](/reference/api/store) instance |
|
|
|
|
| `svg` | An [Svg](/reference/api/svg) instance |
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-10-17 18:26:00 +02:00
|
|
|
- `settings` : The settings as set by the user
|
|
|
|
- `options` : the options as set by the user
|
|
|
|
- `config` : The pattern configuration
|
|
|
|
- `parts` : A plain object to hold your parts
|
2022-01-12 19:27:07 +01:00
|
|
|
- `Part` : The [Part](/reference/api/part) constructor
|
|
|
|
- `store` : A [Store](/reference/api/store) instance
|
|
|
|
- `svg` : An [Svg](/reference/api/svg) instance
|
2021-10-17 18:26:00 +02:00
|
|
|
- `is` : A string that will be set to `draft` or `sample` when you respectively draft or sample a pattern.
|
|
|
|
This allows plugins that hook into your pattern to determine what to do in a given scenario.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
## Pattern methods
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
<ReadMore list />
|