diff --git a/sites/dev/docs/reference/store-methods/cutlist.addcut/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.addcut/readme.mdx index ae712351b69..c63ca4852c6 100644 --- a/sites/dev/docs/reference/store-methods/cutlist.addcut/readme.mdx +++ b/sites/dev/docs/reference/store-methods/cutlist.addcut/readme.mdx @@ -5,7 +5,11 @@ title: cutlist.addCut() The `cutlist.addCut()` store method will add a set of cutting instructions for the part. This information is not use by the core library, it is merely stored. -#### Signature +## Signature + +`cutlist.addCut()` accepts either an object or an array of objects +with the following signature: + ```js undefined store.cutlist.addCut({ Number cut, @@ -14,9 +18,11 @@ undefined store.cutlist.addCut({ Bool onBias = false, Bool onFold = false, }) -```` +``` -Pass an object to the `store.cutlist.addCut` method with any of the following keys; any you don't provide will be filled with the defaults: +Pass an object or an array of objects to the `cutlist.addCut()` +method with any of the following keys; +any you don't provide will be filled with the defaults: | Key | Type | Default | Description | | :-- | :--- | :------ | :---------- | @@ -40,9 +46,9 @@ You can use any `string` you want for your material, but here are some standard ::: -#### Example +## Example - + ```js ({ Point, Path, paths, macro, store, part }) => { @@ -52,16 +58,16 @@ You can use any `string` you want for your material, but here are some standard macro('title', { nr: 9, title: 'The title', - at: new Point(0,0) + at: new Point(0,0), + scale: 0.5, }) // Prevent clipping paths.diag = new Path() - .move(new Point(-20,-50)) + .move(new Point(-10,-20)) .move(new Point(80,35)) return part } ``` - diff --git a/sites/dev/docs/reference/store-methods/cutlist.getcutfabrics/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.getcutfabrics/readme.mdx new file mode 100644 index 00000000000..72889faa11a --- /dev/null +++ b/sites/dev/docs/reference/store-methods/cutlist.getcutfabrics/readme.mdx @@ -0,0 +1,45 @@ +--- +title: cutlist.getCutFabrics() +--- + +The `cutlist.getCutFabrics()` store method will retrieve the stored +list of fabrics used by the pattern for given settings. + +## Signature + +```js +Array store.cutlist.getCutFabrics(settings) +``` + +The `custlist.getCutFabrics()` method returns an array of strings +containing the material names. + +## Example + + +```js +({ Point, points, Path, paths, store, context, part }) => { + + store.cutlist.addCut({cut: 2, from: 'fabric' }) + store.cutlist.addCut({cut: 2, from: 'lining' }) + + const materials = store.cutlist.getCutFabrics(context.settings) + + let y = 0 + points.header = new Point(0, y).addText('Materials used:') + for (let material of materials) { + y += 8 + points[material] = new Point(5, y).addText(material) + } + +// Prevent clipping +paths.diag = new Path() +.move(new Point(-10,-20)) +.move(new Point(80,35)) + +return part +} + +``` + +``` diff --git a/sites/dev/docs/reference/store-methods/cutlist.getgrainorigin/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.getgrainorigin/readme.mdx new file mode 100644 index 00000000000..be7c781ab01 --- /dev/null +++ b/sites/dev/docs/reference/store-methods/cutlist.getgrainorigin/readme.mdx @@ -0,0 +1,19 @@ +--- +title: cutlist.getGrainOrigin() +--- + +The `cutlist.getGrainOrigin()` store method will retrieve stored +information about which macro set the grainline. + +This method is called internally by +[the `rmCutOnFold` macro](/reference/macros/rmcutonfold) +and +[the `rmGrainline` macro](/reference/macros/rmgrainline) +to retrieve information for cutting layout tools. +In other words, you typically have no reason to call this method manually. + +## Signature + +```js +String store.cutlist.getGrainOrigin() +``` diff --git a/sites/dev/docs/reference/store-methods/cutlist.removecut/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.removecut/readme.mdx index bc8a01cde97..99109d388f3 100644 --- a/sites/dev/docs/reference/store-methods/cutlist.removecut/readme.mdx +++ b/sites/dev/docs/reference/store-methods/cutlist.removecut/readme.mdx @@ -2,18 +2,44 @@ title: cutlist.removeCut() --- -The `store.cutlist.removeCut()` method will remove cutting instructions from the part for a given material. +The `cutlist.removeCut()` store method will remove cutting instructions from the part for a given material. +If no material is provided, all cutting instructions for the part +will be removed. - -#### Signature +## Signature ```js -undefined cutlist.removeCut(String from) +undefined store.cutlist.removeCut(String from) ``` ## Example + +```js +({ Point, Path, paths, macro, store, part }) => { + + store.cutlist.addCut({cut: 2, from: 'fabric' }) + store.cutlist.addCut({cut: 2, from: 'lining' }) + store.cutlist.removeCut('lining') + + macro('title', { + nr: 9, + title: 'The title', + at: new Point(0,0), + scale: 0.5, + }) + + // Prevent clipping + paths.diag = new Path() + .move(new Point(-10,-20)) + .move(new Point(80,35)) + + return part +} +``` + + ```mjs -cutlist.removeCut('fabric') +store.cutlist.removeCut('fabric') ``` diff --git a/sites/dev/docs/reference/store-methods/cutlist.removecutonfold/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.removecutonfold/readme.mdx new file mode 100644 index 00000000000..ff1fa311e59 --- /dev/null +++ b/sites/dev/docs/reference/store-methods/cutlist.removecutonfold/readme.mdx @@ -0,0 +1,15 @@ +--- +title: cutlist.removeCutOnFold() +--- + +The `cutlist.removeCutOnFold()` store method will remove stored +cut on fold line information. + +This method is called internally by [the `rmCutonfold` macro](/reference/macros/rmcutonfold) to remove stored information for cutting layout tools. +In other words, you typically have no reason to call this method manually. + +## Signature + +```js +undefined store.cutlist.removeCutOnFold() +``` diff --git a/sites/dev/docs/reference/store-methods/cutlist.removegrain/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.removegrain/readme.mdx new file mode 100644 index 00000000000..8bc4575f1d7 --- /dev/null +++ b/sites/dev/docs/reference/store-methods/cutlist.removegrain/readme.mdx @@ -0,0 +1,16 @@ +--- +title: cutlist.removeGrain() +--- + +The `cutlist.removeGrain()` store method will remove stored grainline +information. + +This method is called internally by [the `rmGrainline` macro](/reference/macros/rmgrainline). +to remove stored information for cutting layout tools. +In other words, you typically have no reason to call this method manually. + +## Signature + +```js +undefined store.cutlist.removeGrain() +``` diff --git a/sites/dev/docs/reference/store-methods/cutlist.setcut/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.setcut/readme.mdx new file mode 100644 index 00000000000..69c7ba7c142 --- /dev/null +++ b/sites/dev/docs/reference/store-methods/cutlist.setcut/readme.mdx @@ -0,0 +1,60 @@ +--- +title: cutlist.setCut() +--- + +The `cutlist.setCut()` store method will remove all cutting instructions +from the part +and then add a set of cutting instructions for the part. +This information is not use by the core library, it is merely stored. + +## Signature + +`cutlist.setCut()` accepts either an object or an array of objects +with the following signature: + +```js +undefined store.cutlist.setCut({ + Number cut, + String from, + Bool identical = false, + Bool onBias = false, + Bool onFold = false, +}) +``` + +:::note RELATED + +Please see [cutlist.addCut()](/reference/store-methods/cutlist.addcut) +for detailed information about the object properties used by +`cutlist.setCut()`. + +::: + +## Example + + +```js +({ Point, Path, paths, macro, store, part }) => { + + store.cutlist.addCut({cut: 2, from: 'fabric' }) + store.cutlist.setCut({cut: 2, from: 'lining' }) + +macro('title', { +nr: 9, +title: 'The title', +at: new Point(0,0), +scale: 0.5, +}) + +// Prevent clipping +paths.diag = new Path() +.move(new Point(-10,-20)) +.move(new Point(80,35)) + +return part +} + +``` + + +``` diff --git a/sites/dev/docs/reference/store-methods/cutlist.setcutonfold/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.setcutonfold/readme.mdx index 21c9916529b..d1b8fbb1fab 100644 --- a/sites/dev/docs/reference/store-methods/cutlist.setcutonfold/readme.mdx +++ b/sites/dev/docs/reference/store-methods/cutlist.setcutonfold/readme.mdx @@ -1,13 +1,14 @@ --- title: cutlist.setCutOnFold() --- -The `cutlist.setCutOnFold()` method will take two points to determine the cut on fold line. +The `cutlist.setCutOnFold()` store method will take two points +to determine the cut on fold line. This method is called internally by [the `cutonfold` macro](/reference/macros/cutonfold) to store information for cutting layout tools. In other words, you typically have no reason to call this method manually. -#### Signature +## Signature ```js -undefined cutlist.setCutOnFold(Point p1, Point p2) +undefined store.cutlist.setCutOnFold(Point p1, Point p2) ``` diff --git a/sites/dev/docs/reference/store-methods/cutlist.setgrain/readme.mdx b/sites/dev/docs/reference/store-methods/cutlist.setgrain/readme.mdx index b749ffb4030..6beffac46d9 100644 --- a/sites/dev/docs/reference/store-methods/cutlist.setgrain/readme.mdx +++ b/sites/dev/docs/reference/store-methods/cutlist.setgrain/readme.mdx @@ -8,7 +8,7 @@ This method is called internally by [the `grainline` macro](/reference/macros/gr to store information for cutting layout tools. In other words, you typically have no reason to call this method manually. -#### Signature +## Signature ```js undefined store.cutlist.setGrain(Number grainAngle)