Revert "chore: Linting for markdown and js"
This reverts commit 1c92e0f655
.
This commit is contained in:
parent
994874fa72
commit
cba1ab19c8
6627 changed files with 25791 additions and 24211 deletions
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: Common design challenges
|
||||
---
|
||||
title: Common design challenges
|
||||
---
|
||||
|
||||
Below is a list of examples of how to implement common design challenges in code:
|
||||
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Adapt the sleevecap length to fit the armhole
|
||||
for: developers
|
||||
about: Shows how to adapt the length of the sleevecap to fit your armhole
|
||||
-------------------------------------------------------------------------
|
||||
---
|
||||
|
||||
<Note>
|
||||
|
||||
##### 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>
|
||||
|
||||
Fitting the sleevecap to the armhole means that we need to make sure the length
|
||||
of the seams match.\
|
||||
of the seams match.
|
||||
A similar challenge is to fit the collar to the neck opening and so on.
|
||||
|
||||
For all of these situations where you have to create curved seams with matching
|
||||
|
@ -26,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:
|
||||
|
||||
* 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
|
||||
* We need to match the length of the sleevecap + sleeve cap ease to the length of the front and back armhole
|
||||
- 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
|
||||
- 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:
|
||||
|
||||
* 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 check the length after every attempt, and adjust the `tweak` value
|
||||
- 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 check the length after every attempt, and adjust the `tweak` value
|
||||
|
||||
```js
|
||||
export default function (part) {
|
||||
|
@ -82,7 +81,7 @@ export default function (part) {
|
|||
|
||||
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 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.
|
||||
This assymetric approach avoids that we end up ping-ponging around our target value and never land somewhere in the middle
|
||||
- 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 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
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Add seam allowance and/or hem allowance
|
||||
for: developers
|
||||
about: Adding seam allowance or hem allowance is easy to do
|
||||
-----------------------------------------------------------
|
||||
---
|
||||
|
||||
<Note>
|
||||
|
||||
##### 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>
|
||||
|
||||
|
@ -21,8 +20,8 @@ seam allowance.
|
|||
|
||||
In the example below we have two such paths:
|
||||
|
||||
* `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.saBase` is the path that will require regular seam allowance
|
||||
- `paths.hemBase` is the path that will require more seam allowance, or hem allowance
|
||||
|
||||
When creating them, we disable rendering, effectively hiding them.
|
||||
Then we string together our real path and our seam allowance based on them:
|
||||
|
|
|
@ -1,26 +1,25 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Slash and spread
|
||||
for: developers
|
||||
about: Slash and spread is easy enough on paper, here's how to do it in code
|
||||
----------------------------------------------------------------------------
|
||||
---
|
||||
|
||||
<Note>
|
||||
|
||||
##### 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>
|
||||
|
||||
When we *slash and spread* a pattern, we cut out a triangle, and then rotate it
|
||||
When we _slash and spread_ a pattern, we cut out a triangle, and then rotate it
|
||||
around the tip of the triangle.
|
||||
|
||||
And that's exactly what we do in code. We just need to know:
|
||||
|
||||
* What point we want to rotate around
|
||||
* Which points we want to rotate
|
||||
* By how much we want to rotate
|
||||
- What point we want to rotate around
|
||||
- Which points we want to rotate
|
||||
- By how much we want to rotate
|
||||
|
||||
```js
|
||||
let rotate = [
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Add several of the same snippets with the sprinkle macro
|
||||
for: developers
|
||||
about: Adding multiple snippets doesn't need to be a chore with this handy macro
|
||||
--------------------------------------------------------------------------------
|
||||
---
|
||||
|
||||
<Note>
|
||||
|
||||
##### 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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue