2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
title: Part
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-20 18:09:28 +02:00
|
|
|
A `Part` in FreeSewing holds all data, logic, and configuration of a Design.
|
|
|
|
Parts truly are the building blocks of FreeSewing as they not only provide
|
2022-12-14 12:52:37 -08:00
|
|
|
the configuration, but also a `draft()` method that does the actual work
|
2022-09-20 18:09:28 +02:00
|
|
|
of drafting a parametric design.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-21 09:55:21 +02:00
|
|
|
## Example
|
2022-09-20 18:09:28 +02:00
|
|
|
|
|
|
|
```js
|
2022-09-21 09:55:21 +02:00
|
|
|
const part = {
|
|
|
|
name: 'example.part',
|
|
|
|
from: otherPart,
|
|
|
|
after: [ yetAnotherPart, oneMorePart ],
|
|
|
|
measurements: ['head', 'chest' ],
|
|
|
|
optionalMeasurements: ['neck'],
|
|
|
|
options: {
|
|
|
|
headEase: { pct: 12, min: 5, max: 20 }
|
|
|
|
}
|
|
|
|
hide: false,
|
|
|
|
hideAll: false,
|
|
|
|
hideDependencies: true,
|
|
|
|
plugins: [
|
|
|
|
plugin1,
|
|
|
|
plugin1,
|
|
|
|
[ plugin3, dataForPlugin3 ],
|
2022-10-09 23:47:58 +02:00
|
|
|
],
|
|
|
|
draft: ({ part }) => part
|
2022-09-21 09:55:21 +02:00
|
|
|
}
|
2022-09-20 18:09:28 +02:00
|
|
|
```
|
|
|
|
|
2022-09-21 09:55:21 +02:00
|
|
|
Click below to learn more about:
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-21 09:55:21 +02:00
|
|
|
- [A part's configuration](/reference/api/part/config)
|
|
|
|
- [A part's `draft()` method](/reference/api/part/draft)
|