1
0
Fork 0
freesewing/markdown/dev/reference/api/part/en.md

38 lines
848 B
Markdown
Raw Normal View History

---
title: Part
---
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.
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 ],
],
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:
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)