fix(dev): One-liner admonitions
This commit is contained in:
parent
a6d656c19e
commit
da41cc0fc9
60 changed files with 860 additions and 659 deletions
|
@ -1,12 +1,20 @@
|
||||||
---
|
---
|
||||||
title: "Include Cutting Instructions"
|
title: 'Include Cutting Instructions'
|
||||||
---
|
---
|
||||||
|
|
||||||
To include cutting instructions with your part, use the [annotations plugin](/reference/plugins/annotations) (included by default via [core-plugins](/reference/plugins/core)) to add the `cutlist.addCut` method to your part's [`store`](/reference/api/store/extend).
|
To include cutting instructions with your part, use the [annotations plugin](/reference/plugins/annotations) (included by default via [core-plugins](/reference/plugins/core)) to add the `cutlist.addCut` method to your part's [`store`](/reference/api/store/extend).
|
||||||
|
|
||||||
:::tipThe [grainline macro](/reference/macros/grainline) and the [cutonfold macro](/reference/macros/cutonfold) will automatically add grain and fold information to the cutting instructions :::
|
:::tip
|
||||||
|
The [grainline macro](/reference/macros/grainline) and the [cutonfold
|
||||||
|
macro](/reference/macros/cutonfold) will automatically add grain and fold
|
||||||
|
information to the cutting instructions
|
||||||
|
:::
|
||||||
|
|
||||||
:::tipThese cutting instructions get used by the [title macro](/reference/macros/title), so be sure to add them before adding your part's title. :::
|
:::tip
|
||||||
|
These cutting instructions get used by the [title
|
||||||
|
macro](/reference/macros/title), so be sure to add them before adding your
|
||||||
|
part's title.
|
||||||
|
:::
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
<details>
|
<details>
|
||||||
|
@ -15,18 +23,17 @@ To include cutting instructions with your part, use the [annotations plugin](/re
|
||||||
Pass an object to the `store.cutlist.addCut` method with any of the following keys; any you don't provide will be filled with the defaults:
|
Pass an object to the `store.cutlist.addCut` method with any of the following keys; any you don't provide will be filled with the defaults:
|
||||||
|
|
||||||
| Key | Type | Default | Description |
|
| Key | Type | Default | Description |
|
||||||
| :-- | :--- | :------ | :---------- |
|
| :----------- | :------------ | :------- | :--------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| cut | Number\|false | 2 | the number of pieces to cut from the specified material. Pass `false` to clear all cutting instructions for the material |
|
| cut | Number\|false | 2 | the number of pieces to cut from the specified material. Pass `false` to clear all cutting instructions for the material |
|
||||||
| material | String | 'fabric' | the translation key of the material to cut from |
|
| material | String | 'fabric' | the translation key of the material to cut from |
|
||||||
| identical | Boolean | false | should even numbers of pieces be cut in the same direction? false for mirrored |
|
| identical | Boolean | false | should even numbers of pieces be cut in the same direction? false for mirrored |
|
||||||
| bias | Boolean | false | should the pieces in these cutting instructions be cut on the bias? 'false' uses grainline instruction or leaves orientation as is |
|
| bias | Boolean | false | should the pieces in these cutting instructions be cut on the bias? 'false' uses grainline instruction or leaves orientation as is |
|
||||||
| ignoreOnFold | Boolean | false | should these cutting instructions ignore any cutOnFold information set by the part |
|
| ignoreOnFold | Boolean | false | should these cutting instructions ignore any cutOnFold information set by the part |
|
||||||
|
|
||||||
|
|
||||||
You can use any `string` you want for your material, but here are some standard ones we have translation for
|
You can use any `string` you want for your material, but here are some standard ones we have translation for
|
||||||
|
|
||||||
| Key | Translation |
|
| Key | Translation |
|
||||||
|:--|:--|
|
| :---------- | :-------------------------- |
|
||||||
| fabric | Main Fabric |
|
| fabric | Main Fabric |
|
||||||
| lining | Lining |
|
| lining | Lining |
|
||||||
| canvas | Canvas |
|
| canvas | Canvas |
|
||||||
|
@ -39,8 +46,8 @@ You can use any `string` you want for your material, but here are some standard
|
||||||
</details>
|
</details>
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
For simple cutting instructions, you can rely on the default method parameters
|
For simple cutting instructions, you can rely on the default method parameters
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -49,11 +56,12 @@ const part = {
|
||||||
draft: ({ part, store }) => {
|
draft: ({ part, store }) => {
|
||||||
// add instructions to cut two mirrored from main fabric
|
// add instructions to cut two mirrored from main fabric
|
||||||
store.cutlist.addCut()
|
store.cutlist.addCut()
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Intermediate Usage
|
## Intermediate Usage
|
||||||
|
|
||||||
For many designs, you'll want more than just "Cut 2 mirrored from Main Fabric"
|
For many designs, you'll want more than just "Cut 2 mirrored from Main Fabric"
|
||||||
|
|
||||||
### Specifying materials, number of pieces, orientation
|
### Specifying materials, number of pieces, orientation
|
||||||
|
@ -66,11 +74,12 @@ const part = {
|
||||||
draft: ({ part, store }) => {
|
draft: ({ part, store }) => {
|
||||||
// add instructions to cut three identical from lining
|
// add instructions to cut three identical from lining
|
||||||
store.cutlist.addCut({ cut: 3, material: 'lining', identical: true })
|
store.cutlist.addCut({ cut: 3, material: 'lining', identical: true })
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Instructions for multiple materials
|
### Instructions for multiple materials
|
||||||
|
|
||||||
You can add as many sets of instructions as you need
|
You can add as many sets of instructions as you need
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -81,13 +90,14 @@ const part = {
|
||||||
store.cutlist.addCut({ cut: 4 })
|
store.cutlist.addCut({ cut: 4 })
|
||||||
// add instructions to cut three identical from lining
|
// add instructions to cut three identical from lining
|
||||||
store.cutlist.addCut({ cut: 3, material: 'lining', identical: true })
|
store.cutlist.addCut({ cut: 3, material: 'lining', identical: true })
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Advanced usage
|
## Advanced usage
|
||||||
|
|
||||||
### Cut some on the fold, some not
|
### Cut some on the fold, some not
|
||||||
|
|
||||||
Sometimes you want some pieces cut on the fold and others cut as halves to seam together.
|
Sometimes you want some pieces cut on the fold and others cut as halves to seam together.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -105,12 +115,12 @@ const part = {
|
||||||
store.cutlist.addCut()
|
store.cutlist.addCut()
|
||||||
// cut two, not on the fold
|
// cut two, not on the fold
|
||||||
store.cutlist.addCut({ cut: 2, ignoreOnFold: true })
|
store.cutlist.addCut({ cut: 2, ignoreOnFold: true })
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Cut some on the grain, some on the bias
|
### Cut some on the grain, some on the bias
|
||||||
|
|
||||||
You set the grainline on a piece, but you also need some to be cut on the bias
|
You set the grainline on a piece, but you also need some to be cut on the bias
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -128,6 +138,6 @@ const part = {
|
||||||
store.cutlist.addCut()
|
store.cutlist.addCut()
|
||||||
// cut two mirrored on the bias
|
// cut two mirrored on the bias
|
||||||
store.cutlist.addCut({ cut: 2, bias: true })
|
store.cutlist.addCut({ cut: 2, bias: true })
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -37,7 +37,9 @@ const Sorcha = new Design({
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipA Design in FreeSewing is little more than a container for various Parts:::
|
:::tip
|
||||||
|
A Design in FreeSewing is little more than a container for various Parts
|
||||||
|
:::
|
||||||
|
|
||||||
Optionally, you can also pass it a `data` attribute
|
Optionally, you can also pass it a `data` attribute
|
||||||
to hold any custom data you'd like to add to your Design.
|
to hold any custom data you'd like to add to your Design.
|
||||||
|
@ -51,14 +53,13 @@ const Sorcha = new Design({
|
||||||
data: {
|
data: {
|
||||||
version: 3,
|
version: 3,
|
||||||
price: 12,
|
price: 12,
|
||||||
currency: 'euro'
|
currency: 'euro',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
|
|
||||||
The Design constructor is a _super-constructor_.
|
The Design constructor is a _super-constructor_.
|
||||||
It will return a constructor method that will a pattern based on your design.
|
It will return a constructor method that will a pattern based on your design.
|
||||||
|
|
||||||
|
@ -74,4 +75,3 @@ This holds the design configuration as passed to the Design constructor.
|
||||||
### Design.patternConfig
|
### Design.patternConfig
|
||||||
|
|
||||||
Holds the resolved pattern configuration based on the configuration passed to the Design constructor.
|
Holds the resolved pattern configuration based on the configuration passed to the Design constructor.
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,13 @@ title: Hiding parts
|
||||||
|
|
||||||
The `hide` option of a part's configuration controls how to hide it and/or its dependencies.
|
The `hide` option of a part's configuration controls how to hide it and/or its dependencies.
|
||||||
|
|
||||||
:::tipA hidden part will not be included in the output when it's rendered:::
|
:::tip
|
||||||
:::tipThe `hide` configuration from parts that you include in your design will always override configuration from inherited parts.:::
|
A hidden part will not be included in the output when it's rendered
|
||||||
|
:::
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
The `hide` configuration from parts that you include in your design will always override configuration from inherited parts.
|
||||||
|
:::
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
|
|
||||||
|
@ -21,11 +26,10 @@ const part = {
|
||||||
after: [exampleBase],
|
after: [exampleBase],
|
||||||
// hide `exampleBase`
|
// hide `exampleBase`
|
||||||
hide: { after: true },
|
hide: { after: true },
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### hide.always
|
### hide.always
|
||||||
|
|
||||||
To hide a specific part that would otherwise not be hidden by other configuration, add its name to the `hide.always` array
|
To hide a specific part that would otherwise not be hidden by other configuration, add its name to the `hide.always` array
|
||||||
|
@ -38,7 +42,7 @@ const part = {
|
||||||
after: [exampleBase, exampleBack],
|
after: [exampleBase, exampleBack],
|
||||||
// hide `exampleBack`
|
// hide `exampleBack`
|
||||||
hide: { always: ['example.back'] },
|
hide: { always: ['example.back'] },
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -54,15 +58,22 @@ const part = {
|
||||||
from: exampleBase,
|
from: exampleBase,
|
||||||
// hide exampleBase
|
// hide exampleBase
|
||||||
hide: { from: true },
|
hide: { from: true },
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### hide.inherited
|
### hide.inherited
|
||||||
|
|
||||||
To hide parts that you have not explicitly included in this part that may be pulled in by the explicitly included `from` and `after` parts, set `hide.inherited` to a truthy value.
|
To hide parts that you have not explicitly included in this part that may be
|
||||||
|
pulled in by the explicitly included `from` and `after` parts, set
|
||||||
|
`hide.inherited` to a truthy value.
|
||||||
|
|
||||||
:::noteThis setting will hide any part included as `from` or `after` by your explicitly included `from` part or its dependency chain. It will also hide any part included as `from` by your explicitly included `after` part or its dependency chain. It will not hide the `after` parts of `after` parts:::
|
:::note
|
||||||
|
This setting will hide any part included as `from` or `after` by your
|
||||||
|
explicitly included `from` part or its dependency chain. It will also hide any
|
||||||
|
part included as `from` by your explicitly included `after` part or its
|
||||||
|
dependency chain. It will not hide the `after` parts of `after` parts
|
||||||
|
:::
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// the "after" chain
|
// the "after" chain
|
||||||
|
@ -109,30 +120,32 @@ const mainBack = {
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Need more clarity?</summary>
|
<summary>Need more clarity?</summary>
|
||||||
|
|
||||||
In the above example, the dependency tree for the part `example.mainBack` resolves to the following, with `from` dependencies in **bold** and `after` dependencies *italicized*.
|
In the above example, the dependency tree for the part `example.mainBack` resolves to the following, with `from` dependencies in **bold** and `after` dependencies _italicized_.
|
||||||
|
|
||||||
|
|
||||||
| Part | Dependency Type | Hidden |
|
| Part | Dependency Type | Hidden |
|
||||||
| :---------- | :---------- | :-----|
|
| :---------------------------- | :-------------- | :----- |
|
||||||
| example.mainBack | root | false |
|
| example.mainBack | root | false |
|
||||||
| - **other.parent** | from | false |
|
| - **other.parent** | from | false |
|
||||||
| - - **other.grandParent** | inherited from | true |
|
| - - **other.grandParent** | inherited from | true |
|
||||||
| - - - *other.grandParentBase* | inherited after | true |
|
| - - - _other.grandParentBase_ | inherited after | true |
|
||||||
| - *example.mainFront* | after | false |
|
| - _example.mainFront_ | after | false |
|
||||||
| - - *example.mainFrontBase* | after | false |
|
| - - _example.mainFrontBase_ | after | false |
|
||||||
| - - **other.mainFront** | inherited from | true |
|
| - - **other.mainFront** | inherited from | true |
|
||||||
|
|
||||||
Dependencies are considered inherited if they have two or more dashes (-) next to them, and are either **bold** themselves, or underneath a **bold** part.
|
Dependencies are considered inherited if they have two or more dashes (-) next to them, and are either **bold** themselves, or underneath a **bold** part.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### hide.never
|
### hide.never
|
||||||
|
|
||||||
To __not__ hide a specific part that would otherwise be hidden by other configuration, add its name to the `hide.never` array
|
To **not** hide a specific part that would otherwise be hidden by other configuration, add its name to the `hide.never` array
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { exampleBase } from './base.mjs'
|
import { exampleBase } from './base.mjs'
|
||||||
|
@ -144,9 +157,9 @@ const part = {
|
||||||
// hide exampleBase and exampleBack
|
// hide exampleBase and exampleBack
|
||||||
after: true,
|
after: true,
|
||||||
// override hiding exampleBack so that it is shown
|
// override hiding exampleBack so that it is shown
|
||||||
never: ['example.back']
|
never: ['example.back'],
|
||||||
},
|
},
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -159,17 +172,30 @@ const part = {
|
||||||
name: 'example.front',
|
name: 'example.front',
|
||||||
// hide `example.front`
|
// hide `example.front`
|
||||||
hide: { self: true },
|
hide: { self: true },
|
||||||
draft: (({ part }) => part)
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Presets
|
## Presets
|
||||||
We provide two presets for common hiding configurations. For convenience, you can pass a preset to the `hide` configuration as a string like `hide: <preset name>`, or you can use `import { hidePresets } from '@freesewing.core` and pass `hide: hidePresets.<preset name>`
|
|
||||||
|
|
||||||
:::tip If you don't like to remember strings and you're working in development a environment that has code completion, importing the presets from `@freesewing/core` will help you be sure you're definitely using an available preset :::
|
We provide two presets for common hiding configurations. For convenience, you
|
||||||
|
can pass a preset to the `hide` configuration as a string like `hide: <preset
|
||||||
|
name>`, or you can use `import { hidePresets } from '@freesewing.core` and pass
|
||||||
|
`hide: hidePresets.<preset name>`
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
If you don't like to remember strings and you're working in development a
|
||||||
|
environment that has code completion, importing the presets from
|
||||||
|
`@freesewing/core` will help you be sure you're definitely using an available
|
||||||
|
preset
|
||||||
|
:::
|
||||||
|
|
||||||
### HIDE_ALL
|
### HIDE_ALL
|
||||||
For a shortcut to setting all `boolean` hiding options ([`after`](#hideafter), [`from`](#hidefrom), [`inherited`](#hideinherited), and [`self`](#hideself)) to true, use `HIDE_ALL`
|
|
||||||
|
For a shortcut to setting all `boolean` hiding options ([`after`](#hideafter),
|
||||||
|
[`from`](#hidefrom), [`inherited`](#hideinherited), and [`self`](#hideself)) to
|
||||||
|
true, use `HIDE_ALL`
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
This is equivalent to using
|
This is equivalent to using
|
||||||
|
|
||||||
|
@ -181,9 +207,11 @@ This is equivalent to using
|
||||||
inherited: true
|
inherited: true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
To use it as an imported preset:
|
To use it as an imported preset:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { hidePresets } from '@freesewing/core'
|
import { hidePresets } from '@freesewing/core'
|
||||||
import { exampleBase } from './base.mjs'
|
import { exampleBase } from './base.mjs'
|
||||||
|
@ -200,8 +228,8 @@ const part = {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
To use it as a string
|
To use it as a string
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { exampleBase } from './base.mjs'
|
import { exampleBase } from './base.mjs'
|
||||||
import { exampleBack } from './back.mjs'
|
import { exampleBack } from './back.mjs'
|
||||||
|
@ -213,11 +241,12 @@ const part = {
|
||||||
// hide `example.front`, `exmpleBase`, and `exampleBack`
|
// hide `example.front`, `exmpleBase`, and `exampleBack`
|
||||||
// as well as any inherited parts
|
// as well as any inherited parts
|
||||||
hide: 'HIDE_ALL',
|
hide: 'HIDE_ALL',
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### HIDE_TREE
|
### HIDE_TREE
|
||||||
|
|
||||||
For a shortcut to setting [`from: true`](#hidefrom) and [`inherited: true`](#hideinherited), use `HIDE_TREE`
|
For a shortcut to setting [`from: true`](#hidefrom) and [`inherited: true`](#hideinherited), use `HIDE_TREE`
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
@ -228,13 +257,16 @@ This is equivalent to using
|
||||||
from: true,
|
from: true,
|
||||||
inherited: true
|
inherited: true
|
||||||
}
|
}
|
||||||
````
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::note RELATED
|
:::note RELATED
|
||||||
See [`hide.inherited`](#hideinherited) for a full explanation of how that option works
|
See [`hide.inherited`](#hideinherited) for a full explanation of how that option works
|
||||||
:::
|
:::
|
||||||
|
|
||||||
To use it as an imported preset:
|
To use it as an imported preset:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { hidePresets } from '@freesewing/core'
|
import { hidePresets } from '@freesewing/core'
|
||||||
import { exampleBase } from './base.mjs'
|
import { exampleBase } from './base.mjs'
|
||||||
|
@ -245,12 +277,12 @@ const part = {
|
||||||
from: exampleBase,
|
from: exampleBase,
|
||||||
// hide `exmpleBase`, and all inherited parts
|
// hide `exmpleBase`, and all inherited parts
|
||||||
hide: hidePresets.HIDE_TREE,
|
hide: hidePresets.HIDE_TREE,
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
To use it as a string
|
To use it as a string
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { exampleBase } from './base.mjs'
|
import { exampleBase } from './base.mjs'
|
||||||
import { exampleBack } from './back.mjs'
|
import { exampleBack } from './back.mjs'
|
||||||
|
@ -260,6 +292,6 @@ const part = {
|
||||||
from: exampleBase,
|
from: exampleBase,
|
||||||
// hide `exmpleBase`, and all inherited parts
|
// hide `exmpleBase`, and all inherited parts
|
||||||
hide: 'HIDE_TREE',
|
hide: 'HIDE_TREE',
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -6,7 +6,9 @@ The `measurements` and `optionalMeasurements` properties on the
|
||||||
part configuration object list the part's required and optional
|
part configuration object list the part's required and optional
|
||||||
measurements respectively.
|
measurements respectively.
|
||||||
|
|
||||||
:::tipYou should only include what's required by the part itself, not its dependencies:::
|
:::tip
|
||||||
|
You should only include what's required by the part itself, not its dependencies
|
||||||
|
:::
|
||||||
|
|
||||||
## measurements
|
## measurements
|
||||||
|
|
||||||
|
@ -17,7 +19,7 @@ that are required to draft the current part.
|
||||||
const part = {
|
const part = {
|
||||||
name: 'example.front',
|
name: 'example.front',
|
||||||
measurements: ['head', 'chest'],
|
measurements: ['head', 'chest'],
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -34,6 +36,6 @@ const part = {
|
||||||
plugins: [pluginBust],
|
plugins: [pluginBust],
|
||||||
measurements: ['head', 'chest'],
|
measurements: ['head', 'chest'],
|
||||||
optionalMeasurements: ['highBust'],
|
optionalMeasurements: ['highBust'],
|
||||||
draft: ({ part }) => part
|
draft: ({ part }) => part,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: "Path._curve()"
|
title: 'Path._curve()'
|
||||||
---
|
---
|
||||||
|
|
||||||
The `Path._curve()` method draws a cubic Bézier curve
|
The `Path._curve()` method draws a cubic Bézier curve
|
||||||
|
@ -13,7 +13,9 @@ so you do not need to provide it.
|
||||||
Path path._curve(Point cp2, Point to)
|
Path path._curve(Point cp2, Point to)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -27,13 +29,14 @@ Path path._curve(Point cp2, Point to)
|
||||||
|
|
||||||
paths.line = new Path()
|
paths.line = new Path()
|
||||||
.move(points.from)
|
.move(points.from)
|
||||||
._curve(points.cp2, points.to)
|
.\_curve(points.cp2, points.to)
|
||||||
.setText("Path._curve()", "text-sm center fill-note")
|
.setText("Path.\_curve()", "text-sm center fill-note")
|
||||||
.attr("data-text-dy", -1)
|
.attr("data-text-dy", -1)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
````
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,4 +48,4 @@ as the two following calls yield the same result:
|
||||||
```js
|
```js
|
||||||
path.curve(point1, point1, point2)
|
path.curve(point1, point1, point2)
|
||||||
path._curve(point1, point2)
|
path._curve(point1, point2)
|
||||||
```
|
````
|
||||||
|
|
|
@ -10,7 +10,9 @@ The `Path.addClass()` method adds a CSS class to the path.
|
||||||
Path path.addClass(string className)
|
Path path.addClass(string className)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -28,7 +30,8 @@ Path path.addClass(string className)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
````
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
@ -39,4 +42,4 @@ as the two following calls yield the same result:
|
||||||
```js
|
```js
|
||||||
path.attr('class', 'fabric')
|
path.attr('class', 'fabric')
|
||||||
path.addClass('fabric')
|
path.addClass('fabric')
|
||||||
```
|
````
|
||||||
|
|
|
@ -12,7 +12,9 @@ Path path.addText(string text, string className = '')
|
||||||
|
|
||||||
The second argument will optionally be used to set the CSS class for the text.
|
The second argument will optionally be used to set the CSS class for the text.
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -29,7 +31,8 @@ The second argument will optionally be used to set the CSS class for the text.
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
````
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
@ -40,7 +43,7 @@ as the two following calls yield the same result:
|
||||||
```js
|
```js
|
||||||
path.attr('data-text', 'Hello')
|
path.attr('data-text', 'Hello')
|
||||||
path.addText('Hello')
|
path.addText('Hello')
|
||||||
```
|
````
|
||||||
|
|
||||||
The difference with [Path.setText()](/reference/api/path/addtext) is that this
|
The difference with [Path.setText()](/reference/api/path/addtext) is that this
|
||||||
method will add to the existing text whereas `Path.setText()` will overwrite
|
method will add to the existing text whereas `Path.setText()` will overwrite
|
||||||
|
|
|
@ -18,7 +18,9 @@ Path path.attr(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -39,6 +41,7 @@ Path path.attr(
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
|
@ -54,3 +57,4 @@ all call this method under the hood.
|
||||||
|
|
||||||
See [Using Attributes](/howtos/code/attributes)
|
See [Using Attributes](/howtos/code/attributes)
|
||||||
for information about custom Attributes that can be used with Paths.
|
for information about custom Attributes that can be used with Paths.
|
||||||
|
```
|
||||||
|
|
|
@ -12,9 +12,11 @@ A negative angle results in a clockwise arc.
|
||||||
:::tip
|
:::tip
|
||||||
The new endpoint of this path is the same point
|
The new endpoint of this path is the same point
|
||||||
that
|
that
|
||||||
|
|
||||||
```js
|
```js
|
||||||
path.end().rotate(deg, origin)
|
path.end().rotate(deg, origin)
|
||||||
```
|
```
|
||||||
|
|
||||||
would return.
|
would return.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
@ -24,7 +26,9 @@ would return.
|
||||||
Path path.circleSegment(deg, origin)
|
Path path.circleSegment(deg, origin)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -48,5 +52,7 @@ paths.helper = new Path()
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -10,7 +10,9 @@ The `Path.close()` method closes a path by drawing a straight line from the curr
|
||||||
Path path.close()
|
Path path.close()
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -24,12 +26,14 @@ Path path.close()
|
||||||
|
|
||||||
paths.line = new Path()
|
paths.line = new Path()
|
||||||
.move(points.from)
|
.move(points.from)
|
||||||
._curve(points.cp2, points.to)
|
.\_curve(points.cp2, points.to)
|
||||||
.close()
|
.close()
|
||||||
.reverse() // To keep text from being upside-down
|
.reverse() // To keep text from being upside-down
|
||||||
.setText('Path._close()', 'text-sm right fill-note')
|
.setText('Path.\_close()', 'text-sm right fill-note')
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -11,7 +11,9 @@ via two control points to a given endpoint.
|
||||||
Path path.curve(Point cp1, Point cp2, Point to)
|
Path path.curve(Point cp1, Point cp2, Point to)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -31,5 +33,7 @@ Path path.curve(Point cp1, Point cp2, Point to)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -12,16 +12,16 @@ identical to the end point.
|
||||||
Path path.curve_(Point cp1, Point to)
|
Path path.curve_(Point cp1, Point to)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
<Example caption="Example of the Path.curve\_() method">
|
<Example caption="Example of the Path.curve\_() method">
|
||||||
|
|
||||||
```js
|
```js
|
||||||
({ Point, points, Path, paths, part }) => {
|
;({ Point, points, Path, paths, part }) => {
|
||||||
|
|
||||||
points.from = new Point(10, 20)
|
points.from = new Point(10, 20)
|
||||||
points.cp1 = new Point(40, 0)
|
points.cp1 = new Point(40, 0)
|
||||||
points.to = new Point(90, 20)
|
points.to = new Point(90, 20)
|
||||||
|
@ -29,12 +29,13 @@ Path path.curve_(Point cp1, Point to)
|
||||||
paths.line = new Path()
|
paths.line = new Path()
|
||||||
.move(points.from)
|
.move(points.from)
|
||||||
.curve_(points.cp1, points.to)
|
.curve_(points.cp1, points.to)
|
||||||
.setText("Path.curve_()", "text-sm center fill-note")
|
.setText('Path.curve_()', 'text-sm center fill-note')
|
||||||
.attr("data-text-dy", -1)
|
.attr('data-text-dy', -1)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
|
@ -10,7 +10,9 @@ The `Path.end()` method returns the Point object at the end of the path.
|
||||||
Point path.end()
|
Point path.end()
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -33,5 +35,7 @@ Point path.end()
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -10,7 +10,9 @@ The `Path.hide()` hides the path so it does not appear in the output.
|
||||||
Path path.hide()
|
Path path.hide()
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -28,5 +30,7 @@ Path path.hide()
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -11,8 +11,9 @@ operation](/reference/api/path/noop) with id `id`.
|
||||||
Path path.insop(string id, Path path)
|
Path path.insop(string id, Path path)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
<Example caption="Example of the Path.insop() method">
|
<Example caption="Example of the Path.insop() method">
|
||||||
```js
|
```js
|
||||||
|
@ -42,9 +43,11 @@ Path path.insop(string id, Path path)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
This is often used to insert darts into a path.
|
This is often used to insert darts into a path.
|
||||||
|
```
|
||||||
|
|
|
@ -11,7 +11,9 @@ given point.
|
||||||
Path path.line(Point to)
|
Path path.line(Point to)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -29,5 +31,7 @@ Path path.line(Point to)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -12,7 +12,9 @@ with [`Path.insop()`](/reference/api/path/insop).
|
||||||
Path path.noop(string id)
|
Path path.noop(string id)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -44,5 +46,7 @@ Path path.noop(string id)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -10,7 +10,9 @@ The `Path.setClass()` method sets the CSS class(es) of the path.
|
||||||
Path path.setClass(string className)
|
Path path.setClass(string className)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -28,7 +30,8 @@ Path path.setClass(string className)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
````
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
@ -39,4 +42,4 @@ as the two following calls yield the same result:
|
||||||
```js
|
```js
|
||||||
path.attr('class', 'fabric', true)
|
path.attr('class', 'fabric', true)
|
||||||
path.setClass('fabric')
|
path.setClass('fabric')
|
||||||
```
|
````
|
||||||
|
|
|
@ -11,7 +11,9 @@ value you pass it.
|
||||||
Path path.setHidden(bool hidden = false)
|
Path path.setHidden(bool hidden = false)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -29,5 +31,7 @@ Path path.setHidden(bool hidden = false)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -12,7 +12,9 @@ Path path.setText(string text, string className = '')
|
||||||
|
|
||||||
The second argument will optionally be used to set the CSS class for the text.
|
The second argument will optionally be used to set the CSS class for the text.
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -29,7 +31,8 @@ The second argument will optionally be used to set the CSS class for the text.
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
````
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
@ -40,7 +43,7 @@ as the two following calls yield the same result:
|
||||||
```js
|
```js
|
||||||
path.attr('data-text', 'Hello')
|
path.attr('data-text', 'Hello')
|
||||||
path.setText('Hello')
|
path.setText('Hello')
|
||||||
```
|
````
|
||||||
|
|
||||||
The difference with [Path.addText()](/reference/api/path/addtext) is that this
|
The difference with [Path.addText()](/reference/api/path/addtext) is that this
|
||||||
method will overwrite existing text on the path, whereas `Path.addText()` will
|
method will overwrite existing text on the path, whereas `Path.addText()` will
|
||||||
|
|
|
@ -11,7 +11,9 @@ A smooth curve means it will use the reflection of the end control point of the
|
||||||
Path path.smurve(Point cp2, Point end)
|
Path path.smurve(Point cp2, Point end)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -36,5 +38,7 @@ Path path.smurve(Point cp2, Point end)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -13,7 +13,9 @@ A smooth curve means it will use the reflection of the end control point of the
|
||||||
Path path.smurve_(Point cp2, Point end)
|
Path path.smurve_(Point cp2, Point end)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -31,11 +33,13 @@ Path path.smurve_(Point cp2, Point end)
|
||||||
paths.smurve = new Path()
|
paths.smurve = new Path()
|
||||||
.move(points.aFrom)
|
.move(points.aFrom)
|
||||||
.curve(points.aCp1, points.aCp2,points.aTo)
|
.curve(points.aCp1, points.aCp2,points.aTo)
|
||||||
.smurve_(points.bTo)
|
.smurve\_(points.bTo)
|
||||||
.reverse() // Puts text at the end
|
.reverse() // Puts text at the end
|
||||||
.setText('Path.smurve()')
|
.setText('Path.smurve()')
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -10,7 +10,9 @@ The `Path.start()` method returns the Point object at the start of the path.
|
||||||
Point path.start()
|
Point path.start()
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -33,5 +35,7 @@ Point path.start()
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -12,7 +12,9 @@ hidden via `Path.hide()`.
|
||||||
Path path.unhide()
|
Path path.unhide()
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Path` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Path` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -30,5 +32,7 @@ Path path.unhide()
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -5,7 +5,9 @@ title: Pattern.addPart()
|
||||||
The `Pattern.addPart()` method allows you to add a part to a pattern.
|
The `Pattern.addPart()` method allows you to add a part to a pattern.
|
||||||
It has the same effect as passing a part to the Design constructor.
|
It has the same effect as passing a part to the Design constructor.
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
## Pattern.addPart() signature
|
## Pattern.addPart() signature
|
||||||
|
|
||||||
|
@ -16,13 +18,12 @@ Pattern pattern.addPart(object part)
|
||||||
## Pattern.addPart() example
|
## Pattern.addPart() example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Aaron } from "@freesewing/aaron"
|
import { Aaron } from '@freesewing/aaron'
|
||||||
|
|
||||||
const extra = {
|
const extra = {
|
||||||
name: 'aaron.extra',
|
name: 'aaron.extra',
|
||||||
draft: ({ points, Point, paths, Path, part }) => {
|
draft: ({ points, Point, paths, Path, part }) => {
|
||||||
points.msg = new Point(50,15)
|
points.msg = new Point(50, 15).attr('data-text', 'I am an extra part')
|
||||||
.attr('data-text', "I am an extra part")
|
|
||||||
paths.box = new Path()
|
paths.box = new Path()
|
||||||
.move(new Point(0, 0))
|
.move(new Point(0, 0))
|
||||||
.line(new Point(0, 30))
|
.line(new Point(0, 30))
|
||||||
|
@ -32,14 +33,12 @@ const extra = {
|
||||||
.addClass('note')
|
.addClass('note')
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load some public test measurements from the FreeSewing backend
|
// Load some public test measurements from the FreeSewing backend
|
||||||
const measurements = (
|
const measurements = (
|
||||||
await (
|
await (await fetch('https://backend3.freesewing.org/curated-sets/1.json')).json()
|
||||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
|
||||||
).json()
|
|
||||||
).measurements
|
).measurements
|
||||||
|
|
||||||
const pattern = new Aaron({ measurements }).addPart(extra)
|
const pattern = new Aaron({ measurements }).addPart(extra)
|
||||||
|
|
|
@ -7,7 +7,9 @@ making sure to do so in the right order, handle dependencies, resolve
|
||||||
options to their absolute values and a number of other housekeeping things
|
options to their absolute values and a number of other housekeeping things
|
||||||
that are required for the pattern to be drafted.
|
that are required for the pattern to be drafted.
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
## Pattern.draft() signature
|
## Pattern.draft() signature
|
||||||
|
|
||||||
|
@ -18,13 +20,11 @@ Pattern pattern.draft()
|
||||||
## Pattern.draft() example
|
## Pattern.draft() example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Aaron } from "@freesewing/aaron"
|
import { Aaron } from '@freesewing/aaron'
|
||||||
|
|
||||||
// Load some public test measurements from the FreeSewing backend
|
// Load some public test measurements from the FreeSewing backend
|
||||||
const measurements = (
|
const measurements = (
|
||||||
await (
|
await (await fetch('https://backend3.freesewing.org/curated-sets/1.json')).json()
|
||||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
|
||||||
).json()
|
|
||||||
).measurements
|
).measurements
|
||||||
|
|
||||||
const pattern = new Aaron({ measurements })
|
const pattern = new Aaron({ measurements })
|
||||||
|
|
|
@ -5,7 +5,9 @@ title: Pattern.draftPartForSet()
|
||||||
A pattern's `draftPartForSet()` method will draft a part using a
|
A pattern's `draftPartForSet()` method will draft a part using a
|
||||||
given set of settings.
|
given set of settings.
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
## Pattern.draftPartForSet() signature
|
## Pattern.draftPartForSet() signature
|
||||||
|
|
||||||
|
@ -16,14 +18,10 @@ Pattern pattern.draftPartForSet(part, set)
|
||||||
## Pattern.draftPartForSet() example
|
## Pattern.draftPartForSet() example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Aaron } from "@freesewing/aaron"
|
import { Aaron } from '@freesewing/aaron'
|
||||||
|
|
||||||
// Load a public test settings set from the FreeSewing backend
|
// Load a public test settings set from the FreeSewing backend
|
||||||
const set = (
|
const set = await (await fetch('https://backend3.freesewing.org/curated-sets/1.json')).json()
|
||||||
await (
|
|
||||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
|
||||||
).json()
|
|
||||||
)
|
|
||||||
|
|
||||||
const pattern = new Aaron()
|
const pattern = new Aaron()
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@ pattern's [lifecycle hooks](/reference/hooks/). It takes the
|
||||||
lifecycle hook's name as the first argument and the function as the second.
|
lifecycle hook's name as the first argument and the function as the second.
|
||||||
This method will then be triggered by the lifecycle hook.
|
This method will then be triggered by the lifecycle hook.
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
## Pattern.on() signature
|
## Pattern.on() signature
|
||||||
|
|
||||||
|
@ -27,7 +29,7 @@ should pass it.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
pattern.on('preRender', function (svg) {
|
pattern.on('preRender', function (svg) {
|
||||||
svg.style += "svg { background: yellow;}";
|
svg.style += 'svg { background: yellow;}'
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@ The `Pattern.sample()` method will _sample_ the pattern which means
|
||||||
to draft multiple variants of the same pattern, and stack them on
|
to draft multiple variants of the same pattern, and stack them on
|
||||||
top of each other.
|
top of each other.
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
Under the hood, this method will call one of
|
Under the hood, this method will call one of
|
||||||
[Pattern.sampleOption()](/reference/api/pattern/sampleoption),
|
[Pattern.sampleOption()](/reference/api/pattern/sampleoption),
|
||||||
|
@ -34,19 +36,17 @@ Pattern pattern.sample()
|
||||||
## Pattern.sample() example
|
## Pattern.sample() example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Aaron } from "@freesewing/aaron"
|
import { Aaron } from '@freesewing/aaron'
|
||||||
|
|
||||||
// Load some public test measurements from the FreeSewing backend
|
// Load some public test measurements from the FreeSewing backend
|
||||||
const measurements = (
|
const measurements = (
|
||||||
await (
|
await (await fetch('https://backend3.freesewing.org/curated-sets/1.json')).json()
|
||||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
|
||||||
).json()
|
|
||||||
).measurements
|
).measurements
|
||||||
|
|
||||||
const pattern = new Aaron({
|
const pattern = new Aaron({
|
||||||
sample: {
|
sample: {
|
||||||
models: measurements
|
models: measurements,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const svg = pattern.sample().render()
|
const svg = pattern.sample().render()
|
||||||
|
|
|
@ -13,7 +13,9 @@ the measurement of your choice between 90% and 110% if the value in the settings
|
||||||
The goal of measurement sampling is to understand the impact of a given measurement on a pattern.
|
The goal of measurement sampling is to understand the impact of a given measurement on a pattern.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
## Pattern.sampleMeasurement() signature
|
## Pattern.sampleMeasurement() signature
|
||||||
|
|
||||||
|
@ -24,13 +26,11 @@ Pattern pattern.sampleMeasurement(string measurement)
|
||||||
## Pattern.sampleMeasurement() example
|
## Pattern.sampleMeasurement() example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Aaron } from "@freesewing/aaron"
|
import { Aaron } from '@freesewing/aaron'
|
||||||
|
|
||||||
// Load some public test measurements from the FreeSewing backend
|
// Load some public test measurements from the FreeSewing backend
|
||||||
const measurements = (
|
const measurements = (
|
||||||
await (
|
await (await fetch('https://backend3.freesewing.org/curated-sets/1.json')).json()
|
||||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
|
||||||
).json()
|
|
||||||
).measurements
|
).measurements
|
||||||
|
|
||||||
const pattern = new Aaron({ measurements })
|
const pattern = new Aaron({ measurements })
|
||||||
|
|
|
@ -12,7 +12,9 @@ In this particular case, it will draft a variants for each of the models you pas
|
||||||
The goal of model sampling is to verify that a pattern grades correctly up and down as sizes change.
|
The goal of model sampling is to verify that a pattern grades correctly up and down as sizes change.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
## Pattern.sampleModels() signature
|
## Pattern.sampleModels() signature
|
||||||
|
|
||||||
|
@ -52,16 +54,14 @@ identifying your model in the models object.
|
||||||
## Pattern.sampleModels() example
|
## Pattern.sampleModels() example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Aaron } from "@freesewing/aaron"
|
import { Aaron } from '@freesewing/aaron'
|
||||||
|
|
||||||
const Aaron = new Aaron()
|
const Aaron = new Aaron()
|
||||||
|
|
||||||
// Load some public test measurements from the FreeSewing backend
|
// Load some public test measurements from the FreeSewing backend
|
||||||
const measurements = (
|
const measurements = (
|
||||||
await (
|
await (await fetch('https://backend3.freesewing.org/curated-sets/1.json')).json()
|
||||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
|
||||||
).json()
|
|
||||||
).measurements
|
).measurements
|
||||||
|
|
||||||
const svg = aaron.sampleModels(measurements, "34").render()
|
const svg = aaron.sampleModels(measurements, '34').render()
|
||||||
```
|
```
|
||||||
|
|
|
@ -20,7 +20,9 @@ The goal of option sampling is to verify the impact of an option on the pattern,
|
||||||
its min and max boundaries are correct and its default value is sensible.
|
its min and max boundaries are correct and its default value is sensible.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
## Pattern.sampleOption() signature
|
## Pattern.sampleOption() signature
|
||||||
|
|
||||||
|
@ -31,13 +33,11 @@ Pattern pattern.sampleOption(string option)
|
||||||
## Pattern.sampleOption() example
|
## Pattern.sampleOption() example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Aaron } from "@freesewing/aaron"
|
import { Aaron } from '@freesewing/aaron'
|
||||||
|
|
||||||
// Load some public test measurements from the FreeSewing backend
|
// Load some public test measurements from the FreeSewing backend
|
||||||
const measurements = (
|
const measurements = (
|
||||||
await (
|
await (await fetch('https://backend3.freesewing.org/curated-sets/1.json')).json()
|
||||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
|
||||||
).json()
|
|
||||||
).measurements
|
).measurements
|
||||||
|
|
||||||
const pattern = new Aaron({ measurements })
|
const pattern = new Aaron({ measurements })
|
||||||
|
|
|
@ -6,7 +6,9 @@ The `Pattern.use()` method will load a FreeSewing plugin.
|
||||||
Plugins are a way to extend a pattern's functionality.
|
Plugins are a way to extend a pattern's functionality.
|
||||||
For more details, refer to [the plugin guide](/guides/plugins/).
|
For more details, refer to [the plugin guide](/guides/plugins/).
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Pattern object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Pattern object
|
||||||
|
:::
|
||||||
|
|
||||||
## Pattern.use() signature
|
## Pattern.use() signature
|
||||||
|
|
||||||
|
@ -22,14 +24,12 @@ you plugin object.
|
||||||
## Pattern.use() example
|
## Pattern.use() example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Aaron } from "@freesewing/aaron"
|
import { Aaron } from '@freesewing/aaron'
|
||||||
import { pluginTheme } from "@freesewing/plugin-theme"
|
import { pluginTheme } from '@freesewing/plugin-theme'
|
||||||
|
|
||||||
// Load some public test measurements from the FreeSewing backend
|
// Load some public test measurements from the FreeSewing backend
|
||||||
const measurements = (
|
const measurements = (
|
||||||
await (
|
await (await fetch('https://backend3.freesewing.org/curated-sets/1.json')).json()
|
||||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
|
||||||
).json()
|
|
||||||
).measurements
|
).measurements
|
||||||
|
|
||||||
const pattern = new Aaron({ measurements }).use(pluginTheme)
|
const pattern = new Aaron({ measurements }).use(pluginTheme)
|
||||||
|
|
|
@ -15,7 +15,9 @@ Point point.addCircle(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Point` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Point` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -39,5 +41,7 @@ Point point.addCircle(
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -15,7 +15,9 @@ Point point.addText(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Point` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Point` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -32,12 +34,13 @@ Point point.addText(
|
||||||
.line(points.anchor.shift(0, 80))
|
.line(points.anchor.shift(0, 80))
|
||||||
.addClass('hidden')
|
.addClass('hidden')
|
||||||
|
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
Remember to [use translation keys, not text](/guides/best-practices#use-translation-keys)
|
Remember to [use translation keys, not text](/guides/best-practices#use-translation-keys)
|
||||||
|
```
|
||||||
|
|
|
@ -18,8 +18,9 @@ Point point.attr(
|
||||||
|
|
||||||
If the third parameter is set to `true` it will call [`this.attributes.set()`](/reference/api/attributes/set/) instead, thereby overwriting the value of the attribute.
|
If the third parameter is set to `true` it will call [`this.attributes.set()`](/reference/api/attributes/set/) instead, thereby overwriting the value of the attribute.
|
||||||
|
|
||||||
|
:::tip
|
||||||
:::tipThis method is chainable as it returns the `Point` object:::
|
This method is chainable as it returns the `Point` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -39,6 +40,7 @@ If the third parameter is set to `true` it will call [`this.attributes.set()`](/
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
|
@ -46,3 +48,4 @@ If the third parameter is set to `true` it will call [`this.attributes.set()`](/
|
||||||
|
|
||||||
See [Using Attributes](/howtos/code/attributes)
|
See [Using Attributes](/howtos/code/attributes)
|
||||||
for information about custom Attributes that can be used with Points.
|
for information about custom Attributes that can be used with Points.
|
||||||
|
```
|
||||||
|
|
|
@ -11,7 +11,9 @@ attributes as the original point.
|
||||||
Point point.clone()
|
Point point.clone()
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Point` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Point` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -34,6 +36,7 @@ Point point.clone()
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
|
@ -43,3 +46,4 @@ Point point.clone()
|
||||||
The [`Point.copy()`](/reference/api/point/copy/) method will only copy the
|
The [`Point.copy()`](/reference/api/point/copy/) method will only copy the
|
||||||
point's coordinates, whereas this `Point.clone()` method will also copy its
|
point's coordinates, whereas this `Point.clone()` method will also copy its
|
||||||
attributes.
|
attributes.
|
||||||
|
```
|
||||||
|
|
|
@ -21,7 +21,9 @@ Point point.setCircle(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Point` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Point` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -46,5 +48,7 @@ Point point.setCircle(
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
```
|
||||||
|
|
|
@ -15,7 +15,9 @@ Point point.setText(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Point` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Point` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -35,9 +37,11 @@ Point point.setText(
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
Remember to [use translation keys, not text](/guides/best-practices#use-translation-keys)
|
Remember to [use translation keys, not text](/guides/best-practices#use-translation-keys)
|
||||||
|
```
|
||||||
|
|
|
@ -19,7 +19,9 @@ Snippet snippet.attr(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Snippet` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Snippet` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -38,6 +40,7 @@ Snippet snippet.attr(
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
|
@ -45,3 +48,4 @@ Snippet snippet.attr(
|
||||||
See [Using Attributes](/howtos/code/attributes)
|
See [Using Attributes](/howtos/code/attributes)
|
||||||
for information about what Attributes can be used with Snippets.
|
for information about what Attributes can be used with Snippets.
|
||||||
:::
|
:::
|
||||||
|
```
|
||||||
|
|
|
@ -11,7 +11,9 @@ sets the `data-rotate` property.
|
||||||
Snippet snippet.rotate(rotation, overwrite=true)
|
Snippet snippet.rotate(rotation, overwrite=true)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Snippet` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Snippet` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -33,6 +35,8 @@ Snippet snippet.rotate(rotation, overwrite=true)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
|
@ -11,7 +11,9 @@ sets the `data-scale` property.
|
||||||
Snippet snippet.scale(scale, overwrite=true)
|
Snippet snippet.scale(scale, overwrite=true)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Snippet` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Snippet` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -22,7 +24,7 @@ Snippet snippet.scale(scale, overwrite=true)
|
||||||
for (const i of [1,2,3,4,5,6]) {
|
for (const i of [1,2,3,4,5,6]) {
|
||||||
snippets[`demo${i}`] = new Snippet(
|
snippets[`demo${i}`] = new Snippet(
|
||||||
"logo",
|
"logo",
|
||||||
new Point(30*i, 0)
|
new Point(30\*i, 0)
|
||||||
).scale(i/10)
|
).scale(i/10)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +35,8 @@ Snippet snippet.scale(scale, overwrite=true)
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
|
@ -11,4 +11,6 @@ original stack.
|
||||||
Stack stack.addPart(Part part)
|
Stack stack.addPart(Part part)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Stack object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Stack object
|
||||||
|
:::
|
||||||
|
|
|
@ -20,4 +20,6 @@ If the third parameter is set to `true` it will call
|
||||||
`this.attributes.set()` instead,
|
`this.attributes.set()` instead,
|
||||||
thereby overwriting the value of the attribute.
|
thereby overwriting the value of the attribute.
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Stack object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Stack object
|
||||||
|
:::
|
||||||
|
|
|
@ -5,7 +5,6 @@ title: Stack.generateTransform()
|
||||||
The `Stack.generateTransform()` method generates SVG transforms for the stack,
|
The `Stack.generateTransform()` method generates SVG transforms for the stack,
|
||||||
sets them as attributes, and returns the original stack.
|
sets them as attributes, and returns the original stack.
|
||||||
|
|
||||||
|
|
||||||
## Stack.generateTransform() signature
|
## Stack.generateTransform() signature
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -17,10 +16,12 @@ an object with the following properties containing the transforms
|
||||||
to apply:
|
to apply:
|
||||||
|
|
||||||
| Property | Type | Description |
|
| Property | Type | Description |
|
||||||
|----------|------|------------|
|
| -------- | ------- | ----------------------------------------------------------------------------- |
|
||||||
| `move` | Object | `move.x` and `move.y` are coordinates to which the stack should be translated
|
| `move` | Object | `move.x` and `move.y` are coordinates to which the stack should be translated |
|
||||||
| `rotate` | Number | The number of degrees to rate the stack around its center |
|
| `rotate` | Number | The number of degrees to rate the stack around its center |
|
||||||
| `flipX` | Boolean | Whether to flip the stack along the X axis |
|
| `flipX` | Boolean | Whether to flip the stack along the X axis |
|
||||||
| `flipY` | Boolean | Whether to flip the stack along the Y axis |
|
| `flipY` | Boolean | Whether to flip the stack along the Y axis |
|
||||||
|
|
||||||
:::noteThis method is chainable as it returns the Stack object:::
|
:::note
|
||||||
|
This method is chainable as it returns the Stack object
|
||||||
|
:::
|
||||||
|
|
|
@ -11,7 +11,10 @@ and returns the original stack.
|
||||||
```js
|
```js
|
||||||
Stack stack.home()
|
Stack stack.home()
|
||||||
```
|
```
|
||||||
:::noteThis method is chainable as it returns the Stack object:::
|
|
||||||
|
:::note
|
||||||
|
This method is chainable as it returns the Stack object
|
||||||
|
:::
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,9 @@ rather through a plugin.
|
||||||
Store Store.extend(Array methods=[])
|
Store Store.extend(Array methods=[])
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Store` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Store` object
|
||||||
|
:::
|
||||||
|
|
||||||
The single argument should be an Array of methods to add to the
|
The single argument should be an Array of methods to add to the
|
||||||
store. Each entry in the array should be an array itself holding a path in
|
store. Each entry in the array should be an array itself holding a path in
|
||||||
|
@ -26,9 +28,7 @@ function myCustomMethod(store, ...otherArguments) {
|
||||||
// Do something clever
|
// Do something clever
|
||||||
}
|
}
|
||||||
|
|
||||||
const store = new Store([
|
const store = new Store([['path.to.the.method', myCustomMethod]])
|
||||||
["path.to.the.method", myCustomMethod ]
|
|
||||||
])
|
|
||||||
```
|
```
|
||||||
|
|
||||||
With the configuration above, you can call `store.path.to.the.method()` and it
|
With the configuration above, you can call `store.path.to.the.method()` and it
|
||||||
|
@ -46,5 +46,3 @@ The Store will not allow you to extend any of the following keys:
|
||||||
- `unset`
|
- `unset`
|
||||||
- `get`
|
- `get`
|
||||||
- `extend`
|
- `extend`
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,18 +12,18 @@ If `key` does not hold and Array, the Store will log a warning, but nothing will
|
||||||
Store store.push(mixed value1, mixed value2, ...)
|
Store store.push(mixed value1, mixed value2, ...)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::noteThis method is [variadic](https://en.wikipedia.org/wiki/Variadic_function):::
|
:::note
|
||||||
|
This method is [variadic](https://en.wikipedia.org/wiki/Variadic_function)
|
||||||
|
:::
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Store` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Store` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const store = new Store()
|
const store = new Store()
|
||||||
store.set('example', ['Hi there'])
|
store.set('example', ['Hi there'])
|
||||||
store.push(
|
store.push('How are you doing', 'How are YOU doing')
|
||||||
'How are you doing',
|
|
||||||
'How are YOU doing'
|
|
||||||
)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ The `Store.set()` method stores the value of `value` in the store under key
|
||||||
Store store.set(mixed key, mixed value)
|
Store store.set(mixed key, mixed value)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Store` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Store` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -42,4 +44,3 @@ value = store.get(['my', 'other', 'nested', 'example']) // works
|
||||||
value = store.my.nested.example // Also works
|
value = store.my.nested.example // Also works
|
||||||
value = store.my.other.nested.example // Also works
|
value = store.my.other.nested.example // Also works
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ The `Store.set()` method stores the value of `value` in the store under key
|
||||||
Store store.set(mixed key, mixed value)
|
Store store.set(mixed key, mixed value)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Store` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Store` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -20,4 +22,3 @@ const store = new Store()
|
||||||
store.set('example', 'Hi there')
|
store.set('example', 'Hi there')
|
||||||
store.setIfUnset('example', 'Hi again') // This has no effect
|
store.setIfUnset('example', 'Hi again') // This has no effect
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,12 @@ The `Store.unset()` value removes a `key` from the store.
|
||||||
Store store.unset(string key)
|
Store store.unset(string key)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tipThis method is chainable as it returns the `Store` object:::
|
:::tip
|
||||||
|
This method is chainable as it returns the `Store` object
|
||||||
|
:::
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const store = new Store()
|
const store = new Store().set('example', 'I will be gone before you know it').unset('example')
|
||||||
.set('example', 'I will be gone before you know it')
|
|
||||||
.unset('example')
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -36,6 +36,7 @@ git clone https://github.com/your-username/freesewing
|
||||||
cd freesewing
|
cd freesewing
|
||||||
yarn kickstart
|
yarn kickstart
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
This sets up the monorepo. If you would like to create a new design, run the
|
This sets up the monorepo. If you would like to create a new design, run the
|
||||||
|
@ -141,7 +142,9 @@ environment inside.
|
||||||
Now you're ready to [start the development
|
Now you're ready to [start the development
|
||||||
environment](/tutorials/getting-started-linux/dev-start).
|
environment](/tutorials/getting-started-linux/dev-start).
|
||||||
|
|
||||||
:::tipThe folder will have the name you chose above.:::
|
:::tip
|
||||||
|
The folder will have the name you chose above.
|
||||||
|
:::
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,6 @@ We'll cover the following steps:
|
||||||
|
|
||||||
<ReadMore />
|
<ReadMore />
|
||||||
|
|
||||||
:::tipThese instructions are also valid for BSD or other Unix systems:::
|
:::tip
|
||||||
|
These instructions are also valid for BSD or other Unix systems
|
||||||
|
:::
|
||||||
|
|
|
@ -36,6 +36,7 @@ git clone https://github.com/your-username/freesewing
|
||||||
cd freesewing
|
cd freesewing
|
||||||
yarn kickstart
|
yarn kickstart
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
This sets up the monorepo. If you would like to create a new design, run the
|
This sets up the monorepo. If you would like to create a new design, run the
|
||||||
|
@ -126,7 +127,9 @@ environment inside.
|
||||||
Now you're ready to [start the development
|
Now you're ready to [start the development
|
||||||
environment](/tutorials/getting-started-linux/dev-start).
|
environment](/tutorials/getting-started-linux/dev-start).
|
||||||
|
|
||||||
:::tipThe folder will have the name you chose above.:::
|
:::tip
|
||||||
|
The folder will have the name you chose above.
|
||||||
|
:::
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,13 @@ FreeSewing project.
|
||||||
|
|
||||||
### Install WSL
|
### Install WSL
|
||||||
|
|
||||||
:::warning This guide uses WSL version 2, which requires installing the Hyper-V
|
:::warning
|
||||||
|
This guide uses WSL version 2, which requires installing the Hyper-V
|
||||||
virtualisation system. If you have another virtualisation system installed (such
|
virtualisation system. If you have another virtualisation system installed (such
|
||||||
as VirtualBox or VMWare) you may run into conflicts which require either
|
as VirtualBox or VMWare) you may run into conflicts which require either
|
||||||
updating that system to a version which can use the HyperV backend or porting
|
updating that system to a version which can use the HyperV backend or porting
|
||||||
your existing machines to use HyperV. :::
|
your existing machines to use HyperV.
|
||||||
|
:::
|
||||||
|
|
||||||
Follow the [Windows Subsystem for Linux Installation Guide for Windows
|
Follow the [Windows Subsystem for Linux Installation Guide for Windows
|
||||||
10](https://docs.microsoft.com/en-gb/windows/wsl/install-win10) (requires a
|
10](https://docs.microsoft.com/en-gb/windows/wsl/install-win10) (requires a
|
||||||
|
@ -63,10 +65,12 @@ then activate using `nvm use <version>`. You can determine what version the
|
||||||
FreeSewing project uses by checking
|
FreeSewing project uses by checking
|
||||||
[freesewing/freesewing/.nvmrc](https://github.com/freesewing/freesewing/blob/develop/.nvmrc).
|
[freesewing/freesewing/.nvmrc](https://github.com/freesewing/freesewing/blob/develop/.nvmrc).
|
||||||
|
|
||||||
:::warning At the time this guide was written the latest version of Node.js/npm has
|
:::warning
|
||||||
|
At the time this guide was written the latest version of Node.js/npm has
|
||||||
a bug in the dependency resolution process which causes the freesewing project
|
a bug in the dependency resolution process which causes the freesewing project
|
||||||
to fail to build. Use the latest LTS version (currently 18.17.0) or the specific
|
to fail to build. Use the latest LTS version (currently 18.17.0) or the specific
|
||||||
version used by the main project to avoid this issue. :::
|
version used by the main project to avoid this issue.
|
||||||
|
:::
|
||||||
|
|
||||||
Node.js comes with the Node Package Manager (npm) by default which can be used to
|
Node.js comes with the Node Package Manager (npm) by default which can be used to
|
||||||
set up the project. The default package manager uses a fairly simplistic approach
|
set up the project. The default package manager uses a fairly simplistic approach
|
||||||
|
@ -122,7 +126,6 @@ this guide you have already done steps 1 and 2, you will only need to install
|
||||||
the [remote development
|
the [remote development
|
||||||
extension](https://aka.ms/vscode-remote/download/extension))
|
extension](https://aka.ms/vscode-remote/download/extension))
|
||||||
|
|
||||||
|
|
||||||
## Setting up a development environment in Windows.
|
## Setting up a development environment in Windows.
|
||||||
|
|
||||||
### Install NVM
|
### Install NVM
|
||||||
|
@ -165,9 +168,12 @@ In VSCode or in a terminal, navigate to the folder you wish to contain your new
|
||||||
After you've answered [some questions](#questions), it will take a while to set everything up.
|
After you've answered [some questions](#questions), it will take a while to set everything up.
|
||||||
When it's done, you will have a new folder with the development environment inside.
|
When it's done, you will have a new folder with the development environment inside.
|
||||||
|
|
||||||
:::tipThe folder will have the name you chose above.:::
|
:::tip
|
||||||
|
The folder will have the name you chose above.
|
||||||
|
:::
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
### Questions
|
### Questions
|
||||||
|
|
||||||
#### What template to use
|
#### What template to use
|
||||||
|
|
|
@ -17,7 +17,9 @@ tedious. There are macros to add titles to our pattern, or grainline
|
||||||
indicators, a scalebox, and there's a macro to round corners. The `round`
|
indicators, a scalebox, and there's a macro to round corners. The `round`
|
||||||
macro.
|
macro.
|
||||||
|
|
||||||
:::note You can find more information on the `round` macro in [the macros docs](/reference/macros/round/).:::
|
:::note
|
||||||
|
You can find more information on the `round` macro in [the macros docs](/reference/macros/round/).
|
||||||
|
:::
|
||||||
|
|
||||||
We need a half circle here, but the `round` macro works on 90° angles, so
|
We need a half circle here, but the `round` macro works on 90° angles, so
|
||||||
we'll use it twice. As such, we'll add some points to guide the macro, and
|
we'll use it twice. As such, we'll add some points to guide the macro, and
|
||||||
|
@ -41,22 +43,24 @@ function draftBib({
|
||||||
part,
|
part,
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
/*
|
/\*
|
||||||
* Construct the quarter neck opening
|
|
||||||
*/
|
- Construct the quarter neck opening
|
||||||
|
_/
|
||||||
let tweak = 1
|
let tweak = 1
|
||||||
let target = (measurements.head * options.neckRatio) /4
|
let target = (measurements.head _ options.neckRatio) /4
|
||||||
let delta
|
let delta
|
||||||
do {
|
do {
|
||||||
points.right = new Point(
|
points.right = new Point(
|
||||||
tweak * measurements.head / 10,
|
tweak _ measurements.head / 10,
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
points.bottom = new Point(
|
points.bottom = new Point(
|
||||||
0,
|
0,
|
||||||
tweak * measurements.head / 12
|
tweak _ measurements.head / 12
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
points.rightCp1 = points.right.shift(
|
points.rightCp1 = points.right.shift(
|
||||||
90,
|
90,
|
||||||
points.bottom.dy(points.right) / 2
|
points.bottom.dy(points.right) / 2
|
||||||
|
@ -78,11 +82,13 @@ function draftBib({
|
||||||
delta = paths.quarterNeck.length() - target
|
delta = paths.quarterNeck.length() - target
|
||||||
if (delta > 0) tweak = tweak * 0.99
|
if (delta > 0) tweak = tweak * 0.99
|
||||||
else tweak = tweak * 1.02
|
else tweak = tweak * 1.02
|
||||||
|
|
||||||
} while (Math.abs(delta) > 1)
|
} while (Math.abs(delta) > 1)
|
||||||
|
|
||||||
/*
|
/\*
|
||||||
* Construct the complete neck opening
|
|
||||||
*/
|
- Construct the complete neck opening
|
||||||
|
\*/
|
||||||
points.rightCp2 = points.rightCp1.flipY()
|
points.rightCp2 = points.rightCp1.flipY()
|
||||||
points.bottomCp1 = points.bottomCp2.flipX()
|
points.bottomCp1 = points.bottomCp2.flipX()
|
||||||
points.left = points.right.flipX()
|
points.left = points.right.flipX()
|
||||||
|
@ -101,11 +107,12 @@ function draftBib({
|
||||||
.close()
|
.close()
|
||||||
.addClass('fabric')
|
.addClass('fabric')
|
||||||
|
|
||||||
/*
|
/\*
|
||||||
* Drawing the bib outline
|
|
||||||
*/
|
- Drawing the bib outline
|
||||||
const width = measurements.head * options.widthRatio
|
_/
|
||||||
const length = measurements.head * options.lengthRatio
|
const width = measurements.head _ options.widthRatio
|
||||||
|
const length = measurements.head \* options.lengthRatio
|
||||||
|
|
||||||
points.topLeft = new Point(
|
points.topLeft = new Point(
|
||||||
width / -2,
|
width / -2,
|
||||||
|
@ -115,9 +122,10 @@ function draftBib({
|
||||||
points.bottomLeft = points.topLeft.shift(-90, length)
|
points.bottomLeft = points.topLeft.shift(-90, length)
|
||||||
points.bottomRight = points.topRight.shift(-90, length)
|
points.bottomRight = points.topRight.shift(-90, length)
|
||||||
|
|
||||||
/*
|
/\*
|
||||||
* Shape the straps
|
|
||||||
*/
|
- Shape the straps
|
||||||
|
\*/
|
||||||
points.edgeLeft = new Point(points.topLeft.x, points.left.y)
|
points.edgeLeft = new Point(points.topLeft.x, points.left.y)
|
||||||
points.edgeRight = new Point(points.topRight.x, points.right.y)
|
points.edgeRight = new Point(points.topRight.x, points.right.y)
|
||||||
points.edgeTop = new Point(0, points.topLeft.y)
|
points.edgeTop = new Point(0, points.topLeft.y)
|
||||||
|
@ -155,8 +163,9 @@ function draftBib({
|
||||||
// highlight-end
|
// highlight-end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now, adapt our `rect` path so it's no longer a rectangle:
|
|
||||||
*/
|
- Now, adapt our `rect` path so it's no longer a rectangle:
|
||||||
|
\*/
|
||||||
paths.rect = new Path()
|
paths.rect = new Path()
|
||||||
.move(points.edgeTop)
|
.move(points.edgeTop)
|
||||||
.curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft)
|
.curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft)
|
||||||
|
@ -168,7 +177,9 @@ function draftBib({
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
Notice that we always draw our path at the end after we've manipulated our points.
|
Notice that we always draw our path at the end after we've manipulated our points.
|
||||||
|
```
|
||||||
|
|
|
@ -19,12 +19,12 @@ does.
|
||||||
## Destructuring the function parameter
|
## Destructuring the function parameter
|
||||||
|
|
||||||
If you're not familiar with the `({ part })` syntax you see above, this is a
|
If you're not familiar with the `({ part })` syntax you see above, this is a
|
||||||
technique called *parameter destructuring* or more generally, [object
|
technique called _parameter destructuring_ or more generally, [object
|
||||||
destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment).
|
destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment).
|
||||||
|
|
||||||
The draft method receives only 1 parameter: An object that holds everything we
|
The draft method receives only 1 parameter: An object that holds everything we
|
||||||
need to draft our method. Destructuring is a way to *pull things out of the
|
need to draft our method. Destructuring is a way to _pull things out of the
|
||||||
object into their own variable*. It saves us a bunch of typing as these two are
|
object into their own variable_. It saves us a bunch of typing as these two are
|
||||||
equivalent:
|
equivalent:
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
|
@ -53,7 +53,7 @@ function draftBib({ part }) {
|
||||||
|
|
||||||
As we'll make our way through this tutorial, we'll need more and more stuff, so
|
As we'll make our way through this tutorial, we'll need more and more stuff, so
|
||||||
we'll be pulling it out of the object passed to the draft method via
|
we'll be pulling it out of the object passed to the draft method via
|
||||||
*destructuring*.
|
_destructuring_.
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
@ -92,7 +92,9 @@ Here's a brief summary of the things we've added above:
|
||||||
- `points`: A container object to hold the part's points
|
- `points`: A container object to hold the part's points
|
||||||
- `paths`: A container object to hold the part's paths
|
- `paths`: A container object to hold the part's paths
|
||||||
|
|
||||||
:::tipRemember: Constructors start with a **C**apital letter:::
|
:::tip
|
||||||
|
Remember: Constructors start with a **C**apital letter
|
||||||
|
:::
|
||||||
|
|
||||||
Long story short: These will make it possible for us to draw points and paths easily.
|
Long story short: These will make it possible for us to draw points and paths easily.
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,6 @@ title: Supporting translation
|
||||||
order: 80
|
order: 80
|
||||||
---
|
---
|
||||||
|
|
||||||
:::note [FIXME]Write this section for v3:::
|
:::note [FIXME]
|
||||||
|
Write this section for v3
|
||||||
|
:::
|
||||||
|
|
|
@ -42,6 +42,7 @@ If you set a `menu` property on your option, the FreeSewing frontend will use
|
||||||
this to organize your various options in a menu structure.
|
this to organize your various options in a menu structure.
|
||||||
|
|
||||||
### Sub menus
|
### Sub menus
|
||||||
|
|
||||||
You can a nested menu structure with dot-notation. So `style.pockets` will
|
You can a nested menu structure with dot-notation. So `style.pockets` will
|
||||||
create a `pockets` submenu under the `style` menu and put your option there.
|
create a `pockets` submenu under the `style` menu and put your option there.
|
||||||
|
|
||||||
|
@ -65,4 +66,6 @@ function(
|
||||||
|
|
||||||
This is typically used to hide options conditionally.
|
This is typically used to hide options conditionally.
|
||||||
|
|
||||||
:::note [FIXME]Include example:::
|
:::note [FIXME]
|
||||||
|
Include example
|
||||||
|
:::
|
||||||
|
|
|
@ -3,13 +3,13 @@ title: Testing your designs
|
||||||
order: 70
|
order: 70
|
||||||
---
|
---
|
||||||
|
|
||||||
:::note [FIXME] Update this for v3 :::
|
|
||||||
|
|
||||||
With the basic outline of our pattern ready, now would be a good time
|
With the basic outline of our pattern ready, now would be a good time
|
||||||
to test it to see how well it adapts to different measurements,
|
to test it to see how well it adapts to different measurements,
|
||||||
and the range of options we provided.
|
and the range of options we provided.
|
||||||
|
|
||||||
:::note [FIXME]
|
:::note [FIXME]
|
||||||
|
Update this for v3
|
||||||
|
|
||||||
This page needs to be updated with screenshots from the v3 development
|
This page needs to be updated with screenshots from the v3 development
|
||||||
environment
|
environment
|
||||||
:::
|
:::
|
||||||
|
@ -54,7 +54,9 @@ that it only influences the length:
|
||||||

|
option](test-option-lengthratio.png)
|
||||||
|
|
||||||
:::note [FIXME]Update screenshot for v3:::
|
:::note [FIXME]
|
||||||
|
Update screenshot for v3
|
||||||
|
:::
|
||||||
|
|
||||||
### neckRatio
|
### neckRatio
|
||||||
|
|
||||||
|
@ -68,7 +70,9 @@ smaller, we will rotate the straps further out of the way to avoid overlap:
|
||||||

|
option](test-option-neckratio.png)
|
||||||
|
|
||||||
:::note [FIXME]Update screenshot for v3:::
|
:::note [FIXME]
|
||||||
|
Update screenshot for v3
|
||||||
|
:::
|
||||||
|
|
||||||
### widthRatio
|
### widthRatio
|
||||||
|
|
||||||
|
@ -84,7 +88,9 @@ bib shorter when it's worn.
|
||||||

|
option](test-option-widthratio.png)
|
||||||
|
|
||||||
:::note [FIXME]Update screenshot for v3:::
|
:::note [FIXME]
|
||||||
|
Update screenshot for v3
|
||||||
|
:::
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
@ -106,7 +112,9 @@ measurement is influencing the pattern.
|
||||||
|
|
||||||
For our bib, we only use one measurement, so it influences the entire pattern.
|
For our bib, we only use one measurement, so it influences the entire pattern.
|
||||||
|
|
||||||
:::note [FIXME]Add screenshot:::
|
:::note [FIXME]
|
||||||
|
Add screenshot
|
||||||
|
:::
|
||||||
|
|
||||||
## Testing measurments sets
|
## Testing measurments sets
|
||||||
|
|
||||||
|
@ -121,7 +129,9 @@ ends up being the same as testing a complete set of measurements.
|
||||||
But most patterns use multiple measurements, and we'll find this test gives
|
But most patterns use multiple measurements, and we'll find this test gives
|
||||||
us insight into how our pattern will adapt to differently sized bodies.
|
us insight into how our pattern will adapt to differently sized bodies.
|
||||||
|
|
||||||
:::note [FIXME]Add screenshot:::
|
:::note [FIXME]
|
||||||
|
Add screenshot
|
||||||
|
:::
|
||||||
|
|
||||||
## The antperson test
|
## The antperson test
|
||||||
|
|
||||||
|
@ -130,7 +140,7 @@ our pattern with a set of _typical_ measurements , and then drafts it again
|
||||||
with measurements that are 1/10th of those _typical_ measurements.
|
with measurements that are 1/10th of those _typical_ measurements.
|
||||||
|
|
||||||
It is named after [the cartoon
|
It is named after [the cartoon
|
||||||
character](https://en.wikipedia.org/wiki/Ant-Man_\(film\)) who can shrink, yet
|
character](<https://en.wikipedia.org/wiki/Ant-Man_(film)>) who can shrink, yet
|
||||||
somehow his suit still fits.
|
somehow his suit still fits.
|
||||||
|
|
||||||
The purpose of the antperson test is to bring out areas in our pattern where
|
The purpose of the antperson test is to bring out areas in our pattern where
|
||||||
|
@ -141,7 +151,9 @@ instructions don't scale, and we should avoid them.
|
||||||
The best patterns will pass the antperson test with 2 patterns exactly the
|
The best patterns will pass the antperson test with 2 patterns exactly the
|
||||||
same, where one will simply be 1/10th the scale of the other.
|
same, where one will simply be 1/10th the scale of the other.
|
||||||
|
|
||||||
:::note [FIXME]Add screenshot:::
|
:::note [FIXME]
|
||||||
|
Add screenshot
|
||||||
|
:::
|
||||||
|
|
||||||
When we're happy with how our pattern passes these tests, it's time to
|
When we're happy with how our pattern passes these tests, it's time to
|
||||||
complete our design.
|
complete our design.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue