1
0
Fork 0

chore: More linting

@nicholasdower is smarter than me. What's missing was the
`listItemIndent` setting
This commit is contained in:
Joost De Cock 2022-02-20 14:44:38 +01:00
parent e6f1189017
commit 249f2600e5
293 changed files with 2170 additions and 2169 deletions

View file

@ -2,6 +2,7 @@ settings:
bullet: "-" bullet: "-"
emphasis: "_" emphasis: "_"
strong: "*" strong: "*"
listItemIndent: one
plugins: plugins:
- remark-frontmatter - remark-frontmatter
- remark-preset-lint-consistent - remark-preset-lint-consistent

View file

@ -19,8 +19,8 @@ Instead, embrace percentages as options.
To check how well your pattern scales, you can To check how well your pattern scales, you can
use the _antperson_ test by sampling the pattern for 2 models: use the _antperson_ test by sampling the pattern for 2 models:
- A model with measurements of avarage person (the person) - A model with measurements of avarage person (the person)
- A model with measurements 1/10th of an average person (the ant) - A model with measurements 1/10th of an average person (the ant)
A well-designed pattern will scale a factor 10 down and hold its shape. A well-designed pattern will scale a factor 10 down and hold its shape.
If your pattern makes assumptions about size, this test will show that. If your pattern makes assumptions about size, this test will show that.

View file

@ -6,8 +6,8 @@ order: 50
Instances of abusive, harassing, or otherwise unacceptable behavior Instances of abusive, harassing, or otherwise unacceptable behavior
may be reported to the community leaders responsible for enforcement: may be reported to the community leaders responsible for enforcement:
- Joost De Cock (joost@joost.at) - Joost De Cock (joost@joost.at)
- Sorcha Ní Dhubhghaill (nidhubhs@gmail.com) - Sorcha Ní Dhubhghaill (nidhubhs@gmail.com)
All complaints will be reviewed and investigated promptly and fairly. All complaints will be reviewed and investigated promptly and fairly.

View file

@ -5,16 +5,16 @@ order: 20
Examples of behavior that contributes to a positive environment for our community include: Examples of behavior that contributes to a positive environment for our community include:
- Demonstrating empathy and kindness toward other people - Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences - Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback - Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community - Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include: Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of any kind - The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks - Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment - Public or private harassment
- Publishing others private information, such as a physical or email address, without their explicit permission - Publishing others private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting - Other conduct which could reasonably be considered inappropriate in a professional setting

View file

@ -10,10 +10,10 @@ documentation can help you find your feet, and figure out what goes where.
Our documentation is divided into four different types: Our documentation is divided into four different types:
- [**Tutorials**](/tutorials) are lessons that lead you through a series of steps to complete a project. - [**Tutorials**](/tutorials) are lessons that lead you through a series of steps to complete a project.
- [**Guides**](/guides) tell a story to further your understanding of a specific topic. - [**Guides**](/guides) tell a story to further your understanding of a specific topic.
- [**Howtos**](/howtos) give you concrete steps to solve a common problem or challenge. - [**Howtos**](/howtos) give you concrete steps to solve a common problem or challenge.
- [**Reference**](/reference) holds technical descriptions of the underlying technology and how to make use of it. - [**Reference**](/reference) holds technical descriptions of the underlying technology and how to make use of it.
Each time you write documentation, you have to ask yourself: Is it a tutorial? Is it a Guide? Each time you write documentation, you have to ask yourself: Is it a tutorial? Is it a Guide?
Is it a Howto? Or is it Reference documentation. Is it a Howto? Or is it Reference documentation.
@ -24,11 +24,11 @@ where your documentation should go based on what it's trying to accomplish:
![A graphic showing a visual representation of our documentation ![A graphic showing a visual representation of our documentation
structure](docs.png "A visual representation of how our documentation is structured") structure](docs.png "A visual representation of how our documentation is structured")
- Write a **Tutorial** is your aim is to help people learn the platform - Write a **Tutorial** is your aim is to help people learn the platform
- Write a **Guide** if your aim is to further people's understanding of a topic by going a bit deeper - Write a **Guide** if your aim is to further people's understanding of a topic by going a bit deeper
- Write a **Howto** if your ain is to help people accomplish a task - Write a **Howto** if your ain is to help people accomplish a task
- Write **Reference** documentation to detail how things work under the hood - Write **Reference** documentation to detail how things work under the hood
- Refer people to **Discord or Github** for things that are not (yet) covered in our documentation - Refer people to **Discord or Github** for things that are not (yet) covered in our documentation
<Note> <Note>

View file

@ -38,11 +38,11 @@ let me = 'you'
The following language codes are supported: The following language codes are supported:
- `js` for Javascript code - `js` for Javascript code
- `markdown` for Markdown - `markdown` for Markdown
- `html` for HTML - `html` for HTML
- `svg` for SVG - `svg` for SVG
- `bash` for Bash or shell scripts - `bash` for Bash or shell scripts
- `mdx` for MDX - `mdx` for MDX
- `jsx` for JSX - `jsx` for JSX
- `json` for JSON - `json` for JSON

View file

@ -12,10 +12,10 @@ To make a list, just do as you would in plain text:
- item - item
``` ```
- a bullet - a bullet
- list - list
- a sublist - a sublist
- item - item
If you want an numbered list, just write numbers. If you want an numbered list, just write numbers.
They don't even have to be the correct numbers: They don't even have to be the correct numbers:
@ -27,6 +27,6 @@ They don't even have to be the correct numbers:
2. Item 3 2. Item 3
``` ```
1. Item 1 1. Item 1
2. Item 2 2. Item 2
3. Item 3 3. Item 3

View file

@ -12,9 +12,9 @@ The pattern configuration holds important information about the pattern
A pattern's [configuration](/reference/config/) is created by the pattern designer A pattern's [configuration](/reference/config/) is created by the pattern designer
and details a number of important things about the pattern, like: and details a number of important things about the pattern, like:
- The **measurements** that are required to draft the pattern - The **measurements** that are required to draft the pattern
- The different **parts** in the pattern and how they depend on each other - The different **parts** in the pattern and how they depend on each other
- The different **options** that are available to tweak the pattern - The different **options** that are available to tweak the pattern
The configuration is part of the pattern's code. It is created by the designer and The configuration is part of the pattern's code. It is created by the designer and
it is the same for everybody using the pattern. it is the same for everybody using the pattern.

View file

@ -17,9 +17,9 @@ A schematic overview of FreeSewing
If we look at our image, it can be divided into three areas: If we look at our image, it can be divided into three areas:
- The left area with the **settings** box - The left area with the **settings** box
- The middle area with the **Pattern** box and everything in it - The middle area with the **Pattern** box and everything in it
- The right area with the **draft** box and the _SVG_ and _React_ logos - The right area with the **draft** box and the _SVG_ and _React_ logos
Let's take a closer look at everything that is contained within our central **Pattern** box: Let's take a closer look at everything that is contained within our central **Pattern** box:

View file

@ -12,10 +12,10 @@ Paths are the lines and curves that make up your pattern.
They are made up of a set of drawing operations that together make up the path. They are made up of a set of drawing operations that together make up the path.
FreeSewing supports the following types of drawing operations: FreeSewing supports the following types of drawing operations:
- The **move** operation moves our virtual pen but does not draw anything. - The **move** operation moves our virtual pen but does not draw anything.
- The **line** operation draws a straight line - The **line** operation draws a straight line
- The **curve** operation draws a [Bézier curve](/guides/overview/about/beziercurves/) - The **curve** operation draws a [Bézier curve](/guides/overview/about/beziercurves/)
- The **close** operation closes the path - The **close** operation closes the path
To crucial thing to keep in mind is that, with the exception of the **move** operation, To crucial thing to keep in mind is that, with the exception of the **move** operation,
all drawing operations start from wherever you are currently on your virtual sheet of paper. all drawing operations start from wherever you are currently on your virtual sheet of paper.

View file

@ -16,8 +16,8 @@ FreeSewing pattern, and their role is to store coordinates.
Each point must have: Each point must have:
- A **X-coordinate** - A **X-coordinate**
- A **Y-coordinate** - A **Y-coordinate**
Together, these coordinates determine the location of the point in the 2-dimensional plane we're drawing on. Together, these coordinates determine the location of the point in the 2-dimensional plane we're drawing on.

View file

@ -12,8 +12,8 @@ They are typically used for things like logos or buttons.
Each snippet must have: Each snippet must have:
- An anchor point that determine where the snippet will be located - An anchor point that determine where the snippet will be located
- The name of the snippet to insert - The name of the snippet to insert
Since our example image does not have any snippets in it, here's another example Since our example image does not have any snippets in it, here's another example
of a `button`, `buttonhole`, and `logo` snippet added to a FreeSewing pattern: of a `button`, `buttonhole`, and `logo` snippet added to a FreeSewing pattern:

View file

@ -51,10 +51,10 @@ const Pattern = new freesewing.Design(
Our condition method will return `true` only if the following conditions are met: Our condition method will return `true` only if the following conditions are met:
- A `settings` object is passed into the method - A `settings` object is passed into the method
- `settings.options` is _truthy_ - `settings.options` is _truthy_
- `settings.options.draftForHighBust` is _truthy_ - `settings.options.draftForHighBust` is _truthy_
- `settings.options.measurements.highBust` is _truthy_ - `settings.options.measurements.highBust` is _truthy_
This is a real-world example from our Teagan pattern. A t-shirt pattern that can be This is a real-world example from our Teagan pattern. A t-shirt pattern that can be
drafted to the high bust (rather than the full chest circumference) if the user drafted to the high bust (rather than the full chest circumference) if the user

View file

@ -5,16 +5,16 @@ order: 60
A **hook** is a lifecycle event. The available hooks are: A **hook** is a lifecycle event. The available hooks are:
- [preRender](/reference/hooks/prerender/): Called at the start of [`Pattern.render()`](/reference/api/pattern#render) - [preRender](/reference/hooks/prerender/): Called at the start of [`Pattern.render()`](/reference/api/pattern#render)
- [postRender](/reference/hooks/postrender/): Called at the end of [`Pattern.render()`](/reference/api/pattern#render) - [postRender](/reference/hooks/postrender/): Called at the end of [`Pattern.render()`](/reference/api/pattern#render)
- [insertText](/reference/hooks/inserttext/): Called when inserting text - [insertText](/reference/hooks/inserttext/): Called when inserting text
- [preDraft](/reference/hooks/predraft/): Called at the start of [`Pattern.draft()`](/reference/api/pattern#draft) - [preDraft](/reference/hooks/predraft/): Called at the start of [`Pattern.draft()`](/reference/api/pattern#draft)
- [postDraft](/reference/hooks/postdraft/): Called at the end of [`Pattern.draft()`](/reference/api/pattern#draft) - [postDraft](/reference/hooks/postdraft/): Called at the end of [`Pattern.draft()`](/reference/api/pattern#draft)
- [preSample](/reference/hooks/presample/): Called at the start of [`Pattern.sample()`](/reference/api/pattern#sample) - [preSample](/reference/hooks/presample/): Called at the start of [`Pattern.sample()`](/reference/api/pattern#sample)
- [postSample](/reference/hooks/postsample/): Called at the end of [`Pattern.sample()`](/reference/api/pattern#sample) - [postSample](/reference/hooks/postsample/): Called at the end of [`Pattern.sample()`](/reference/api/pattern#sample)
You can register a method for a hook. When the hook is triggered, your method will be You can register a method for a hook. When the hook is triggered, your method will be
called. It will receive two parameters: called. It will receive two parameters:
- An object relevant to the hook. See the [hooks API reference](/reference/hooks/) for details. - An object relevant to the hook. See the [hooks API reference](/reference/hooks/) for details.
- Data passed when the hook was registered (optional) - Data passed when the hook was registered (optional)

View file

@ -5,8 +5,8 @@ order: 90
Plugin structure for macros is similar, with a few changes: Plugin structure for macros is similar, with a few changes:
- Rather than the hook name, you provide the macro name (that you choose yourself) - Rather than the hook name, you provide the macro name (that you choose yourself)
- The context (`this`) of a macro method is **always** a [Part](/reference/api/part) object. - The context (`this`) of a macro method is **always** a [Part](/reference/api/part) object.
Apart from these, the structure is very similar: Apart from these, the structure is very similar:

View file

@ -5,8 +5,8 @@ order: 50
Plugins can do two things: Plugins can do two things:
- They can use hooks - They can use hooks
- They can provide macros - They can provide macros
Your plugin should export an object with the following structure: Your plugin should export an object with the following structure:

View file

@ -5,8 +5,8 @@ order: 10
Plugins come in two flavours: Plugins come in two flavours:
- [Build-time plugins](#build-time-plugins) - [Build-time plugins](#build-time-plugins)
- [Run-time plugins](#run-time-plugins) - [Run-time plugins](#run-time-plugins)
When writing a plugin, ask yourself whether it's a run-time or a build-time plugin. When writing a plugin, ask yourself whether it's a run-time or a build-time plugin.
And if the answer is both, please split them into two plugins. And if the answer is both, please split them into two plugins.

View file

@ -9,8 +9,8 @@ that as the second object.
Remember that: Remember that:
- The `insertText` hook will receive a locale and string and you should return a string. - The `insertText` hook will receive a locale and string and you should return a string.
- All other hooks receive an object. You don't need to return anything, but rather modify the object you receive. - All other hooks receive an object. You don't need to return anything, but rather modify the object you receive.
Let's look at an example: Let's look at an example:
@ -39,8 +39,8 @@ export default {
This is a complete plugin, ready to be published on NPM. It uses two hooks: This is a complete plugin, ready to be published on NPM. It uses two hooks:
- `preRender` : We add some style and defs to our SVG - `preRender` : We add some style and defs to our SVG
- `insertText` : We transfer all text to UPPERCASE - `insertText` : We transfer all text to UPPERCASE
<Note> <Note>

View file

@ -12,10 +12,10 @@ popularized their use back in the 1960s.
In FreeSewing, we use so-called cubic Bézier curves which have: In FreeSewing, we use so-called cubic Bézier curves which have:
- A start point - A start point
- A first control point thats linked to the start point - A first control point thats linked to the start point
- A second control point thats linked to the end point - A second control point thats linked to the end point
- An end point - An end point
<Example settings_complete="0" part="path_curve"> <Example settings_complete="0" part="path_curve">
An example of a Bézier curve drawn by the Path.curve() method An example of a Bézier curve drawn by the Path.curve() method

View file

@ -31,11 +31,11 @@ Bonus: You'll get an `@freesewing.org` email alias
We currently support the following five languages: We currently support the following five languages:
- **en** : English - **en** : English
- **de** : German - **de** : German
- **es** : Spanish - **es** : Spanish
- **fr** : French - **fr** : French
- **nl** : Dutch - **nl** : Dutch
<Note> <Note>
@ -49,8 +49,8 @@ please [come and talk to us on Discord](https://discord.freesewing.org).
We use two different tools to manage our translations, depending on the context: We use two different tools to manage our translations, depending on the context:
- Markdown content and code strings in our monorepo are translated within **Crowdin** - Markdown content and code strings in our monorepo are translated within **Crowdin**
- Blog and showcase posts are translated within **Strapi** - Blog and showcase posts are translated within **Strapi**
<Tip> <Tip>

View file

@ -8,7 +8,7 @@ about: While documentation is good, sometimes you want to add some instructions
##### See this example in our source code ##### See this example in our source code
- [packages/jaeger/src/front.js](https://github.com/freesewing/freesewing/blob/38d101b0415a4cbf3f9f86e006bd8cb7c43c703b/packages/jaeger/src/front.js#L411) - [packages/jaeger/src/front.js](https://github.com/freesewing/freesewing/blob/38d101b0415a4cbf3f9f86e006bd8cb7c43c703b/packages/jaeger/src/front.js#L411)
</Note> </Note>

View file

@ -16,8 +16,8 @@ snippets.logo = new Snippet('logo', points.logoAnchor);
You can scale and rotate a snippet by setting the `data-scale` and `data-rotate` attributes respectively. You can scale and rotate a snippet by setting the `data-scale` and `data-rotate` attributes respectively.
- **data-scale** : Either a single scale factor, or a set of 2 scale factors for the X and Y axis respectively. See [the SVG scale transform](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#Scale) for details. - **data-scale** : Either a single scale factor, or a set of 2 scale factors for the X and Y axis respectively. See [the SVG scale transform](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#Scale) for details.
- **data-rotate**: A rotation in degrees. The center of the rotation will be the snippet's anchor point - **data-rotate**: A rotation in degrees. The center of the rotation will be the snippet's anchor point
<Tip> <Tip>

View file

@ -26,9 +26,9 @@ we need that info to fit the sleevecap to the armhole.
Now if a user requests to draft only the `sleeve` part, FreeSewing will still draft: Now if a user requests to draft only the `sleeve` part, FreeSewing will still draft:
- First the `base` part - First the `base` part
- Then the `front` and `back` parts - Then the `front` and `back` parts
- Finally the `sleeve` part - Finally the `sleeve` part
but it will only render the `sleeve` part, as that's the only thing the user requested. but it will only render the `sleeve` part, as that's the only thing the user requested.

View file

@ -8,9 +8,9 @@ about: Shows how to create a variation of a pre-existing design
##### See this example in our source code ##### See this example in our source code
- [packages/aaron/config/index.js](https://github.com/freesewing/freesewing/blob/72f34101792bda4d8e553c3479daa63cb461f3c5/packages/aaron/config/index.js#L34) - [packages/aaron/config/index.js](https://github.com/freesewing/freesewing/blob/72f34101792bda4d8e553c3479daa63cb461f3c5/packages/aaron/config/index.js#L34)
- [packages/aaron/src/index.js](https://github.com/freesewing/freesewing/blob/72f34101792bda4d8e553c3479daa63cb461f3c5/packages/aaron/src/index.js#L2) - [packages/aaron/src/index.js](https://github.com/freesewing/freesewing/blob/72f34101792bda4d8e553c3479daa63cb461f3c5/packages/aaron/src/index.js#L2)
- [packages/carlita/src/index.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/carlita/src/index.js#L25) - [packages/carlita/src/index.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/carlita/src/index.js#L25)
</Note> </Note>
@ -18,8 +18,8 @@ about: Shows how to create a variation of a pre-existing design
To be able to extend existing patterns, you will have to access them on your local machine. There are two ways to do this: To be able to extend existing patterns, you will have to access them on your local machine. There are two ways to do this:
- add needed dependencies when using `npx create-freesewing-pattern` - add needed dependencies when using `npx create-freesewing-pattern`
- create your new pattern in a clone of the [freesewing monorepo](https://github.com/freesewing/freesewing) - create your new pattern in a clone of the [freesewing monorepo](https://github.com/freesewing/freesewing)
### When using `npx create-freesewing-pattern` ### When using `npx create-freesewing-pattern`
@ -44,16 +44,16 @@ Some packages need more than one dependency. Carlton, for example, is based on B
You can use the power of robots to install the needed dependencies if you work in a clone of the [freesewing monorepo](https://github.com/freesewing/freesewing). You can use the power of robots to install the needed dependencies if you work in a clone of the [freesewing monorepo](https://github.com/freesewing/freesewing).
- First, clone the monorepo (or your fork of it) to your local machine. - First, clone the monorepo (or your fork of it) to your local machine.
- Go to the root and run `yarn kickstart`. This will take a while, so grab a coffee and come back later. - Go to the root and run `yarn kickstart`. This will take a while, so grab a coffee and come back later.
- Once that is done, edit the file `config/descriptions.yaml` to include the name and description of your new pattern (take care to start the description with `A FreeSewing pattern`). - Once that is done, edit the file `config/descriptions.yaml` to include the name and description of your new pattern (take care to start the description with `A FreeSewing pattern`).
- Create a folder for your new pattern in `packages`. - Create a folder for your new pattern in `packages`.
- Run `yarn reconfigure`. This will read the changes in `config/descriptions.yaml` and create the needed files in your new folder. - Run `yarn reconfigure`. This will read the changes in `config/descriptions.yaml` and create the needed files in your new folder.
- If you haven't already, now is also a good time to create a feature branch so that you don't work directly in the `develop`-branch of the git-repository: `git checkout -b mycoolnewpattern` (adjust name accordingly). - If you haven't already, now is also a good time to create a feature branch so that you don't work directly in the `develop`-branch of the git-repository: `git checkout -b mycoolnewpattern` (adjust name accordingly).
- You can now start the actual pattern design work (i.e. editing and adding `src` and `config` files for your pattern. - You can now start the actual pattern design work (i.e. editing and adding `src` and `config` files for your pattern.
- For dependencies, configure them in `config/dependencies.yaml`. - For dependencies, configure them in `config/dependencies.yaml`.
- Run `yarn reconfigure` again, and the magic will make sure that your `package.json` is updated accordingly. - Run `yarn reconfigure` again, and the magic will make sure that your `package.json` is updated accordingly.
- You can set yourself as an author in `config/exceptions.yaml`, and - you guessed it - run `yarn reconfigure` again. - You can set yourself as an author in `config/exceptions.yaml`, and - you guessed it - run `yarn reconfigure` again.
Now you can work on extending existing patterns into something new and exciting. And the best part about using this method is that making a pull request will be much easier once you're done developing your new pattern. Now you can work on extending existing patterns into something new and exciting. And the best part about using this method is that making a pull request will be much easier once you're done developing your new pattern.

View file

@ -8,7 +8,7 @@ about: When you inherit a part, it comes with a bunch of paths. Here'show to hid
##### See this example in our source code ##### See this example in our source code
- [packages/aaron/src/front.js](https://github.com/freesewing/freesewing/blob/develop/packages/aaron/src/front.js#L22) - [packages/aaron/src/front.js](https://github.com/freesewing/freesewing/blob/develop/packages/aaron/src/front.js#L22)
</Note> </Note>

View file

@ -8,7 +8,7 @@ about: When you inherit a part, it comes with a bunch of paths. Here'show to rem
##### See this example in our source code ##### See this example in our source code
- [packages/carlton/src/back.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/carlton/src/back.js#L62) - [packages/carlton/src/back.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/carlton/src/back.js#L62)
</Note> </Note>

View file

@ -8,8 +8,8 @@ about: Shows how to share dimensions between similar pattern parts
##### See this example in our source code ##### See this example in our source code
- [packages/aaron/src/shared.js](https://github.com/freesewing/freesewing/blob/develop/packages/aaron/src/shared.js) - [packages/aaron/src/shared.js](https://github.com/freesewing/freesewing/blob/develop/packages/aaron/src/shared.js)
- [packages/aaron/src/front.js](https://github.com/freesewing/freesewing/blob/72f34101792bda4d8e553c3479daa63cb461f3c5/packages/aaron/src/front.js#L160) - [packages/aaron/src/front.js](https://github.com/freesewing/freesewing/blob/72f34101792bda4d8e553c3479daa63cb461f3c5/packages/aaron/src/front.js#L160)
</Note> </Note>

View file

@ -8,7 +8,7 @@ about: Shows how to store a seam length so you can true the seam of another part
##### See this example in our source code ##### See this example in our source code
- [packages/aaron/src/front.js](https://github.com/freesewing/freesewing/blob/develop/packages/aaron/src/front.js#L103) - [packages/aaron/src/front.js](https://github.com/freesewing/freesewing/blob/develop/packages/aaron/src/front.js#L103)
</Note> </Note>

View file

@ -8,7 +8,7 @@ about: Shows how to adapt the length of the sleevecap to fit your armhole
##### See this example in our source code ##### See this example in our source code
- [packages/bent/src/sleeve.js](https://github.com/freesewing/freesewing/blob/develop/packages/bent/src/sleeve.js) - [packages/bent/src/sleeve.js](https://github.com/freesewing/freesewing/blob/develop/packages/bent/src/sleeve.js)
</Note> </Note>
@ -25,15 +25,15 @@ This pattern is rather common, and we will unpack an example from Bent below.
Before we dive in, here's a few things to keep in mind: Before we dive in, here's a few things to keep in mind:
- In Javascript, you can create a function within your function and call it - In Javascript, you can create a function within your function and call it
- Bent extends Brian which sets both the `frontArmholeLength` and `backArmholeLength` values in the store with the length of those seams - Bent extends Brian which sets both the `frontArmholeLength` and `backArmholeLength` values in the store with the length of those seams
- We need to match the length of the sleevecap + sleeve cap ease to the length of the front and back armhole - We need to match the length of the sleevecap + sleeve cap ease to the length of the front and back armhole
Here's how you can handle this in code: Here's how you can handle this in code:
- We create a method that does teh actual drafting of our sleevecap - We create a method that does teh actual drafting of our sleevecap
- We use a `tweak` value to influence the process, we start with a value of `1` - We use a `tweak` value to influence the process, we start with a value of `1`
- We check the length after every attempt, and adjust the `tweak` value - We check the length after every attempt, and adjust the `tweak` value
```js ```js
export default function (part) { export default function (part) {
@ -81,7 +81,7 @@ export default function (part) {
A few things that are important: A few things that are important:
- We check to see how close we are by using `Math.abs(delta)` which gives us the absolute value of our delta - We check to see how close we are by using `Math.abs(delta)` which gives us the absolute value of our delta
- We guard against an endless loop by keeping track of the runs and giving up after 25 - We guard against an endless loop by keeping track of the runs and giving up after 25
- We multiply by `0.99` and `1.02` to respectively decrease and increase our `tweak` factor. - We multiply by `0.99` and `1.02` to respectively decrease and increase our `tweak` factor.
This assymetric approach avoids that we end up ping-ponging around our target value and never land somewhere in the middle This assymetric approach avoids that we end up ping-ponging around our target value and never land somewhere in the middle

View file

@ -8,7 +8,7 @@ about: Adding seam allowance or hem allowance is easy to do
##### See this example in our source code ##### See this example in our source code
- [packages/bruce/src/inset.js](https://github.com/freesewing/freesewing/blob/develop/packages/bruce/src/inset.js#L34) - [packages/bruce/src/inset.js](https://github.com/freesewing/freesewing/blob/develop/packages/bruce/src/inset.js#L34)
</Note> </Note>
@ -20,8 +20,8 @@ seam allowance.
In the example below we have two such paths: In the example below we have two such paths:
- `paths.saBase` is the path that will require regular seam allowance - `paths.saBase` is the path that will require regular seam allowance
- `paths.hemBase` is the path that will require more seam allowance, or hem allowance - `paths.hemBase` is the path that will require more seam allowance, or hem allowance
When creating them, we disable rendering, effectively hiding them. When creating them, we disable rendering, effectively hiding them.
Then we string together our real path and our seam allowance based on them: Then we string together our real path and our seam allowance based on them:

View file

@ -8,7 +8,7 @@ about: Slash and spread is easy enough on paper, here's how to do it in code
##### See this example in our source code ##### See this example in our source code
- [packages/jaeger/src/front.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/jaeger/src/front.js#L64) - [packages/jaeger/src/front.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/jaeger/src/front.js#L64)
</Note> </Note>
@ -17,9 +17,9 @@ around the tip of the triangle.
And that's exactly what we do in code. We just need to know: And that's exactly what we do in code. We just need to know:
- What point we want to rotate around - What point we want to rotate around
- Which points we want to rotate - Which points we want to rotate
- By how much we want to rotate - By how much we want to rotate
```js ```js
let rotate = [ let rotate = [

View file

@ -8,7 +8,7 @@ about: Adding multiple snippets doesn't need to be a chore with this handy macro
##### See this example in our source code ##### See this example in our source code
- [packages/jaeger/src/front.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/jaeger/src/front.js#L381) - [packages/jaeger/src/front.js](https://github.com/freesewing/freesewing/blob/8474477911daed3c383700ab29c9565883f16d66/packages/jaeger/src/front.js#L381)
</Note> </Note>

View file

@ -21,11 +21,11 @@ our website for makers.
To generate a pattern, you will need to: To generate a pattern, you will need to:
- Instantiate the pattern (`new ...`) - Instantiate the pattern (`new ...`)
- Pass it the settings and measurements you want to use (`{ ... }`) - Pass it the settings and measurements you want to use (`{ ... }`)
- Load the theme plugin (using `use()`) - Load the theme plugin (using `use()`)
- Draft the pattern (using `draft()`) - Draft the pattern (using `draft()`)
- Render it to SVG (using `render()`) - Render it to SVG (using `render()`)
Which can be done as a one-liner since `use()`, `draft()` and Which can be done as a one-liner since `use()`, `draft()` and
`render()` are all chainable, as shown below. `render()` are all chainable, as shown below.

View file

@ -22,11 +22,11 @@ our website for makers.
To generate a pattern, you will need to: To generate a pattern, you will need to:
- Instantiate the pattern (`new ...`) - Instantiate the pattern (`new ...`)
- Pass it the settings and measurements you want to use (`{ ... }`) - Pass it the settings and measurements you want to use (`{ ... }`)
- Load the theme plugin (using `use()`) - Load the theme plugin (using `use()`)
- Draft the pattern (using `draft()`) - Draft the pattern (using `draft()`)
- Render it to SVG (using `render()`) - Render it to SVG (using `render()`)
Which can be done as a one-liner since `use()`, `draft()` and Which can be done as a one-liner since `use()`, `draft()` and
`render()` are all chainable, as shown below. `render()` are all chainable, as shown below.
@ -64,11 +64,11 @@ console.log(svg)
##### Remarks on the example code ##### Remarks on the example code
- We are using `@freesewing/aaron` as the design, but you could use any design - We are using `@freesewing/aaron` as the design, but you could use any design
- You probably want to [use your own measurements](/reference/api/settings/measurements) - You probably want to [use your own measurements](/reference/api/settings/measurements)
or you could use `@freesewing/models` to load measurements from [our sizing grid](https://freesewing.org/sizes/) or you could use `@freesewing/models` to load measurements from [our sizing grid](https://freesewing.org/sizes/)
- We are using `@freesewing/plugin-theme` to theme our SVG, but you - We are using `@freesewing/plugin-theme` to theme our SVG, but you
could [pass in your own CSS](/guides/plugins/using-hooks-without-plugin) could [pass in your own CSS](/guides/plugins/using-hooks-without-plugin)
</Note> </Note>
@ -77,11 +77,11 @@ console.log(svg)
The code above will only work if you've got the required dependencies installed on your system. The code above will only work if you've got the required dependencies installed on your system.
Obviously you need NodeJS, but you will also need the following packages: Obviously you need NodeJS, but you will also need the following packages:
- `@freesewing/core`: Our core library - `@freesewing/core`: Our core library
- `@freesewing/plugin-bundle`: Set of common plugins - `@freesewing/plugin-bundle`: Set of common plugins
- `@freesewing/aaron` or any design you want to use - `@freesewing/aaron` or any design you want to use
- Any design on which the design you choose is built. In this case, Aaron depends on `@freesewing/brian` - Any design on which the design you choose is built. In this case, Aaron depends on `@freesewing/brian`
- `@freesewing/utils` - `@freesewing/utils`
For the example above, your `package.json` **dependencies** section will look like this: For the example above, your `package.json` **dependencies** section will look like this:

View file

@ -13,8 +13,8 @@ value a safe and welcoming environment for all members of the FreeSewing communi
To that extend, we impose the following requirements to ensure everyone feels safe and welcome: To that extend, we impose the following requirements to ensure everyone feels safe and welcome:
- Any member of our community must respect [our community standards](https://freesewing.org/docs/various/community-standards/) - Any member of our community must respect [our community standards](https://freesewing.org/docs/various/community-standards/)
- As a contributor, you must uphold [our Code of Conduct](/guides/code-of-conduct/) - As a contributor, you must uphold [our Code of Conduct](/guides/code-of-conduct/)
Go ahead and read those, we'll wait. Go ahead and read those, we'll wait.
@ -22,11 +22,11 @@ Go ahead and read those, we'll wait.
With that out of the way, here's a few more things that are _good to know_: With that out of the way, here's a few more things that are _good to know_:
- Nobody gets paid to work on/for FreeSewing. We are a 100% volunteer organisation. - Nobody gets paid to work on/for FreeSewing. We are a 100% volunteer organisation.
- We have patrons who support us financially, but all the money that comes in goes to charity — - We have patrons who support us financially, but all the money that comes in goes to charity —
See our [revenue pledge](https://freesewing.org/docs/various/pledge/) for details See our [revenue pledge](https://freesewing.org/docs/various/pledge/) for details
- FreeSewing follows the [all-contributors](https://allcontributors.org/) specification. - FreeSewing follows the [all-contributors](https://allcontributors.org/) specification.
Contributions of any kind are welcome. Contributions of any kind are welcome.
## Where to begin ## Where to begin

View file

@ -9,6 +9,6 @@ organize milestones, and so on.
This is helpful in more than one way: This is helpful in more than one way:
- It reduces the cognitive load of the people implementing changes because they don't have to worry about forgetting things - It reduces the cognitive load of the people implementing changes because they don't have to worry about forgetting things
- It increases transparency by making it clear what sort of things are being worked on - It increases transparency by making it clear what sort of things are being worked on
- It gives us that good feeling of closing the issue when the task is done - It gives us that good feeling of closing the issue when the task is done

View file

@ -7,11 +7,11 @@ Create an issue [in our monorepo](https://github.com/freesewing/freesewing/issue
Explain the problem and include additional details to help maintainers reproduce the problem: Explain the problem and include additional details to help maintainers reproduce the problem:
- **Use a clear and descriptive title** for the issue to identify the problem. - **Use a clear and descriptive title** for the issue to identify the problem.
- **Describe the exact steps which reproduce the problem** in as many details as possible. - **Describe the exact steps which reproduce the problem** in as many details as possible.
- **Include relevant information** such as your username on the site, or the person you drafted a pattern for. - **Include relevant information** such as your username on the site, or the person you drafted a pattern for.
Provide more context by answering these questions: Provide more context by answering these questions:
- **Did the problem start happening recently** (e.g. it worked fine before but since the latest update it doesn't) - **Did the problem start happening recently** (e.g. it worked fine before but since the latest update it doesn't)
- **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. - **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.

View file

@ -4,11 +4,11 @@ title: Triage issues
Triaging issues is a great way to get involved in FreeSewing. You can do tasks such as: Triaging issues is a great way to get involved in FreeSewing. You can do tasks such as:
- Making sure issues are properly labeled - Making sure issues are properly labeled
- Ensuring they have a good title that explains the issue in brief - Ensuring they have a good title that explains the issue in brief
- Assigning issues to people to make sure they are tended to - Assigning issues to people to make sure they are tended to
- Keeping an eye on stale issues, and either updating or closing them - Keeping an eye on stale issues, and either updating or closing them
- Assigning issues to milestones so we can plan our releases - Assigning issues to milestones so we can plan our releases
All FreeSewing contributors have triage permissions that allows them to do this. All FreeSewing contributors have triage permissions that allows them to do this.
If you don't have the rights, or bump into any issues, [reach out to us on Discord](https://discord.freesewing.org). If you don't have the rights, or bump into any issues, [reach out to us on Discord](https://discord.freesewing.org).

View file

@ -33,8 +33,8 @@ dependencies: {
In this example: In this example:
- The `front` part depends on the `back` part - The `front` part depends on the `back` part
- The `sleeveplacket` part depends on the `sleeve` and `cuff` parts. - The `sleeveplacket` part depends on the `sleeve` and `cuff` parts.
<Tip> <Tip>

View file

@ -26,9 +26,9 @@ configuration file.
They hold a plain object where each property can hold: They hold a plain object where each property can hold:
- An array of strings that are the names of the options to include in the group - An array of strings that are the names of the options to include in the group
- A plain object whose properties hold an array of strings that are the names - A plain object whose properties hold an array of strings that are the names
of the options to include in the group. (this creates a subgroup) of the options to include in the group. (this creates a subgroup)
## Example ## Example
@ -53,12 +53,12 @@ optionGroups: {
The configuration above will create the following structure: The configuration above will create the following structure:
- **fit** - **fit**
- `chestEase` - `chestEase`
- `waistEase` - `waistEase`
- **style** - **style**
- `cuffStyle` - `cuffStyle`
- `hemStyle` - `hemStyle`
- **collar** - **collar**
- `collarHeight` - `collarHeight`
- `collarShape` - `collarShape`

View file

@ -9,8 +9,8 @@ or **yes** or **no**, use a boolean option.
A boolean option is a plain object with these properties: A boolean option is a plain object with these properties:
- `bool` : Either `true` or `false` which will be the default - `bool` : Either `true` or `false` which will be the default
- `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide] - `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide]
[hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method [hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method

View file

@ -26,11 +26,11 @@ options: {
There are typically two use-cases for constant options: There are typically two use-cases for constant options:
- Rather than define constants in your code, it's good practice to set - Rather than define constants in your code, it's good practice to set
them in your configuration file. This way, people who extend your them in your configuration file. This way, people who extend your
pattern can change them if they would like to. pattern can change them if they would like to.
- A constant option can be used as a feature-flag. Enabling or disabling - A constant option can be used as a feature-flag. Enabling or disabling
parts of the code beyond the control of the end user, but accessible to parts of the code beyond the control of the end user, but accessible to
developers. developers.
</Tip> </Tip>

View file

@ -9,10 +9,10 @@ Counters are for integers only. Things like number of buttons and so on.
Your counter option should be a plain object with these properties: Your counter option should be a plain object with these properties:
- `count` : The default integer value - `count` : The default integer value
- `min` : The minimal integer value that's allowed - `min` : The minimal integer value that's allowed
- `max` : The maximum integer value that's allowed - `max` : The maximum integer value that's allowed
- `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide] - `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide]
[hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method [hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method

View file

@ -8,10 +8,10 @@ For angles, use a degree option.
Your degree option should be a plain object with these properties: Your degree option should be a plain object with these properties:
- `deg` : The default value in degrees - `deg` : The default value in degrees
- `min` : The minimul that's allowed - `min` : The minimul that's allowed
- `max` : The maximum that's allowed - `max` : The maximum that's allowed
- `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide] - `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide]
[hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method [hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method

View file

@ -26,11 +26,11 @@ possible.
There are the five option types that an aspiring pattern designer should be There are the five option types that an aspiring pattern designer should be
familiar with: familiar with:
1. [**boolean** options][bool] are for yes/no choices 1. [**boolean** options][bool] are for yes/no choices
2. [**counter** options][count] are for integer values 2. [**counter** options][count] are for integer values
3. [**degree** options][deg] are for degrees 3. [**degree** options][deg] are for degrees
4. [**list** options][list] are for a list of possible choices 4. [**list** options][list] are for a list of possible choices
5. [**percentage** options][pct] are for percentages 5. [**percentage** options][pct] are for percentages
<Tip> <Tip>
@ -43,10 +43,10 @@ They also have the most features and flexibility.
For the sake of completeness, here are the two other types of options: For the sake of completeness, here are the two other types of options:
6. [**constant** options][const] are used as 6. [**constant** options][const] are used as
[feature flags](https://en.wikipedia.org/wiki/Feature_toggle) [feature flags](https://en.wikipedia.org/wiki/Feature_toggle)
7. [**millimeter** options][const] are **deprecated** (in favor of [snapped 7. [**millimeter** options][const] are **deprecated** (in favor of [snapped
percentage options][snapped]) percentage options][snapped])
</Related> </Related>
@ -83,9 +83,9 @@ it is not intended as a way to block access to a given option. It merely hides i
By default options are shown to the user when: By default options are shown to the user when:
- They are not a constant option - They are not a constant option
- **and** - **and**
- They are included in an optionGroup - They are included in an optionGroup
You can further control the optional display of options by adding a method You can further control the optional display of options by adding a method
to the `hide` key under you option, as such: to the `hide` key under you option, as such:
@ -110,8 +110,8 @@ So you can make a choice whether to show the option or not.
If it's not obvious from the name, your `hide()` method you should: If it's not obvious from the name, your `hide()` method you should:
- Return `true` or a truthy value to hide the option - Return `true` or a truthy value to hide the option
- Return `false` or a falsy value to show the option - Return `false` or a falsy value to show the option
<Tip> <Tip>

View file

@ -8,9 +8,9 @@ Use a list option when you want to offer an array of choices.
Your list option should be a plain object with these properties: Your list option should be a plain object with these properties:
- `dflt` : The default for this option - `dflt` : The default for this option
- `list` : An array of available values options - `list` : An array of available values options
- `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide] - `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide]
[hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method [hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method

View file

@ -10,10 +10,10 @@ contributions that use millimeter options.
A millimeter option should be a plain object with these properties: A millimeter option should be a plain object with these properties:
- `mm` : The default value in millimeter - `mm` : The default value in millimeter
- `min` : The minimul that's allowed - `min` : The minimul that's allowed
- `max` : The maximum that's allowed - `max` : The maximum that's allowed
- `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide] - `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide]
[hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method [hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method

View file

@ -10,13 +10,13 @@ they ensure that your pattern will scale regardless of size.
Your percentage option should be a plain object with these properties: Your percentage option should be a plain object with these properties:
- `pct` : The default percentage - `pct` : The default percentage
- `min` : The minimum percentage that's allowed - `min` : The minimum percentage that's allowed
- `max` : The maximum percentage that's allowed - `max` : The maximum percentage that's allowed
- `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide] - `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide]
- `fromAbs` <small>(optional)</small> : A method to [determine the percentage based on a value in millimeter][fromabs] - `fromAbs` <small>(optional)</small> : A method to [determine the percentage based on a value in millimeter][fromabs]
- `toAbs` <small>(optional)</small> : A method to [return the option value in millimeter][toabs] - `toAbs` <small>(optional)</small> : A method to [return the option value in millimeter][toabs]
- `snap` <small>(optional)</small> : The configuration to control [snapping of percentage options][snap] - `snap` <small>(optional)</small> : The configuration to control [snapping of percentage options][snap]
[hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method [hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method

View file

@ -12,12 +12,12 @@ is found.
Your snapped percentage option should be a plain object with these properties: Your snapped percentage option should be a plain object with these properties:
- `pct` : The default percentage - `pct` : The default percentage
- `min` : The minimum percentage that's allowed - `min` : The minimum percentage that's allowed
- `max` : The maximum percentage that's allowed - `max` : The maximum percentage that's allowed
- `snap`: Holds the snap configuration (see [Snap configuration](#)) - `snap`: Holds the snap configuration (see [Snap configuration](#))
- `toAbs`: a method returning the **millimeter value** of the option ([see `toAbs()`][toabs]) - `toAbs`: a method returning the **millimeter value** of the option ([see `toAbs()`][toabs])
- `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide] - `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide]
## Snap configuration ## Snap configuration
@ -150,8 +150,8 @@ our solution does not scale.
We combine approaches A and B and configure a snapped percentage option We combine approaches A and B and configure a snapped percentage option
with: with:
- A percentage based on `waistToFloor` - A percentage based on `waistToFloor`
- Our list of standard elastic widths as _snaps_ - Our list of standard elastic widths as _snaps_
For typical humans, our options will _snap_ to the closest match in our For typical humans, our options will _snap_ to the closest match in our
list and behave just like Approach A (with a list option). list and behave just like Approach A (with a list option).
@ -165,19 +165,19 @@ Sweet!
Before we wade into the details, let's first agree on terminology: Before we wade into the details, let's first agree on terminology:
- The **percentage value** is the page passed by the user for the option. - The **percentage value** is the page passed by the user for the option.
Its value always represents a percentage. Its value always represents a percentage.
- The **millimeter value** is the result of feeding the **percentage value** to - The **millimeter value** is the result of feeding the **percentage value** to
the `toAbs()` method. Its value always represents millimeters. the `toAbs()` method. Its value always represents millimeters.
- The **snap values** are the values provided by the snap confguration. - The **snap values** are the values provided by the snap confguration.
Each of the values always represents millimeters. Each of the values always represents millimeters.
Under the hood, and snapped percentage option will: Under the hood, and snapped percentage option will:
- Use `toAbs()` to calculate the **millimeter value** from the **percentage value** - Use `toAbs()` to calculate the **millimeter value** from the **percentage value**
- See whether the **millimeter value** approaches one of the **snap values** - See whether the **millimeter value** approaches one of the **snap values**
- If so, use the snap value (in millimeter) as provided by one of the **snap values** - If so, use the snap value (in millimeter) as provided by one of the **snap values**
- If not, use the **millimeter value** as-is - If not, use the **millimeter value** as-is
If you're head's spinning, here's an image that will hopefully clarify things a bit: If you're head's spinning, here's an image that will hopefully clarify things a bit:
@ -200,12 +200,12 @@ snapping, just as it would in a normal percentage option.
This system results in the best of both worlds: This system results in the best of both worlds:
- Things like elastic widths and so on can be configured to be fixed values, - Things like elastic widths and so on can be configured to be fixed values,
of common elastic widths for example of common elastic widths for example
- The absolute value will still scale up and down, but will snap to the closest - The absolute value will still scale up and down, but will snap to the closest
fixed value when appropriate. fixed value when appropriate.
- When the input measurements go somewhere the designer did not anticipate, - When the input measurements go somewhere the designer did not anticipate,
the option will just behave as a regular percentage option the option will just behave as a regular percentage option
## Using snapped percentage options in your pattern code ## Using snapped percentage options in your pattern code

View file

@ -8,7 +8,7 @@ department: "menswear",
One of the following: One of the following:
- menswear - menswear
- womenswear - womenswear
- unisex - unisex
- accessories - accessories

View file

@ -8,5 +8,5 @@ type: "pattern",
One of the following: One of the following:
- pattern - pattern
- block - block

View file

@ -19,10 +19,10 @@ function freesewing.Design(
This constructor creates a new pattern design. This constructor creates a new pattern design.
It takes the following arguments: It takes the following arguments:
- `config` : The pattern configuration - `config` : The pattern configuration
- `plugins` : Either a [plugin object](/guides/plugins/), or an array of plugin objects - `plugins` : Either a [plugin object](/guides/plugins/), or an array of plugin objects
- `conditionalPlugins` : Either a [conditional plugin object](/guides/plugins/conditionally-loading-build-time-plugins/), or an array - `conditionalPlugins` : Either a [conditional plugin object](/guides/plugins/conditionally-loading-build-time-plugins/), or an array
of conditional plugin objects to (conditionally) load in your pattern of conditional plugin objects to (conditionally) load in your pattern
```js ```js
import freesewing from "@freesewing/core" import freesewing from "@freesewing/core"

View file

@ -25,7 +25,7 @@ please refer to our [pattern design tutorial](/tutorials/pattern-design/)
The `@freesewing/core` default export is a single object with the following properties: The `@freesewing/core` default export is a single object with the following properties:
- `Design`: The [Design constructor](/reference/api/design/) to create a new design - `Design`: The [Design constructor](/reference/api/design/) to create a new design
<Note> <Note>
@ -34,9 +34,9 @@ The other constructors and utilities below are exported to facilitate unit testi
</Note> </Note>
- `Path`: The [Path constructor](/reference/api/path) to create a new path - `Path`: The [Path constructor](/reference/api/path) to create a new path
- `Pattern`: The [Pattern constructor](/reference/api/pattern) to create a new pattern - `Pattern`: The [Pattern constructor](/reference/api/pattern) to create a new pattern
- `Point`: The [Point constructor](/reference/api/point) to create a new point - `Point`: The [Point constructor](/reference/api/point) to create a new point
- `Snippet`: The [Snippet constructor](/reference/api/snippet) to create a new snippet - `Snippet`: The [Snippet constructor](/reference/api/snippet) to create a new snippet
- `utils`: A collection of [utilities](/reference/api/utils) - `utils`: A collection of [utilities](/reference/api/utils)
- `version`: A string containing the `@freesewing/core` version number - `version`: A string containing the `@freesewing/core` version number

View file

@ -9,8 +9,8 @@ A **hook** is a lifecycle event.
You can register a method for a hook. When the hook is triggered, your method will be You can register a method for a hook. When the hook is triggered, your method will be
called. It will receive two parameters: called. It will receive two parameters:
- An object relevant to the hook (see the specific hook for details) - An object relevant to the hook (see the specific hook for details)
- Data passed when the hook was registered (optional) - Data passed when the hook was registered (optional)
Below is a list of all available hooks: Below is a list of all available hooks:

View file

@ -6,8 +6,8 @@ The `insertText` hook is called when text is about to be inserted during renderi
Methods attached to the `insertText` hook will receive 2 parameters: Methods attached to the `insertText` hook will receive 2 parameters:
- `locale` : The language code of the language requested by the user (defaults to `en`) - `locale` : The language code of the language requested by the user (defaults to `en`)
- `text`: The text to be inserted - `text`: The text to be inserted
Unlike most hooks that receive an object that you can make changes to, Unlike most hooks that receive an object that you can make changes to,
for this hook you need to return a string. for this hook you need to return a string.
@ -20,8 +20,8 @@ in [our i18n plugin](/reference/plugins/i18n/).
When we say that _this hook is called when text is about to be inserted_, that is a simplified view. When we say that _this hook is called when text is about to be inserted_, that is a simplified view.
In reality, this hook is called: In reality, this hook is called:
- For every value set on data-text - For every value set on data-text
- For the combined result of these values, joined together with spaces - For the combined result of these values, joined together with spaces
Let's use an example to clarify things: Let's use an example to clarify things:
@ -33,9 +33,9 @@ points.example
For the example point above, the `insertText` hook will end up being called 3 times: For the example point above, the `insertText` hook will end up being called 3 times:
- First it will pass `seamAllowance` to the plugin - First it will pass `seamAllowance` to the plugin
- Then it will pass `: 1cm` to the plugin - Then it will pass `: 1cm` to the plugin
- Finally it will pass `seamAllowance : 1cm` to the plugin - Finally it will pass `seamAllowance : 1cm` to the plugin
Having the `insertText` hook only run once with `Seam allowance: 1cm` would be problematic because Having the `insertText` hook only run once with `Seam allowance: 1cm` would be problematic because
the seam allowance may differ, or perhaps we're using imperial units, and so on. the seam allowance may differ, or perhaps we're using imperial units, and so on.

View file

@ -7,9 +7,9 @@ Your plugin will receive the Pattern object.
It is triggered just before the end of either: It is triggered just before the end of either:
- the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method - the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method
- the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method - the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method
- the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method - the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method
<Note> <Note>

View file

@ -6,9 +6,9 @@ The `preSample` hook runs just before your pattern is sampled.
It is triggered at the very start of either: It is triggered at the very start of either:
- the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method - the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method
- the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method - the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method
- the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method - the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method
Your plugin will receive the Pattern object. Your plugin will receive the Pattern object.

View file

@ -19,8 +19,8 @@ macro("flip", {
Under the hood, this macro will: Under the hood, this macro will:
- Go through all Points in your Part, and multiply their (X or Y)-coordinate by -1 - Go through all Points in your Part, and multiply their (X or Y)-coordinate by -1
- Go through all the Paths in your Part, and for each drawing operation will multiply the (X or Y)-coordinare by -1 - Go through all the Paths in your Part, and for each drawing operation will multiply the (X or Y)-coordinare by -1
- Go through all the Snippets in your Part and multiply the (X or Y)-coordinate of the anchor point by -1 - Go through all the Snippets in your Part and multiply the (X or Y)-coordinate of the anchor point by -1
</Note> </Note>

View file

@ -31,7 +31,7 @@ macro('hd', {
Setting a custom ID will: Setting a custom ID will:
- Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd) - Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd)
- Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/) - Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/)
</Note> </Note>

View file

@ -31,7 +31,7 @@ macro('ld', {
Setting a custom ID will: Setting a custom ID will:
- Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd) - Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd)
- Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/) - Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/)
</Note> </Note>

View file

@ -29,7 +29,7 @@ macro('pd', {
Setting a custom ID will: Setting a custom ID will:
- Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd) - Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd)
- Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/) - Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/)
</Note> </Note>

View file

@ -31,7 +31,7 @@ macro('vd', {
Setting a custom ID will: Setting a custom ID will:
- Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd) - Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd)
- Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/) - Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/)
</Note> </Note>

View file

@ -8,14 +8,14 @@ Point path.edge(string side)
Returns the Point object at the edge of the path you specify. Edge must be one of: Returns the Point object at the edge of the path you specify. Edge must be one of:
- `top` - `top`
- `bottom` - `bottom`
- `left` - `left`
- `right` - `right`
- `topLeft` - `topLeft`
- `topRight` - `topRight`
- `bottomLeft` - `bottomLeft`
- `bottomRight` - `bottomRight`
<Example part="path_edge"> <Example part="path_edge">
Example of the Path.edge() method Example of the Path.edge() method

View file

@ -13,8 +13,8 @@ Path new Path();
A Path objects comes with the following properties: A Path objects comes with the following properties:
- `render` : Set this to `false` to not render the path (exclude it from the output) - `render` : Set this to `false` to not render the path (exclude it from the output)
- `attributes` : An [Attributes](/reference/api/attributes) instance holding the path's attributes - `attributes` : An [Attributes](/reference/api/attributes) instance holding the path's attributes
In addition, a Path object exposes the following methods: In addition, a Path object exposes the following methods:

View file

@ -19,9 +19,9 @@ it on a long/complex path will be significant.
To limit the impact of path.trim(), follow this approach: To limit the impact of path.trim(), follow this approach:
- construct a minimal path that contains the overlap - construct a minimal path that contains the overlap
- trim it - trim it
- now join it to the rest of your path - now join it to the rest of your path
You can see an example of this You can see an example of this
[in the front part of the Bruce pattern](https://github.com/freesewing/freesewing/blob/develop/packages/bruce/src/front.js#L195). [in the front part of the Bruce pattern](https://github.com/freesewing/freesewing/blob/develop/packages/bruce/src/front.js#L195).

View file

@ -20,14 +20,14 @@ Refer to the [settings documentation](/reference/api/settings/) for an exhaustiv
## Pattern properties ## Pattern properties
- `settings` : The settings as set by the user - `settings` : The settings as set by the user
- `options` : the options as set by the user - `options` : the options as set by the user
- `config` : The pattern configuration - `config` : The pattern configuration
- `parts` : A plain object to hold your parts - `parts` : A plain object to hold your parts
- `Part` : The [Part](/reference/api/part) constructor - `Part` : The [Part](/reference/api/part) constructor
- `store` : A [Store](/reference/api/store) instance - `store` : A [Store](/reference/api/store) instance
- `svg` : An [Svg](/reference/api/svg) instance - `svg` : An [Svg](/reference/api/svg) instance
- `is` : A string that will be set to `draft` or `sample` when you respectively draft or sample a pattern. This allows plugins that hook into your pattern to determine what to do in a given scenario. - `is` : A string that will be set to `draft` or `sample` when you respectively draft or sample a pattern. This allows plugins that hook into your pattern to determine what to do in a given scenario.
## Pattern methods ## Pattern methods

View file

@ -16,16 +16,16 @@ object to determine what to do.
The possiblities are: The possiblities are:
- **type**: One of `option`, `measurement`, or `models` - **type**: One of `option`, `measurement`, or `models`
- **option**: An option name as defined in the pattern config file (only used when `type` is option). - **option**: An option name as defined in the pattern config file (only used when `type` is option).
- **measurement**: A measurement name as defined in the pattern config file (only used when `type` is measurement). - **measurement**: A measurement name as defined in the pattern config file (only used when `type` is measurement).
- **models**: An array of models with the required measurements for this pattern (only used when `type` is models). - **models**: An array of models with the required measurements for this pattern (only used when `type` is models).
See the specific sample methods below for more details: See the specific sample methods below for more details:
- [Pattern.sampleOption()](/reference/apu/pattern/sampleoption) - [Pattern.sampleOption()](/reference/apu/pattern/sampleoption)
- [Pattern.sampleMeasurement()](/reference/apu/pattern/sampleoption) - [Pattern.sampleMeasurement()](/reference/apu/pattern/sampleoption)
- [Pattern.sampleModels()](/reference/apu/pattern/sampleoption) - [Pattern.sampleModels()](/reference/apu/pattern/sampleoption)
From a lifecycle point of view, the `Pattern.sample()` method is a substitute for From a lifecycle point of view, the `Pattern.sample()` method is a substitute for
`Pattern.draft()`. So you call it after instantiating the pattern, prior to `Pattern.draft()`. So you call it after instantiating the pattern, prior to

View file

@ -7,9 +7,9 @@ which means to draft it in different iterations while adjusting the input value
of the given option. of the given option.
The practical implementation varies based on [the type of option](/config/options/): The practical implementation varies based on [the type of option](/config/options/):
- For options that are an object with a **min** and **max** property, 10 steps will be sampled, between min and max - For options that are an object with a **min** and **max** property, 10 steps will be sampled, between min and max
- For options that are a numeric value (**constants**), 10 steps will be sampled between 90% and 110% of the value - For options that are a numeric value (**constants**), 10 steps will be sampled between 90% and 110% of the value
- For options with a **list** of options, each option in the list will be sampled - For options with a **list** of options, each option in the list will be sampled
<Tip> <Tip>
The goal of option sampling is to verify the impact of an option on the pattern, and verify that The goal of option sampling is to verify the impact of an option on the pattern, and verify that

View file

@ -7,14 +7,14 @@ A Point object represents a point on a 2D plane with an X and Y axis.
Point objects come with the following properties: Point objects come with the following properties:
- `x` : The X-coordinate of the point - `x` : The X-coordinate of the point
- `y` : The Y-coordinate of the point - `y` : The Y-coordinate of the point
- `attributes` : An [Attributes](../attributes) instance holding the point's attributes - `attributes` : An [Attributes](../attributes) instance holding the point's attributes
The point constructor takes two arguments: The point constructor takes two arguments:
- `x` : The X-coordinate of the point - `x` : The X-coordinate of the point
- `y` : The Y-coordinate of the point - `y` : The Y-coordinate of the point
```js ```js
Point new Point(x, y); Point new Point(x, y);

View file

@ -12,8 +12,8 @@ Point point.translate(float deltaX, float deltaY)
In other words, this will: In other words, this will:
- Add `deltaX` to the point's X-coordinate - Add `deltaX` to the point's X-coordinate
- Add `deltaY` to the point's Y-coordinate - Add `deltaY` to the point's Y-coordinate
Positive values for `deltaX` will move the point to the right. Positive values for `deltaY` will move the point downwards. Positive values for `deltaX` will move the point to the right. Positive values for `deltaY` will move the point downwards.

View file

@ -5,9 +5,9 @@ title: layout
The `layout` setting allows you to control the way pattern parts are The `layout` setting allows you to control the way pattern parts are
layed out on the pattern. There are 3 scenarios: layed out on the pattern. There are 3 scenarios:
- layout is truthy: Do layout algorithmically - layout is truthy: Do layout algorithmically
- layout is falsy: Do not do any layout apart from stacking all parts together - layout is falsy: Do not do any layout apart from stacking all parts together
- layout is an object: Layout the parts as detailed in the layout object - layout is an object: Layout the parts as detailed in the layout object
Let's look at each in detail: Let's look at each in detail:
@ -57,10 +57,10 @@ let pattern = new brian({
For each part in the `parts` attribute of our layout object, there are 4 possible attributes: For each part in the `parts` attribute of our layout object, there are 4 possible attributes:
- move: Expects an object with an `x` and `y` property, and will move the part by `x` along the X-axis and by `y` along the Y-axis - move: Expects an object with an `x` and `y` property, and will move the part by `x` along the X-axis and by `y` along the Y-axis
- rotate: Expects a number, and will rotate the part by number degrees around its center point - rotate: Expects a number, and will rotate the part by number degrees around its center point
- flipX: Will flip/mirror the part horizontally - flipX: Will flip/mirror the part horizontally
- flipY: Will flip/mirror the part vertically - flipY: Will flip/mirror the part vertically
<Related> <Related>

View file

@ -7,8 +7,8 @@ Each part will have this margin applied. The default is `2mm`.
This means that: This means that:
- At the edge of the SVG, the margin will be `margin * 1` (2mm by default) - At the edge of the SVG, the margin will be `margin * 1` (2mm by default)
- Between parts, the margin will be `margin * 2` (4mm by default) - Between parts, the margin will be `margin * 2` (4mm by default)
Note that setting the margin to zero (or below) will cause parts to overlap. Note that setting the margin to zero (or below) will cause parts to overlap.

View file

@ -8,8 +8,8 @@ SVG `defs` section, and rendered with the SVG `use` tag.
The snippet constructor takes two arguments: The snippet constructor takes two arguments:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section - `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](#point) on which to anchor the snippet - `anchor` : A [`Point`](#point) on which to anchor the snippet
```js ```js
Snippet new Snippet(def, Point); Snippet new Snippet(def, Point);
@ -17,9 +17,9 @@ Snippet new Snippet(def, Point);
A Snippet object comes with the following properties: A Snippet object comes with the following properties:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section - `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](../point) on which to anchor the snippet - `anchor` : A [`Point`](../point) on which to anchor the snippet
- `attributes` : An [`Attributes`](../attributes) instance holding the snippet's attributes - `attributes` : An [`Attributes`](../attributes) instance holding the snippet's attributes
In addition, a Snippet object exposes the following methods: In addition, a Snippet object exposes the following methods:

View file

@ -19,8 +19,8 @@ An example of the buttonhole-end snippet
We provide three buttonhole snippets with a different alignment: We provide three buttonhole snippets with a different alignment:
- [buttonhole](/reference/snippets/buttonhole/): Anchor point is the middle of the buttonhole - [buttonhole](/reference/snippets/buttonhole/): Anchor point is the middle of the buttonhole
- [buttonhole-start](/reference/snippets/buttonhole-start/): Anchor point is the start of the buttonhole - [buttonhole-start](/reference/snippets/buttonhole-start/): Anchor point is the start of the buttonhole
- [buttonhole-end](/reference/snippets/buttonhole-end/): Anchor point is the end of the buttonhole - [buttonhole-end](/reference/snippets/buttonhole-end/): Anchor point is the end of the buttonhole
</Note> </Note>

View file

@ -19,8 +19,8 @@ An example of the buttonhole-start snippet
We provide three buttonhole snippets with a different alignment: We provide three buttonhole snippets with a different alignment:
- [buttonhole](/reference/snippets/buttonhole/): Anchor point is the middle of the buttonhole - [buttonhole](/reference/snippets/buttonhole/): Anchor point is the middle of the buttonhole
- [buttonhole-start](/reference/snippets/buttonhole-start/): Anchor point is the start of the buttonhole - [buttonhole-start](/reference/snippets/buttonhole-start/): Anchor point is the start of the buttonhole
- [buttonhole-end](/reference/snippets/buttonhole-end/): Anchor point is the end of the buttonhole - [buttonhole-end](/reference/snippets/buttonhole-end/): Anchor point is the end of the buttonhole
</Note> </Note>

View file

@ -19,8 +19,8 @@ An example of the buttonhole snippet
We provide three buttonhole snippets with a different alignment: We provide three buttonhole snippets with a different alignment:
- [buttonhole](/reference/snippets/buttonhole/): Anchor point is the middle of the buttonhole - [buttonhole](/reference/snippets/buttonhole/): Anchor point is the middle of the buttonhole
- [buttonhole-start](/reference/snippets/buttonhole-start/): Anchor point is the start of the buttonhole - [buttonhole-start](/reference/snippets/buttonhole-start/): Anchor point is the start of the buttonhole
- [buttonhole-end](/reference/snippets/buttonhole-end/): Anchor point is the end of the buttonhole - [buttonhole-end](/reference/snippets/buttonhole-end/): Anchor point is the end of the buttonhole
</Note> </Note>

View file

@ -21,8 +21,8 @@ they are ordered in the returned array:
Set sort to: Set sort to:
- `x` : The point with the lowest X-coordinate will go first (left to right) - `x` : The point with the lowest X-coordinate will go first (left to right)
- `y` : The point with the lowest Y-coordinate will go first (top to bottom) - `y` : The point with the lowest Y-coordinate will go first (top to bottom)
<Example part="utils_beamintersectscircle"> <Example part="utils_beamintersectscircle">
A Utils.beamIntersectsCircle() example A Utils.beamIntersectsCircle() example

View file

@ -19,8 +19,8 @@ When this returns 2 intersections, you can choose how they are ordered in the re
Set sort to: Set sort to:
- `x` : The point with the lowest X-coordinate will go first (left to right) - `x` : The point with the lowest X-coordinate will go first (left to right)
- `y` : The point with the lowest Y-coordinate will go first (top to bottom) - `y` : The point with the lowest Y-coordinate will go first (top to bottom)
<Example part="utils_circlesintersect"> <Example part="utils_circlesintersect">
A Utils.circlesIntersect() example A Utils.circlesIntersect() example

View file

@ -20,8 +20,8 @@ When this returns 2 intersections, you can choose how they are ordered in the re
Set sort to: Set sort to:
- `x` : The point with the lowest X-coordinate will go first (left to right) - `x` : The point with the lowest X-coordinate will go first (left to right)
- `y` : The point with the lowest Y-coordinate will go first (top to bottom) - `y` : The point with the lowest Y-coordinate will go first (top to bottom)
<Example part="utils_lineintersectscircle"> <Example part="utils_lineintersectscircle">
A Utils.lineIntersectsCircle() example A Utils.lineIntersectsCircle() example

View file

@ -8,5 +8,5 @@ float utils.round(float value)
Rounds a value to two decimals. For example: Rounds a value to two decimals. For example:
- 0.1234 becomes 0.12 - 0.1234 becomes 0.12
- 5.6789 becomes 5.68 - 5.6789 becomes 5.68

View file

@ -5,55 +5,55 @@ title: Measurements
Below is the complete list of measurements currently used by Below is the complete list of measurements currently used by
the designs we maintain: the designs we maintain:
- `ankle` - `ankle`
- `biceps` - `biceps`
- `bustFront` - `bustFront`
- `bustPointToUnderbust` - `bustPointToUnderbust`
- `bustSpan` - `bustSpan`
- `chest` - `chest`
- `crossSeam` - `crossSeam`
- `crossSeamFront` - `crossSeamFront`
- `crotchDepth` - `crotchDepth`
- `head` - `head`
- `heel` - `heel`
- `highBust` - `highBust`
- `highBustFront` - `highBustFront`
- `hips` - `hips`
- `hpsToBust` - `hpsToBust`
- `hpsToWaistBack` - `hpsToWaistBack`
- `hpsToWaistFront` - `hpsToWaistFront`
- `inseam` - `inseam`
- `knee` - `knee`
- `neck` - `neck`
- `seat` - `seat`
- `seatBack` - `seatBack`
- `shoulderSlope` - `shoulderSlope`
- `shoulderToElbow` - `shoulderToElbow`
- `shoulderToShoulder` - `shoulderToShoulder`
- `shoulderToWrist` - `shoulderToWrist`
- `underbust` - `underbust`
- `upperLeg` - `upperLeg`
- `waist` - `waist`
- `waistBack` - `waistBack`
- `waistToFloor` - `waistToFloor`
- `waistToHips` - `waistToHips`
- `waistToKnee` - `waistToKnee`
- `waistToSeat` - `waistToSeat`
- `waistToUnderbust` - `waistToUnderbust`
- `waistToUpperLeg` - `waistToUpperLeg`
- `wrist` - `wrist`
In addition, the [@freesewing/plugin-measurements](/reference/plugins/measurements) plugin In addition, the [@freesewing/plugin-measurements](/reference/plugins/measurements) plugin
will add the following measurements when the measurements they are derived will add the following measurements when the measurements they are derived
from are provided: from are provided:
- `seatFront` (if both `seat` and `seatBack` are provided) - `seatFront` (if both `seat` and `seatBack` are provided)
- `seatBackArc` (if both `seat` and `seatBack` are provided) - `seatBackArc` (if both `seat` and `seatBack` are provided)
- `seatFrontArc` (if both `seat` and `seatBack` are provided) - `seatFrontArc` (if both `seat` and `seatBack` are provided)
- `waistFront` (if both `waist` and `waistBack` are provided) - `waistFront` (if both `waist` and `waistBack` are provided)
- `waistBackArc` (if both `waist` and `waistBack` are provided) - `waistBackArc` (if both `waist` and `waistBack` are provided)
- `waistFrontArc` (if both `waist` and `waistBack` are provided) - `waistFrontArc` (if both `waist` and `waistBack` are provided)
- `crossSeamBack` (if both `crossSeam` and `crossSeamFront` are available) - `crossSeamBack` (if both `crossSeam` and `crossSeamFront` are available)
<Tip> <Tip>

View file

@ -4,14 +4,14 @@ title: "@freesewing/plugin-bundle"
The **@freesewing/plugin-bundle** plugin bundles the most common FreeSewing build-time plugins: The **@freesewing/plugin-bundle** plugin bundles the most common FreeSewing build-time plugins:
- [plugin-cutonfold](/reference/plugins/cutonfold) : Add cut-on-fold indicators to your patterns - [plugin-cutonfold](/reference/plugins/cutonfold) : Add cut-on-fold indicators to your patterns
- [plugin-dimension](/reference/plugins/dimension) : Add dimensions to your (paperless) patterns - [plugin-dimension](/reference/plugins/dimension) : Add dimensions to your (paperless) patterns
- [plugin-grainline](/reference/plugins/grainline) : Add grainline indicators to your patterns - [plugin-grainline](/reference/plugins/grainline) : Add grainline indicators to your patterns
- [plugin-logo](/reference/plugins/logo) : Add a scalebox to your patterns - [plugin-logo](/reference/plugins/logo) : Add a scalebox to your patterns
- [plugin-scalebox](/reference/plugins/scalebox) : Add pretty titles to your pattern parts - [plugin-scalebox](/reference/plugins/scalebox) : Add pretty titles to your pattern parts
- [plugin-title](/reference/plugins/title) : Add pretty titles to your pattern parts - [plugin-title](/reference/plugins/title) : Add pretty titles to your pattern parts
- [plugin-round](/reference/plugins/round) : Rounds corners - [plugin-round](/reference/plugins/round) : Rounds corners
- [plugin-sprinkle](/reference/plugins/sprinkle) : Add multiple snippets to your pattern - [plugin-sprinkle](/reference/plugins/sprinkle) : Add multiple snippets to your pattern
Almost all patterns use these plugins, so it made sense to bundle them. Almost all patterns use these plugins, so it made sense to bundle them.

View file

@ -20,8 +20,8 @@ This is the same technique that's used in a full-bust adjustment to fit a womens
This plugin helps you by: This plugin helps you by:
- Storing the chest circumference in `measurements.bust` - Storing the chest circumference in `measurements.bust`
- Changing `measurments.chestCircumference` to the value of `measurements.highBust` - Changing `measurments.chestCircumference` to the value of `measurements.highBust`
</Note> </Note>
@ -47,8 +47,8 @@ To learn more about extending a pattern, see [Design inheritance](/howtos/code/i
To create a truly gender-neutral pattern — one that will adapt to breasts only if they are To create a truly gender-neutral pattern — one that will adapt to breasts only if they are
present — you can use this plugin, but you'll also need a few other things: present — you can use this plugin, but you'll also need a few other things:
- You'll need to mark the breast measurements as [optional measurements](/reference/api/config/optionalmeasurements) - You'll need to mark the breast measurements as [optional measurements](/reference/api/config/optionalmeasurements)
- You'll need to [conditionally load this plugin](/guides/plugins/conditionally-loading-build-time-plugins) - You'll need to [conditionally load this plugin](/guides/plugins/conditionally-loading-build-time-plugins)
You can see an example of this in [our Teagan design][3]. You can see an example of this in [our Teagan design][3].

View file

@ -4,12 +4,12 @@ title: "@freesewing/plugin-buttons"
The **@freesewing/plugin-buttons** plugin provides the following [snippets](/reference/api/snippets): The **@freesewing/plugin-buttons** plugin provides the following [snippets](/reference/api/snippets):
- [button](/reference/api/snippets/button) - [button](/reference/api/snippets/button)
- [buttonhole](/reference/api/snippets/buttonhole) - [buttonhole](/reference/api/snippets/buttonhole)
- [buttonhole-start](/reference/api/snippets/buttonhole-start) - [buttonhole-start](/reference/api/snippets/buttonhole-start)
- [buttonhole-end](/reference/api/snippets/buttonhole-end) - [buttonhole-end](/reference/api/snippets/buttonhole-end)
- [snap-stud](/reference/api/snippets/snap-stud) - [snap-stud](/reference/api/snippets/snap-stud)
- [snap-socket](/reference/api/snippets/snap-socket) - [snap-socket](/reference/api/snippets/snap-socket)
<Example part="plugin_buttons"> <Example part="plugin_buttons">
An example of the button, buttonhole, buttonhole-start, buttonhole-end, snap-stud, and snap-socket snippets An example of the button, buttonhole, buttonhole-start, buttonhole-end, snap-stud, and snap-socket snippets

View file

@ -9,12 +9,12 @@ in [paperless mode](/reference/api/settings/paperless).
The following macors are provided by this plugin: The following macors are provided by this plugin:
- [hd](/reference/api/macros/hd) : Adds a horizontal dimension - [hd](/reference/api/macros/hd) : Adds a horizontal dimension
- [vd](/reference/api/macros/vd) : Adds a vertical dimension - [vd](/reference/api/macros/vd) : Adds a vertical dimension
- [ld](/reference/api/macros/ld) : Adds a linear dimension - [ld](/reference/api/macros/ld) : Adds a linear dimension
- [pd](/reference/api/macros/pd) : Adds a dimension along a path - [pd](/reference/api/macros/pd) : Adds a dimension along a path
- [rmd](/reference/api/macros/rmd) : Removes a dimension - [rmd](/reference/api/macros/rmd) : Removes a dimension
- [rmad](/reference/api/macros/rmad) : Removes all dimensions with a default prefix - [rmad](/reference/api/macros/rmad) : Removes all dimensions with a default prefix
<Example part="plugin_dimension"> <Example part="plugin_dimension">

View file

@ -9,13 +9,13 @@ they can be deduced from the measurements that are provided.
It will add the following measurements: It will add the following measurements:
- `seatFront` (if both `seat` and `seatBack` are provided) - `seatFront` (if both `seat` and `seatBack` are provided)
- `seatBackArc` (if both `seat` and `seatBack` are provided) - `seatBackArc` (if both `seat` and `seatBack` are provided)
- `seatFrontArc` (if both `seat` and `seatBack` are provided) - `seatFrontArc` (if both `seat` and `seatBack` are provided)
- `waistFront` (if both `waist` and `waistBack` are provided) - `waistFront` (if both `waist` and `waistBack` are provided)
- `waistBackArc` (if both `waist` and `waistBack` are provided) - `waistBackArc` (if both `waist` and `waistBack` are provided)
- `waistFrontArc` (if both `waist` and `waistBack` are provided) - `waistFrontArc` (if both `waist` and `waistBack` are provided)
- `crossSeamBack` (if both `crossSeam` and `crossSeamFront` are available) - `crossSeamBack` (if both `crossSeam` and `crossSeamFront` are available)
## Installation ## Installation

View file

@ -4,8 +4,8 @@ title: "@freesewing/plugin-notches"
The **@freesewing/plugin-notces** plugin provides the following [snippets](/reference/api/snippets): The **@freesewing/plugin-notces** plugin provides the following [snippets](/reference/api/snippets):
- [notch](/reference/api/snippets/notch) - [notch](/reference/api/snippets/notch)
- [bnotch](/reference/api/snippets/bnotch) - [bnotch](/reference/api/snippets/bnotch)
<Example part="plugin_notches"> <Example part="plugin_notches">
An example of the button, buttonhole, buttonhole-start, buttonhole-end, snap-stud, and snap-socket snippets An example of the button, buttonhole, buttonhole-start, buttonhole-end, snap-stud, and snap-socket snippets

View file

@ -17,14 +17,14 @@ You can change all of these later. It's just to get you started.
If you're not sure what to fill in, you can stick with the defaults or leave them blank. If you're not sure what to fill in, you can stick with the defaults or leave them blank.
Only a few of these are mandatory. Only a few of these are mandatory.
- **Language**: Use the arrow keys to chose the language of your choice - **Language**: Use the arrow keys to chose the language of your choice
- **Pattern name**: This will be the name of your pattern, but also the name of the folder we'll setup for you. If you're just kicking the tires, something like `test` will do you fine. - **Pattern name**: This will be the name of your pattern, but also the name of the folder we'll setup for you. If you're just kicking the tires, something like `test` will do you fine.
- **description**: A description of your pattern. It's not mandatory. - **description**: A description of your pattern. It's not mandatory.
- **Pattern type**: Use the arrow keys to chose either `block` or `pattern`. Choose `pattern` if you're not sure what to pick - **Pattern type**: Use the arrow keys to chose either `block` or `pattern`. Choose `pattern` if you're not sure what to pick
- **department**: Use the arrow keys to pick a department like `tops`, `bottoms` or `accessories`. This is is only relevant if you decide to publish your pattern later. But by that time you will have learned how to change this. - **department**: Use the arrow keys to pick a department like `tops`, `bottoms` or `accessories`. This is is only relevant if you decide to publish your pattern later. But by that time you will have learned how to change this.
- **Author**: You can enter your name, or leave this blank for now - **Author**: You can enter your name, or leave this blank for now
- **GitHub repository**: You can leave this blank for now - **GitHub repository**: You can leave this blank for now
- **Package manager**: Choose either `npm` or `yarn` as your package manager. If you're not sure, pick `npm`. - **Package manager**: Choose either `npm` or `yarn` as your package manager. If you're not sure, pick `npm`.
When you've answered all questions, the command will download the development enviroment, When you've answered all questions, the command will download the development enviroment,
and set it up based on the choices you made. and set it up based on the choices you made.

View file

@ -11,8 +11,8 @@ use [nvm](https://github.com/nvm-sh/nvm), short for _Node version manager_.
Using nvm has a number of benefits in comparison with installing Node from Using nvm has a number of benefits in comparison with installing Node from
the node.js website, or from a package provided by your linux distribution: the node.js website, or from a package provided by your linux distribution:
- You can easily switch between different Node versions - You can easily switch between different Node versions
- Everything gets installed in your home folder, avoiding permission problems - Everything gets installed in your home folder, avoiding permission problems
To setup nvm, run the following command in a terminal: To setup nvm, run the following command in a terminal:

View file

@ -8,9 +8,9 @@ If you chose `test`, you will have a `test` folder. If you chose `banana`, you'l
If you enter that folder, you'll find a couple of subfolders: If you enter that folder, you'll find a couple of subfolders:
- `config` holds your pattern's configuration file - `config` holds your pattern's configuration file
- `src` holds your pattern's source code - `src` holds your pattern's source code
- `example` holds the development environment - `example` holds the development environment
To start the development environment, enter the `example` folder and run: `npm run start` (or `yarn start` if you're using Yarn as a package manager. To start the development environment, enter the `example` folder and run: `npm run start` (or `yarn start` if you're using Yarn as a package manager.
@ -24,6 +24,6 @@ the pattern's source code. When you do, it will update automatically in your bro
All you have to do now, is design your pattern. All you have to do now, is design your pattern.
Thankfully, we have a tutorial for that too: Thankfully, we have a tutorial for that too:
- [Pattern design tutorial](/tutorials/pattern-design/): A step-by-step guide to designing your first pattern - [Pattern design tutorial](/tutorials/pattern-design/): A step-by-step guide to designing your first pattern
</Note> </Note>

View file

@ -17,14 +17,14 @@ You can change all of these later. It's just to get you started.
If you're not sure what to fill in, you can stick with the defaults or leave them blank. If you're not sure what to fill in, you can stick with the defaults or leave them blank.
Only a few of these are mandatory. Only a few of these are mandatory.
- **Language**: Use the arrow keys to chose the language of your choice - **Language**: Use the arrow keys to chose the language of your choice
- **Pattern name**: This will be the name of your pattern, but also the name of the folder we'll setup for you. If you're just kicking the tires, something like `test` will do you fine. - **Pattern name**: This will be the name of your pattern, but also the name of the folder we'll setup for you. If you're just kicking the tires, something like `test` will do you fine.
- **description**: A description of your pattern. It's not mandatory. - **description**: A description of your pattern. It's not mandatory.
- **Pattern type**: Use the arrow keys to chose either `block` or `pattern`. Choose `pattern` if you're not sure what to pick - **Pattern type**: Use the arrow keys to chose either `block` or `pattern`. Choose `pattern` if you're not sure what to pick
- **department**: Use the arrow keys to pick a department like `tops`, `bottoms` or `accessories`. This is is only relevant if you decide to publish your pattern later. But by that time you will have learned how to change this. - **department**: Use the arrow keys to pick a department like `tops`, `bottoms` or `accessories`. This is is only relevant if you decide to publish your pattern later. But by that time you will have learned how to change this.
- **Author**: You can enter your name, or leave this blank for now - **Author**: You can enter your name, or leave this blank for now
- **GitHub repository**: You can leave this blank for now - **GitHub repository**: You can leave this blank for now
- **Package manager**: Choose either `npm` or `yarn` as your package manager. If you're not sure, pick `npm`. - **Package manager**: Choose either `npm` or `yarn` as your package manager. If you're not sure, pick `npm`.
When you've answered all questions, the command will download the development enviroment, When you've answered all questions, the command will download the development enviroment,
and set it up based on the choices you made. and set it up based on the choices you made.

View file

@ -11,8 +11,8 @@ use [nvm](https://github.com/nvm-sh/nvm), short for _Node version manager_.
Using nvm has a number of benefits in comparison with installing Node from Using nvm has a number of benefits in comparison with installing Node from
the node.js website, or from a package provided by Homebrew or your OS distribution: the node.js website, or from a package provided by Homebrew or your OS distribution:
- You can easily switch between different Node versions - You can easily switch between different Node versions
- Everything gets installed in your home folder, avoiding permission problems - Everything gets installed in your home folder, avoiding permission problems
The latest instructions for setting up nvm can be found [here](https://github.com/nvm-sh/nvm#installing-and-updating). If you want to just skip to the commands that most likely work, keep reading. The latest instructions for setting up nvm can be found [here](https://github.com/nvm-sh/nvm#installing-and-updating). If you want to just skip to the commands that most likely work, keep reading.

View file

@ -8,9 +8,9 @@ If you chose `test`, you will have a `test` folder. If you chose `banana`, you'l
If you enter that folder, you'll find a couple of subfolders: If you enter that folder, you'll find a couple of subfolders:
- `config` holds your pattern's configuration file - `config` holds your pattern's configuration file
- `src` holds your pattern's source code - `src` holds your pattern's source code
- `example` holds the development environment - `example` holds the development environment
To start the development environment, enter the `example` folder and run: `npm run start` (or `yarn start` if you're using Yarn as a package manager. To start the development environment, enter the `example` folder and run: `npm run start` (or `yarn start` if you're using Yarn as a package manager.
@ -24,6 +24,6 @@ the pattern's source code. When you do, it will update automatically in your bro
All you have to do now, is design your pattern. All you have to do now, is design your pattern.
Thankfully, we have a tutorial for that too: Thankfully, we have a tutorial for that too:
- [Pattern design tutorial](/tutorials/pattern-design/): A step-by-step guide to designing your first pattern - [Pattern design tutorial](/tutorials/pattern-design/): A step-by-step guide to designing your first pattern
</Note> </Note>

View file

@ -83,14 +83,14 @@ If you've chosen to use VSCode as your IDE open VSCode, and inside VSCode open t
This script will prompt you for certain options. Only "Pattern name" is mandatory, the other prompts are optional and/or suggest sensible defaults. You can change all of these later. It's just to get you started. If you're not sure what to fill in you can stick with the defaults or leave them blank. This script will prompt you for certain options. Only "Pattern name" is mandatory, the other prompts are optional and/or suggest sensible defaults. You can change all of these later. It's just to get you started. If you're not sure what to fill in you can stick with the defaults or leave them blank.
- **Language**: Use the arrow keys to chose the language of your choice - **Language**: Use the arrow keys to chose the language of your choice
- **Pattern name**: This will be the name of your pattern, but also the name of the folder we'll setup for you. If you're just kicking the tires, something like `test` will do you fine. - **Pattern name**: This will be the name of your pattern, but also the name of the folder we'll setup for you. If you're just kicking the tires, something like `test` will do you fine.
- **description**: A description of your pattern. It's not mandatory. - **description**: A description of your pattern. It's not mandatory.
- **Pattern type**: Use the arrow keys to chose either `block` or `pattern`. Choose `pattern` if you're not sure what to pick. - **Pattern type**: Use the arrow keys to chose either `block` or `pattern`. Choose `pattern` if you're not sure what to pick.
- **department**: Use the arrow keys to pick a department like `menswear`, `womenswear` or `accessories`. This is is only relevant if you decide to publish your pattern later. But by that time you will have learned how to change this. - **department**: Use the arrow keys to pick a department like `menswear`, `womenswear` or `accessories`. This is is only relevant if you decide to publish your pattern later. But by that time you will have learned how to change this.
- **Author**: You can enter your name, or leave this blank for now. - **Author**: You can enter your name, or leave this blank for now.
- **GitHub repository**: You can leave this blank for now. - **GitHub repository**: You can leave this blank for now.
- **Package manager**: Choose either `npm` or `yarn` as your package manager. If you're not sure, pick `npm`. - **Package manager**: Choose either `npm` or `yarn` as your package manager. If you're not sure, pick `npm`.
### Start the development environment (WSL) ### Start the development environment (WSL)
@ -124,14 +124,14 @@ Open a terminal, then navigate to the folder you wish to contain the pattern (e.
This script will prompt you for certain options. Only "Pattern name" is mandatory, the other prompts are optional and/or suggest sensible defaults. You can change all of these later. It's just to get you started. If you're not sure what to fill in you can stick with the defaults or leave them blank. This script will prompt you for certain options. Only "Pattern name" is mandatory, the other prompts are optional and/or suggest sensible defaults. You can change all of these later. It's just to get you started. If you're not sure what to fill in you can stick with the defaults or leave them blank.
- **Language**: Use the arrow keys to chose the language of your choice - **Language**: Use the arrow keys to chose the language of your choice
- **Pattern name**: This will be the name of your pattern, but also the name of the folder we'll setup for you. If you're just kicking the tires, something like `test` will do you fine. - **Pattern name**: This will be the name of your pattern, but also the name of the folder we'll setup for you. If you're just kicking the tires, something like `test` will do you fine.
- **description**: A description of your pattern. It's not mandatory. - **description**: A description of your pattern. It's not mandatory.
- **Pattern type**: Use the arrow keys to chose either `block` or `pattern`. Choose `pattern` if you're not sure what to pick. - **Pattern type**: Use the arrow keys to chose either `block` or `pattern`. Choose `pattern` if you're not sure what to pick.
- **department**: Use the arrow keys to pick a department like `tops`, `bottoms` or `accessories`. This is is only relevant if you decide to publish your pattern later. But by that time you will have learned how to change this. - **department**: Use the arrow keys to pick a department like `tops`, `bottoms` or `accessories`. This is is only relevant if you decide to publish your pattern later. But by that time you will have learned how to change this.
- **Author**: You can enter your name, or leave this blank for now. - **Author**: You can enter your name, or leave this blank for now.
- **GitHub repository**: You can leave this blank for now. - **GitHub repository**: You can leave this blank for now.
- **Package manager**: Choose either `npm` or `yarn` as your package manager. If you're not sure, pick `npm`. - **Package manager**: Choose either `npm` or `yarn` as your package manager. If you're not sure, pick `npm`.
### Start the development environment ### Start the development environment

View file

@ -6,9 +6,9 @@ order: 140
You know what your bib should look like, and you have the _head_ measurement You know what your bib should look like, and you have the _head_ measurement
to work with. But there's still a number of choices you have to make: to work with. But there's still a number of choices you have to make:
- How large should the neck opening be? - How large should the neck opening be?
- How wide should the bib be? - How wide should the bib be?
- How long should the bib be? - How long should the bib be?
You can make all of these choices for the user and set them in stone, so to speak. You can make all of these choices for the user and set them in stone, so to speak.
@ -33,10 +33,10 @@ Open the config file at `config/index.js` and add this to the options:
Can you guess what it means? Can you guess what it means?
- We've added a option of type percentage - We've added a option of type percentage
- Its minimum value is 70% - Its minimum value is 70%
- Its maximum value is 90% - Its maximum value is 90%
- Its default value is 80% - Its default value is 80%
<Note> <Note>
@ -55,9 +55,9 @@ options: {
} }
``` ```
- You've added `widthRatio` and `lengthRatio` options - You've added `widthRatio` and `lengthRatio` options
- You've given all options sensible defaults - You've given all options sensible defaults
- You've given all options sensible maximum and minimum boundaries - You've given all options sensible maximum and minimum boundaries
<Note> <Note>

View file

@ -6,26 +6,26 @@ order: 280
Congratulations, you have created your first pattern. And while it's arguably rather simple, Congratulations, you have created your first pattern. And while it's arguably rather simple,
you have learned a bunch of things along the way. Let's list some of the things you've learned: you have learned a bunch of things along the way. Let's list some of the things you've learned:
- You learned how to [setup your development environment](/tutorials/pattern-design/create-freesewing-pattern) with `npx create-freesewing-pattern` - You learned how to [setup your development environment](/tutorials/pattern-design/create-freesewing-pattern) with `npx create-freesewing-pattern`
- You learned how to [add parts](/tutorials/pattern-design/your-first-part), [measurements](/tutorials/pattern-design/adding-measurements), and [options](/tutorials/pattern-design/adding-options) to your pattern's configuration file - You learned how to [add parts](/tutorials/pattern-design/your-first-part), [measurements](/tutorials/pattern-design/adding-measurements), and [options](/tutorials/pattern-design/adding-options) to your pattern's configuration file
- You learned what [a good boilerplate is to start with a new part](/tutorials/pattern-design/part-structure) - You learned what [a good boilerplate is to start with a new part](/tutorials/pattern-design/part-structure)
- You learned [how to add points and draw paths](/tutorials/pattern-design/constructing-the-neck-opening) - You learned [how to add points and draw paths](/tutorials/pattern-design/constructing-the-neck-opening)
- You learned how you can make changes in a loop to [adapt the neck opening](/tutorials/pattern-design/fitting-the-neck-opening) or [rotate the straps](/tutorials/pattern-design/avoiding-overlap) until they were just right - You learned how you can make changes in a loop to [adapt the neck opening](/tutorials/pattern-design/fitting-the-neck-opening) or [rotate the straps](/tutorials/pattern-design/avoiding-overlap) until they were just right
- You learned about [macros and how to use them](/tutorials/pattern-design/creating-the-closure) - You learned about [macros and how to use them](/tutorials/pattern-design/creating-the-closure)
- You learned different methods to manipulate [points](/reference/api/point/) and [paths](/reference/api/path/) - You learned different methods to manipulate [points](/reference/api/point/) and [paths](/reference/api/path/)
- You learned about using [attributes](/reference/api/attributes/) to influence the appearance of points and paths - You learned about using [attributes](/reference/api/attributes/) to influence the appearance of points and paths
- You learned about what it means to draft [a complete pattern](/tutorials/pattern-design/completing-your-pattern) - You learned about what it means to draft [a complete pattern](/tutorials/pattern-design/completing-your-pattern)
- You learned about [snippets and how to add them](/tutorials/pattern-design/completing-your-pattern#adding-snippets) - You learned about [snippets and how to add them](/tutorials/pattern-design/completing-your-pattern#adding-snippets)
- You learned [how to offset a path](/tutorials/pattern-design/completing-your-pattern#seam-allowance) to create seam allowance, or in our case, mark the bias tape line - You learned [how to offset a path](/tutorials/pattern-design/completing-your-pattern#seam-allowance) to create seam allowance, or in our case, mark the bias tape line
- You learned how to create a [paperless pattern](/tutorials/pattern-design/paperless-bib) by adding dimensions - You learned how to create a [paperless pattern](/tutorials/pattern-design/paperless-bib) by adding dimensions
You can find the complete code of the tutorial pattern [here on GitHub](https://github.com/freesewing/freesewing/blob/develop/packages/tutorial/src/bib.js). You can find the complete code of the tutorial pattern [here on GitHub](https://github.com/freesewing/freesewing/blob/develop/packages/tutorial/src/bib.js).
## More reading material ## More reading material
- If you haven't done so already, read through [the pattern guide](/guides/patterns/) which provides a good overview of how patterns work under the hood - If you haven't done so already, read through [the pattern guide](/guides/patterns/) which provides a good overview of how patterns work under the hood
- Bookmark [the FreeSewing API docs](/reference/api/), they are your reference every time you're not entirely certain how something works - Bookmark [the FreeSewing API docs](/reference/api/), they are your reference every time you're not entirely certain how something works
- Have a look at [the design guide](/guides/best-practices/) for best practices that will help you make the best possible patterns - Have a look at [the design guide](/guides/best-practices/) for best practices that will help you make the best possible patterns
## What to do next ## What to do next

View file

@ -50,10 +50,10 @@ You've added some points to your part, and drawn your first path. Let's look at
points.right = new Point(measurements.head / 10, 0) points.right = new Point(measurements.head / 10, 0)
``` ```
- We're adding a point named `right` to `points` which holds our part's points - We're adding a point named `right` to `points` which holds our part's points
- We're using the Point constructor, which takes two arguments: The point's X and Y values - We're using the Point constructor, which takes two arguments: The point's X and Y values
- The X value is `measurements.head / 10` - The X value is `measurements.head / 10`
- The Y value is `0` - The Y value is `0`
The `bottom` part is very similar, so let's skip to the next line: The `bottom` part is very similar, so let's skip to the next line:
@ -62,12 +62,12 @@ points.rightCp1 = points.right
.shift(90, points.bottom.dy(points.right)/2) .shift(90, points.bottom.dy(points.right)/2)
``` ```
- We're adding a point named `rightCp1`, which will become the _control point_ of the right part - We're adding a point named `rightCp1`, which will become the _control point_ of the right part
- Instead of using the Point constructor, we're calling the `Point.shift()` method on an existing point - Instead of using the Point constructor, we're calling the `Point.shift()` method on an existing point
- It takes two arguments: The angle to shift towards, and the distance - It takes two arguments: The angle to shift towards, and the distance
- You can see that we're shifting 90 degrees (that means up) but the distance uses another method - You can see that we're shifting 90 degrees (that means up) but the distance uses another method
- The `Point.dy()` method returns the delta along the Y axis between the point you call it on and the point you pass it - The `Point.dy()` method returns the delta along the Y axis between the point you call it on and the point you pass it
- We shift half of the Y-delta - We shift half of the Y-delta
The next point is very similar again, except that this time we're shifting to the right (0 degrees) for half of The next point is very similar again, except that this time we're shifting to the right (0 degrees) for half of
the X-delta between points `bottom` and `right`. the X-delta between points `bottom` and `right`.
@ -87,10 +87,10 @@ paths.quarterNeck = new Path()
.curve(points.rightCp1, points.bottomCp2, points.bottom) .curve(points.rightCp1, points.bottomCp2, points.bottom)
``` ```
- We're adding a path named `quarterNeck` to `paths` which holds our part's paths - We're adding a path named `quarterNeck` to `paths` which holds our part's paths
- We're using the Path constructor, which takes no arguments - We're using the Path constructor, which takes no arguments
- We're following up with a `Path.move()` call that takes one Point as argument - We're following up with a `Path.move()` call that takes one Point as argument
- Then, there's a `Path.curve()` call that takes 3 points as arguments - Then, there's a `Path.curve()` call that takes 3 points as arguments
If you've read through the high-level [Pattern guide](/guides/patterns/) you will have learned that paths If you've read through the high-level [Pattern guide](/guides/patterns/) you will have learned that paths
always start with a `move()` operation. In this case, we moved to our `right` points. always start with a `move()` operation. In this case, we moved to our `right` points.

View file

@ -19,14 +19,14 @@ npx create-freesewing-pattern
This will load a few dependencies, and then ask you the following questions: This will load a few dependencies, and then ask you the following questions:
- **Language**: Use the arrow keys to select the language of your choice - **Language**: Use the arrow keys to select the language of your choice
- **Pattern name**: Enter `tutorial` - **Pattern name**: Enter `tutorial`
- **description**: Enter `The FreeSewing tutorial` - **description**: Enter `The FreeSewing tutorial`
- **Pattern type**: Use the arrow key to select `Pattern` - **Pattern type**: Use the arrow key to select `Pattern`
- **Department**: Use the arrow keys to select `Accessories` - **Department**: Use the arrow keys to select `Accessories`
- **Author**: Enter your GitHub username - **Author**: Enter your GitHub username
- **GitHub repository**: This will be prefilled for you, so just hit Enter - **GitHub repository**: This will be prefilled for you, so just hit Enter
- **Package manager**: Use the arrow to choose. Pick `npm` if you're not sure. - **Package manager**: Use the arrow to choose. Pick `npm` if you're not sure.
After you've answered these questions, the default template will be copied, after which all dependencies will be installed. After you've answered these questions, the default template will be copied, after which all dependencies will be installed.

View file

@ -28,9 +28,9 @@ do {
We've added a few new variables: We've added a few new variables:
- `tweak`: A _tweak factor_ that we'll use to increase or decrease the neck opening by making it more or less than 1 - `tweak`: A _tweak factor_ that we'll use to increase or decrease the neck opening by making it more or less than 1
- `target`: How long our (quarter) neck opening should be - `target`: How long our (quarter) neck opening should be
- `delta`: How far we're off. Positive numbers mean it's too long, negative means too short - `delta`: How far we're off. Positive numbers mean it's too long, negative means too short
Now that we know what `target` is, we construct our path as we did before. Now that we know what `target` is, we construct our path as we did before.
But this time around, we multiply our point coordinates with our `tweak` variable (1 at the start). But this time around, we multiply our point coordinates with our `tweak` variable (1 at the start).

View file

@ -36,10 +36,10 @@ markings, depending on the units requested by the user.
While the grid gets added automatically, the dimensions you have to add yourself. While the grid gets added automatically, the dimensions you have to add yourself.
Thankfully, there's macros that can help you with that, specifically: Thankfully, there's macros that can help you with that, specifically:
- The `hd` macro adds a horizontal dimension - The `hd` macro adds a horizontal dimension
- The `vd` macro adds a vertical dimension - The `vd` macro adds a vertical dimension
- The `ld` macro adds a linear dimension - The `ld` macro adds a linear dimension
- The `pd` macro adds a path dimension that follows a given path - The `pd` macro adds a path dimension that follows a given path
<Note> The documentation, as always, holds [all the information about the macros](/reference/macros/). </Note> <Note> The documentation, as always, holds [all the information about the macros](/reference/macros/). </Note>
@ -89,8 +89,8 @@ Your paperless bib
We used the `hd` macro to add two horizontal dimensions: We used the `hd` macro to add two horizontal dimensions:
- One at the bottom for the width of our bib - One at the bottom for the width of our bib
- One for the width of the neck opening - One for the width of the neck opening
The `hd` macro takes a `from` and `to` point as well as a `y` value that says at what Y-value to draw the dimension. The `hd` macro takes a `from` and `to` point as well as a `y` value that says at what Y-value to draw the dimension.

Some files were not shown because too many files have changed in this diff Show more