2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
title: Pattern
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-02-19 08:04:25 +01:00
|
|
|
The `Pattern` object in FreeSewing's core library holds all data and logic of a pattern.
|
2022-09-20 18:09:28 +02:00
|
|
|
It is the parametric blueprint that when instantiated with a user's settings
|
2023-10-21 11:46:17 +02:00
|
|
|
can draft a bespoke sewing pattern.
|
2021-09-25 17:05:18 +02:00
|
|
|
|
2022-09-20 18:09:28 +02:00
|
|
|
## Creating a Pattern
|
|
|
|
|
|
|
|
A Pattern in FreeSewing is an instantiated Design:
|
|
|
|
|
|
|
|
```js
|
|
|
|
import { Florence } from "@freesewing/florence"
|
|
|
|
|
|
|
|
const pattern = new Florence()
|
|
|
|
```
|
|
|
|
|
2022-10-12 19:09:04 +02:00
|
|
|
You probably want to create a pattern using your own [settings](/reference/settings):
|
2021-09-25 17:05:18 +02:00
|
|
|
|
|
|
|
```js
|
2022-09-20 18:09:28 +02:00
|
|
|
import { Florence } from "@freesewing/florence"
|
|
|
|
|
|
|
|
const pattern = new Florence({
|
|
|
|
paperless: true,
|
|
|
|
measurements: {
|
|
|
|
head: 390,
|
|
|
|
}
|
|
|
|
})
|
2021-09-25 17:05:18 +02:00
|
|
|
```
|
|
|
|
|
2022-09-20 18:09:28 +02:00
|
|
|
## Multisets in FreeSewing
|
|
|
|
|
|
|
|
You can pass the Pattern constructor an array of multiple settings objects:
|
|
|
|
|
|
|
|
```js
|
|
|
|
import { Florence } from "@freesewing/florence"
|
|
|
|
|
|
|
|
const pattern = new Florence([
|
|
|
|
{
|
|
|
|
measurements: {
|
|
|
|
head: 390,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
measurements: {
|
|
|
|
head: 420,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
])
|
|
|
|
```
|
|
|
|
|
|
|
|
We refer to these *multiple sets of settings* as **multisets**.
|
|
|
|
It is what powers FreeSewing's [sampling capabilities](/reference/api/pattern/sample) but
|
|
|
|
it also allows you to draft some pattern parts with one set of measurements, and other parts
|
2022-12-14 12:52:37 -08:00
|
|
|
with another set. For example if you have an asymmetric model to fit.
|
2022-09-20 18:09:28 +02:00
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::note
|
2022-09-20 18:09:28 +02:00
|
|
|
|
|
|
|
##### Core always keeps a set of settings
|
2021-09-25 17:05:18 +02:00
|
|
|
|
2022-09-20 18:09:28 +02:00
|
|
|
Multisets is an advanced feature of FreeSewing, and for the most part you can forget about it
|
|
|
|
until the day you want to use it.
|
2021-09-25 17:05:18 +02:00
|
|
|
|
2022-09-20 18:09:28 +02:00
|
|
|
However, it's good to keep in mind that under the hood, FreeSewing will always use a set of settings.
|
|
|
|
It just so happens that in most cases, there will be only one settings object in the set.
|
2021-09-25 17:05:18 +02:00
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-02 21:45:17 +02:00
|
|
|
## Pattern attributes
|
|
|
|
|
2022-10-04 21:51:13 +02:00
|
|
|
- `Pattern.activePart`: Holds the id of the active part (while drafting)
|
|
|
|
- `Pattern.activeSet`: Holds the id of the active set (while drafting)
|
2022-12-08 20:40:31 -08:00
|
|
|
- `Pattern.config`: Holds the resolved pattern's configuration
|
|
|
|
- `Pattern.designConfig`: Holds the design's configuration before resolution
|
|
|
|
- `Pattern.parts`: Holds the parts used in the pattern
|
|
|
|
- `Pattern.plugins`: Holds the plugins used in the pattern
|
|
|
|
- `Pattern.settings`: Holds the settings used for the pattern
|
2023-05-07 08:37:03 -07:00
|
|
|
- `Pattern.stacks`: Holds the stacks used in the pattern
|
2022-10-02 21:45:17 +02:00
|
|
|
- `Pattern.store`: Holds the pattern-wide Store
|
|
|
|
- `Pattern.setStores`: Holds an array of stores, one for each set of settings.
|
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
## Pattern methods
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2024-01-29 08:43:38 -08:00
|
|
|
<ReadMore />
|