1
0
Fork 0

fix(markdown): Add Pattern.draftPartForSet() documentation

This commit is contained in:
Benjamin Fan 2024-02-02 10:05:59 -08:00
parent b9f1ef7a08
commit c7bee798d0

View file

@ -2,4 +2,32 @@
title: Pattern.draftPartForSet()
---
FIXME: write docs
A pattern's `draftPartForSet()` method will draft a part using a
given set of settings.
<Note>This method is chainable as it returns the Pattern object</Note>
## Pattern.draftPartForSet() signature
```js
Pattern pattern.draftPartForSet(part, set)
```
## Pattern.draftPartForSet() example
```js
import { Aaron } from "@freesewing/aaron"
// Load a public test settings set from the FreeSewing backend
const set = (
await (
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
).json()
)
const pattern = new Aaron()
for (const part in pattern.parts) {
const svg = pattern.draftPartForSet(part, set).render()
}
```