chore(markdown): Some updates to the dev docs
This commit is contained in:
parent
6e2a0a33d9
commit
37e452af80
5 changed files with 374 additions and 74 deletions
59
markdown/dev/reference/api/part/addcut/en.md
Normal file
59
markdown/dev/reference/api/part/addcut/en.md
Normal file
|
@ -0,0 +1,59 @@
|
|||
---
|
||||
title: Part.addCut()
|
||||
---
|
||||
|
||||
A part's `addCut()` method allows designers to specify how the part should be cut.
|
||||
It can also be used to remove cutting information, as an alternative
|
||||
to [Part.removeCut()](/reference/api/part/removecut).
|
||||
|
||||
## Part.addCut() signature when adding cut information
|
||||
|
||||
```js
|
||||
Part.part.addCut(cut=2, material='fabric', identical=false)
|
||||
```
|
||||
|
||||
In this form, this methiod takes three parameters:
|
||||
|
||||
| Parameter | type | description | default |
|
||||
| --------- | ---- | ----------- | ------- |
|
||||
| `cut` | integer | The amount of times this part should be cut. | `2` |
|
||||
| `material` | string | The name of the material, typically one of `fabric`, `lining`, `facing`, `interfacing`, `canvas`, or `various` | `fabric` |
|
||||
| `identical` | boolean | Whether or not parts should be cut identical (true) or mirrored (false). Mirorred is often referred to as _good sides together_ | `false` |
|
||||
|
||||
## Part.addCut() signature when removing cut information
|
||||
|
||||
```js
|
||||
Part.part.addCut(false, material='fabric')
|
||||
```
|
||||
|
||||
In this form, this methiod takes two parameters:
|
||||
|
||||
| Parameter | type | description | default |
|
||||
| --------- | ---- | ----------- | ------- |
|
||||
| `cut` | `boolean` | Pass `false` to remove the cut info for the material passed as the second parameter | `2` |
|
||||
| `material` | string | The name of the material, typically one of `fabric`, `lining`, `facing`, `interfacing`, `canvas`, or `various` | `fabric` |
|
||||
|
||||
## Part.addCut() example
|
||||
|
||||
```js
|
||||
export default function (part) {
|
||||
|
||||
// Cut two from fabric with good sides together
|
||||
part.addCut(2, 'fabric')
|
||||
|
||||
// Cut seven from lining, identical
|
||||
part.addCut(7, 'lining')
|
||||
|
||||
// Remove the lining cut info (but keep the fabric info)
|
||||
part.addCut(false, 'lining')
|
||||
|
||||
// You would do more useful stuff before returning
|
||||
return part
|
||||
}
|
||||
```
|
||||
|
||||
<Tip>
|
||||
The part's grain line and whether it should be cut on fold or not will be
|
||||
set automatically when you call the [grainline](/reference/api/macros/grainline) or
|
||||
[cutonfold](/reference/api/macros/cutonfold) macro.
|
||||
</Tip>
|
58
markdown/dev/reference/api/part/removecut/en.md
Normal file
58
markdown/dev/reference/api/part/removecut/en.md
Normal file
|
@ -0,0 +1,58 @@
|
|||
---
|
||||
title: Part.removeCut()
|
||||
---
|
||||
|
||||
A part's `removeCut()` method allows designers to remove cutting information
|
||||
that was added through [Part.addCut()](/reference/api/part/addcut).
|
||||
|
||||
## Part.addCut() signature when adding cut information
|
||||
|
||||
```js
|
||||
Part.part.addCut(cut=2, material='fabric', identical=false)
|
||||
```
|
||||
|
||||
In this form, this methiod takes three parameters:
|
||||
|
||||
| Parameter | type | description | default |
|
||||
| --------- | ---- | ----------- | ------- |
|
||||
| `cut` | integer | The amount of times this part should be cut. | `2` |
|
||||
| `material` | string | The name of the material, typically one of `fabric`, `lining`, `facing`, `interfacing`, `canvas`, or `various` | `fabric` |
|
||||
| `identical` | boolean | Whether or not parts should be cut identical (true) or mirrored (false). Mirorred is often referred to as _good sides together_ | `false` |
|
||||
|
||||
## Part.addCut() signature when removing cut information
|
||||
|
||||
```js
|
||||
Part.part.addCut(false, material='fabric')
|
||||
```
|
||||
|
||||
In this form, this methiod takes two parameters:
|
||||
|
||||
| Parameter | type | description | default |
|
||||
| --------- | ---- | ----------- | ------- |
|
||||
| `cut` | `boolean` | Pass `false` to remove the cut info for the material passed as the second parameter | `2` |
|
||||
| `material` | string | The name of the material, typically one of `fabric`, `lining`, `facing`, `interfacing`, `canvas`, or `various` | `fabric` |
|
||||
|
||||
## Part.addCut() example
|
||||
|
||||
```js
|
||||
export default function (part) {
|
||||
|
||||
// Cut two from fabric with good sides together
|
||||
part.addCut(2, 'fabric')
|
||||
|
||||
// Cut seven from lining, identical
|
||||
part.addCut(7, 'lining')
|
||||
|
||||
// Remove the lining cut info (but keep the fabric info)
|
||||
part.addCut(false, 'lining')
|
||||
|
||||
// You would do more useful stuff before returning
|
||||
return part
|
||||
}
|
||||
```
|
||||
|
||||
<Tip>
|
||||
The part's grain line and whether it should be cut on fold or not will be
|
||||
set automatically when you call the [grainline](/reference/api/macros/grainline) or
|
||||
[cutonfold](/reference/api/macros/cutonfold) macro.
|
||||
</Tip>
|
47
markdown/dev/reference/api/pattern/getcutlist/en.md
Normal file
47
markdown/dev/reference/api/pattern/getcutlist/en.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
title: Pattern.getCutList()
|
||||
---
|
||||
|
||||
This method will return the cut list, which means the `cut` property of
|
||||
all parts that were included in the most recent call to `Pattern.draft()`.
|
||||
|
||||
This relies on the pattern designers properly setting the cut property
|
||||
in each part.
|
||||
|
||||
<Note>This method is chainable as it returns the Pattern object</Note>
|
||||
|
||||
## Pattern.getCutList() signature
|
||||
|
||||
```js
|
||||
Object pattern.getCutList()
|
||||
```
|
||||
|
||||
## Pattern.getCutList() example
|
||||
|
||||
```js
|
||||
import Aaron from "@freesewing/aaron"
|
||||
import models from "@freesewing/models"
|
||||
|
||||
const pattern = new Aaron({
|
||||
settings: {
|
||||
embed: true,
|
||||
},
|
||||
measurements: models.manSize38
|
||||
})
|
||||
|
||||
const cutList = pattern.draft().getCutList()
|
||||
```
|
||||
## Cut list format
|
||||
|
||||
The object returned by `Pattern.getCutList()` is a plain object
|
||||
with a property for each part that will be included in the pattern's output.
|
||||
|
||||
The value of these properties is the `cut` property of the part in question.
|
||||
|
||||
<Tip>
|
||||
Refer to [part.addCut()](/reference/api/part/addcut) for details on the
|
||||
format of a part's `cut` property
|
||||
</Tip>
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue