diff --git a/sites/dev/docs/reference/api/path/addclass/readme.mdx b/sites/dev/docs/reference/api/path/addclass/readme.mdx
index 6e7125af5d6..b382e899ce7 100644
--- a/sites/dev/docs/reference/api/path/addclass/readme.mdx
+++ b/sites/dev/docs/reference/api/path/addclass/readme.mdx
@@ -20,18 +20,17 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.from = new Point(5, 10)
-points.to = new Point(95, 10)
+ points.from = new Point(5, 10)
+ points.to = new Point(95, 10)
-paths.line = new Path()
-.move(points.from)
-.line(points.to)
-.addClass('note dashed')
+ paths.line = new Path()
+ .move(points.from)
+ .line(points.to)
+ .addClass('note dashed')
-return part
+ return part
}
-
-````
+```
## Notes
@@ -42,4 +41,4 @@ as the two following calls yield the same result:
```js
path.attr('class', 'fabric')
path.addClass('fabric')
-````
+```
diff --git a/sites/dev/docs/reference/api/path/addtext/readme.mdx b/sites/dev/docs/reference/api/path/addtext/readme.mdx
index 628fdd7032c..8df98787137 100644
--- a/sites/dev/docs/reference/api/path/addtext/readme.mdx
+++ b/sites/dev/docs/reference/api/path/addtext/readme.mdx
@@ -24,15 +24,14 @@ This method is chainable as it returns the `Path` object
points.from = new Point(5, 10)
points.to = new Point(95, 10)
-paths.line = new Path()
-.move(points.from)
-.line(points.to)
-.addText('FreeSewing rocks')
+ paths.line = new Path()
+ .move(points.from)
+ .line(points.to)
+ .addText('FreeSewing rocks')
-return part
+ return part
}
-
-````
+```
## Notes
@@ -43,7 +42,7 @@ as the two following calls yield the same result:
```js
path.attr('data-text', 'Hello')
path.addText('Hello')
-````
+```
The difference with [Path.setText()](/reference/api/path/addtext) is that this
method will add to the existing text whereas `Path.setText()` will overwrite
diff --git a/sites/dev/docs/reference/api/path/angleat/readme.mdx b/sites/dev/docs/reference/api/path/angleat/readme.mdx
index 7068802c39c..f10772ccfe8 100644
--- a/sites/dev/docs/reference/api/path/angleat/readme.mdx
+++ b/sites/dev/docs/reference/api/path/angleat/readme.mdx
@@ -20,35 +20,35 @@ number|false path.angleAt(Point point)
```js
({ Point, points, Path, paths, snippets, Snippet, part }) => {
-points.A = new Point(45, 60)
-points.B = new Point(10, 30)
-points.BCp2 = new Point(40, 20)
-points.C = new Point(90, 30)
-points.CCp1 = new Point(50, -30)
-points.D = new Point(50, 80)
-points.DCp1 = new Point(70, 30)
+ points.A = new Point(45, 60)
+ points.B = new Point(10, 30)
+ points.BCp2 = new Point(40, 20)
+ points.C = new Point(90, 30)
+ points.CCp1 = new Point(50, -30)
+ points.D = new Point(50, 80)
+ points.DCp1 = new Point(70, 30)
-paths.demo = new Path()
-.move(points.D)
-.curve(points.DCp1, points.DCp1, points.C)
-.curve(points.CCp1, points.BCp2, points.B)
-.line(points.A)
+ paths.demo = new Path()
+ .move(points.D)
+ .curve(points.DCp1, points.DCp1, points.C)
+ .curve(points.CCp1, points.BCp2, points.B)
+ .line(points.A)
-points.testPoint = paths.demo.shiftFractionAlong(0.55)
-snippets.point = new Snippet("notch", points.testPoint)
+ points.testPoint = paths.demo.shiftFractionAlong(0.55)
+ snippets.point = new Snippet("notch", points.testPoint)
-let angle = paths.demo.angleAt(points.testPoint)
-//draw a tangent path
-paths.tangent = new Path()
- .move(points.testPoint.shift(angle, -30))
- .line(points.testPoint.shift(angle, 30))
- .attr("class", "lining dashed")
+ let angle = paths.demo.angleAt(points.testPoint)
+ //draw a tangent path
+ paths.tangent = new Path()
+ .move(points.testPoint.shift(angle, -30))
+ .line(points.testPoint.shift(angle, 30))
+ .attr("class", "lining dashed")
-return part
+ return part
}
```
-
+
## Notes
Keep in mind that calculations with Bézier curves are often approximations.
diff --git a/sites/dev/docs/reference/api/path/attr/readme.mdx b/sites/dev/docs/reference/api/path/attr/readme.mdx
index a3dacc9cc72..72cdedc33ef 100644
--- a/sites/dev/docs/reference/api/path/attr/readme.mdx
+++ b/sites/dev/docs/reference/api/path/attr/readme.mdx
@@ -28,20 +28,19 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.from = new Point(10, 20)
-points.cp1 = new Point(20, -10)
-points.cp2 = new Point(50, 50)
-points.to = new Point(70, 20)
+ points.from = new Point(10, 20)
+ points.cp1 = new Point(20, -10)
+ points.cp2 = new Point(50, 50)
+ points.to = new Point(70, 20)
-paths.example = new Path()
-.move(points.from)
-.curve(points.cp1, points.cp2, points.to)
-.attr("class", "canvas")
-.setText("FreeSewing rocks", "text-xs center")
+ paths.example = new Path()
+ .move(points.from)
+ .curve(points.cp1, points.cp2, points.to)
+ .attr("class", "canvas")
+ .setText("FreeSewing rocks", "text-xs center")
-return part
+ return part
}
-
```
@@ -57,4 +56,3 @@ all call this method under the hood.
See [Using Attributes](/howtos/code/attributes)
for information about custom Attributes that can be used with Paths.
-```
diff --git a/sites/dev/docs/reference/api/path/circlesegment/readme.mdx b/sites/dev/docs/reference/api/path/circlesegment/readme.mdx
index 011722041a4..fd5e5bb95d6 100644
--- a/sites/dev/docs/reference/api/path/circlesegment/readme.mdx
+++ b/sites/dev/docs/reference/api/path/circlesegment/readme.mdx
@@ -36,23 +36,22 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.from = new Point(10, 20)
-points.origin = new Point(40, 0)
+ points.from = new Point(10, 20)
+ points.origin = new Point(40, 0)
-paths.line = new Path()
-.move(points.from)
-.circleSegment(90, points.origin)
-.setText("→ Path.circleSegment() →", "text-sm center fill-note")
+ paths.line = new Path()
+ .move(points.from)
+ .circleSegment(90, points.origin)
+ .setText("→ Path.circleSegment() →", "text-sm center fill-note")
-paths.helper = new Path()
-.move(paths.line.start())
-.line(points.origin)
-.line(paths.line.end())
-.setClass('dotted stroke-sm')
+ paths.helper = new Path()
+ .move(paths.line.start())
+ .line(points.origin)
+ .line(paths.line.end())
+ .setClass('dotted stroke-sm')
-return part
+ return part
}
```
-```
diff --git a/sites/dev/docs/reference/api/path/close/readme.mdx b/sites/dev/docs/reference/api/path/close/readme.mdx
index 401e3f5e936..2e9b9b11bbd 100644
--- a/sites/dev/docs/reference/api/path/close/readme.mdx
+++ b/sites/dev/docs/reference/api/path/close/readme.mdx
@@ -20,20 +20,18 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.from = new Point(10, 20)
-points.cp2 = new Point(60, 30)
-points.to = new Point(90, 20)
+ points.from = new Point(10, 20)
+ points.cp2 = new Point(60, 30)
+ points.to = new Point(90, 20)
-paths.line = new Path()
-.move(points.from)
-.\_curve(points.cp2, points.to)
-.close()
-.reverse() // To keep text from being upside-down
-.setText('Path.\_close()', 'text-sm right fill-note')
+ paths.line = new Path()
+ .move(points.from)
+ ._curve(points.cp2, points.to)
+ .close()
+ .reverse() // To keep text from being upside-down
+ .setText('Path._close()', 'text-sm right fill-note')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/curve/readme.mdx b/sites/dev/docs/reference/api/path/curve/readme.mdx
index 9417645efa6..aef43cbcbfd 100644
--- a/sites/dev/docs/reference/api/path/curve/readme.mdx
+++ b/sites/dev/docs/reference/api/path/curve/readme.mdx
@@ -21,19 +21,17 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.from = new Point(10, 20)
-points.cp1 = new Point(40, 0)
-points.cp2 = new Point(60, 40)
-points.to = new Point(90, 20)
+ points.from = new Point(10, 20)
+ points.cp1 = new Point(40, 0)
+ points.cp2 = new Point(60, 40)
+ points.to = new Point(90, 20)
-paths.line = new Path()
-.move(points.from)
-.curve(points.cp1, points.cp2, points.to)
-.setText("Path.curve()", "text-sm center fill-note")
+ paths.line = new Path()
+ .move(points.from)
+ .curve(points.cp1, points.cp2, points.to)
+ .setText("Path.curve()", "text-sm center fill-note")
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/curve_/readme.mdx b/sites/dev/docs/reference/api/path/curve_/readme.mdx
index 26f99862e16..48cf1c5d22f 100644
--- a/sites/dev/docs/reference/api/path/curve_/readme.mdx
+++ b/sites/dev/docs/reference/api/path/curve_/readme.mdx
@@ -3,7 +3,7 @@ title: Path.curve_()
---
The `Path.curve_()` method draws a cubic Bézier curve from the current position
-via two control points to a given endpoint. However, the end control point is
+via two control points to a given endpoint. However, the end control point is
identical to the end point.
## Signature
@@ -18,10 +18,12 @@ This method is chainable as it returns the `Path` object
## Example
+
```js
-;({ Point, points, Path, paths, part }) => {
+({ Point, points, Path, paths, part }) => {
+
points.from = new Point(10, 20)
points.cp1 = new Point(40, 0)
points.to = new Point(90, 20)
@@ -29,8 +31,8 @@ This method is chainable as it returns the `Path` object
paths.line = new Path()
.move(points.from)
.curve_(points.cp1, points.to)
- .setText('Path.curve_()', 'text-sm center fill-note')
- .attr('data-text-dy', -1)
+ .setText("Path.curve_()", "text-sm center fill-note")
+ .attr("data-text-dy", -1)
return part
}
diff --git a/sites/dev/docs/reference/api/path/end/readme.mdx b/sites/dev/docs/reference/api/path/end/readme.mdx
index c281b0df185..7b6db98e748 100644
--- a/sites/dev/docs/reference/api/path/end/readme.mdx
+++ b/sites/dev/docs/reference/api/path/end/readme.mdx
@@ -20,22 +20,20 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, snippets, Snippet, part }) => {
-points.A = new Point(45, 60)
-points.B = new Point(10, 30)
-points.BCp2 = new Point(40, 20)
-points.C = new Point(90, 30)
-points.CCp1 = new Point(50, -30)
+ points.A = new Point(45, 60)
+ points.B = new Point(10, 30)
+ points.BCp2 = new Point(40, 20)
+ points.C = new Point(90, 30)
+ points.CCp1 = new Point(50, -30)
-paths.demo = new Path()
-.move(points.A)
-.line(points.B)
-.curve(points.BCp2, points.CCp1, points.C)
+ paths.demo = new Path()
+ .move(points.A)
+ .line(points.B)
+ .curve(points.BCp2, points.CCp1, points.C)
-snippets.end = new Snippet("notch", paths.demo.end())
+ snippets.end = new Snippet("notch", paths.demo.end())
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/hide/readme.mdx b/sites/dev/docs/reference/api/path/hide/readme.mdx
index f6405f0eb57..0d082d3cd63 100644
--- a/sites/dev/docs/reference/api/path/hide/readme.mdx
+++ b/sites/dev/docs/reference/api/path/hide/readme.mdx
@@ -20,17 +20,15 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.top = new Point(50, 0)
-points.left = new Point (20,50)
-points.right = new Point (80,50)
+ points.top = new Point(50, 0)
+ points.left = new Point (20,50)
+ points.right = new Point (80,50)
-paths.a = new Path().move(points.top).line(points.right).setText('a')
-paths.b = new Path().move(points.right).line(points.left).setText('b').hide()
-paths.c = new Path().move(points.left).line(points.top).setText('c')
+ paths.a = new Path().move(points.top).line(points.right).setText('a')
+ paths.b = new Path().move(points.right).line(points.left).setText('b').hide()
+ paths.c = new Path().move(points.left).line(points.top).setText('c')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/insop/readme.mdx b/sites/dev/docs/reference/api/path/insop/readme.mdx
index fb923ceece2..f36c979fef5 100644
--- a/sites/dev/docs/reference/api/path/insop/readme.mdx
+++ b/sites/dev/docs/reference/api/path/insop/readme.mdx
@@ -15,39 +15,38 @@ Path path.insop(string id, Path path)
This method is chainable as it returns the `Path` object
:::
+
```js
({ Point, points, Path, paths, part }) => {
-points.left = new Point(10,10)
-points.dartLeft = new Point(40, 10)
-points.dartTip = new Point(50, 50)
-points.dartRight = new Point(60, 10)
-points.right = new Point(90, 10)
+ points.left = new Point(10,10)
+ points.dartLeft = new Point(40, 10)
+ points.dartTip = new Point(50, 50)
+ points.dartRight = new Point(60, 10)
+ points.right = new Point(90, 10)
-paths.withoutDart = new Path()
-.move(points.left)
-.line(points.dartLeft)
-.noop('dart')
-.line(points.right)
+ paths.withoutDart = new Path()
+ .move(points.left)
+ .line(points.dartLeft)
+ .noop('dart')
+ .line(points.right)
-paths.withDart = paths.withoutDart
-.clone()
-.insop(
-'dart',
-new Path()
-.line(points.dartTip)
-.line(points.dartRight)
-)
-.attr('style', 'stroke-width: 2px; stroke-opacity: 0.5; stroke: orange;')
+ paths.withDart = paths.withoutDart
+ .clone()
+ .insop(
+ 'dart',
+ new Path()
+ .line(points.dartTip)
+ .line(points.dartRight)
+ )
+ .attr('style', 'stroke-width: 2px; stroke-opacity: 0.5; stroke: orange;')
-return part
+ return part
}
-
```
## Notes
This is often used to insert darts into a path.
-```
diff --git a/sites/dev/docs/reference/api/path/line/readme.mdx b/sites/dev/docs/reference/api/path/line/readme.mdx
index 40c719bce89..4832c6a00a5 100644
--- a/sites/dev/docs/reference/api/path/line/readme.mdx
+++ b/sites/dev/docs/reference/api/path/line/readme.mdx
@@ -21,17 +21,15 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.from = new Point(10, 10)
-points.to = new Point(90, 10)
+ points.from = new Point(10, 10)
+ points.to = new Point(90, 10)
-paths.line = new Path()
-.move(points.from)
-.line(points.to)
-.setText("Path.line()", "text-sm center fill-note")
+ paths.line = new Path()
+ .move(points.from)
+ .line(points.to)
+ .setText("Path.line()", "text-sm center fill-note")
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/noop/readme.mdx b/sites/dev/docs/reference/api/path/noop/readme.mdx
index 98c9cee7203..ed9391bb46c 100644
--- a/sites/dev/docs/reference/api/path/noop/readme.mdx
+++ b/sites/dev/docs/reference/api/path/noop/readme.mdx
@@ -22,31 +22,29 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.left = new Point(10,10)
-points.dartLeft = new Point(40, 10)
-points.dartTip = new Point(50, 50)
-points.dartRight = new Point(60, 10)
-points.right = new Point(90, 10)
+ points.left = new Point(10,10)
+ points.dartLeft = new Point(40, 10)
+ points.dartTip = new Point(50, 50)
+ points.dartRight = new Point(60, 10)
+ points.right = new Point(90, 10)
-paths.withoutDart = new Path()
-.move(points.left)
-.line(points.dartLeft)
-.noop('dart')
-.line(points.right)
+ paths.withoutDart = new Path()
+ .move(points.left)
+ .line(points.dartLeft)
+ .noop('dart')
+ .line(points.right)
-paths.withDart = paths.withoutDart
-.clone()
-.insop(
-'dart',
-new Path()
-.line(points.dartTip)
-.line(points.dartRight)
-)
-.attr('style', 'stroke-width: 2px; stroke-opacity: 0.5; stroke: orange;')
+ paths.withDart = paths.withoutDart
+ .clone()
+ .insop(
+ 'dart',
+ new Path()
+ .line(points.dartTip)
+ .line(points.dartRight)
+ )
+ .attr('style', 'stroke-width: 2px; stroke-opacity: 0.5; stroke: orange;')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/setclass/readme.mdx b/sites/dev/docs/reference/api/path/setclass/readme.mdx
index 20d89623396..930322bbe74 100644
--- a/sites/dev/docs/reference/api/path/setclass/readme.mdx
+++ b/sites/dev/docs/reference/api/path/setclass/readme.mdx
@@ -20,18 +20,17 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.from = new Point(5, 10)
-points.to = new Point(95, 10)
+ points.from = new Point(5, 10)
+ points.to = new Point(95, 10)
-paths.line = new Path()
-.move(points.from)
-.line(points.to)
-.setClass('note dashed')
+ paths.line = new Path()
+ .move(points.from)
+ .line(points.to)
+ .setClass('note dashed')
-return part
+ return part
}
-
-````
+```
## Notes
@@ -42,4 +41,4 @@ as the two following calls yield the same result:
```js
path.attr('class', 'fabric', true)
path.setClass('fabric')
-````
+```
diff --git a/sites/dev/docs/reference/api/path/sethidden/readme.mdx b/sites/dev/docs/reference/api/path/sethidden/readme.mdx
index ddf431aea5a..968444f47ad 100644
--- a/sites/dev/docs/reference/api/path/sethidden/readme.mdx
+++ b/sites/dev/docs/reference/api/path/sethidden/readme.mdx
@@ -21,17 +21,15 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.top = new Point(50, 0)
-points.left = new Point (20,50)
-points.right = new Point (80,50)
+ points.top = new Point(50, 0)
+ points.left = new Point (20,50)
+ points.right = new Point (80,50)
-paths.a = new Path().move(points.top).line(points.right).setText('a')
-paths.b = new Path().move(points.right).line(points.left).setText('b').setHidden(true)
-paths.c = new Path().move(points.left).line(points.top).setText('c')
+ paths.a = new Path().move(points.top).line(points.right).setText('a')
+ paths.b = new Path().move(points.right).line(points.left).setText('b').setHidden(true)
+ paths.c = new Path().move(points.left).line(points.top).setText('c')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/settext/readme.mdx b/sites/dev/docs/reference/api/path/settext/readme.mdx
index acf7203cd23..e521afa2a9a 100644
--- a/sites/dev/docs/reference/api/path/settext/readme.mdx
+++ b/sites/dev/docs/reference/api/path/settext/readme.mdx
@@ -24,15 +24,14 @@ This method is chainable as it returns the `Path` object
points.from = new Point(5, 10)
points.to = new Point(95, 10)
-paths.line = new Path()
-.move(points.from)
-.line(points.to)
-.setText('FreeSewing rocks')
+ paths.line = new Path()
+ .move(points.from)
+ .line(points.to)
+ .setText('FreeSewing rocks')
-return part
+ return part
}
-
-````
+```
## Notes
@@ -43,7 +42,7 @@ as the two following calls yield the same result:
```js
path.attr('data-text', 'Hello')
path.setText('Hello')
-````
+```
The difference with [Path.addText()](/reference/api/path/addtext) is that this
method will overwrite existing text on the path, whereas `Path.addText()` will
diff --git a/sites/dev/docs/reference/api/path/smurve/readme.mdx b/sites/dev/docs/reference/api/path/smurve/readme.mdx
index dac2cf65ab9..e69c8588547 100644
--- a/sites/dev/docs/reference/api/path/smurve/readme.mdx
+++ b/sites/dev/docs/reference/api/path/smurve/readme.mdx
@@ -21,24 +21,22 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.aFrom = new Point(10, 10)
-points.aCp1 = new Point(40, 40)
-points.aCp2 = new Point(70, -20)
-points.aTo = new Point(100, 10)
+ points.aFrom = new Point(10, 10)
+ points.aCp1 = new Point(40, 40)
+ points.aCp2 = new Point(70, -20)
+ points.aTo = new Point(100, 10)
-points.bCp2 = new Point(50,50)
-points.bTo = new Point(10,50)
+ points.bCp2 = new Point(50,50)
+ points.bTo = new Point(10,50)
-paths.smurve = new Path()
-.move(points.aFrom)
-.curve(points.aCp1, points.aCp2,points.aTo)
-.smurve(points.bCp2, points.bTo)
-.reverse() // Puts text at the end
-.setText('Path.smurve()')
+ paths.smurve = new Path()
+ .move(points.aFrom)
+ .curve(points.aCp1, points.aCp2,points.aTo)
+ .smurve(points.bCp2, points.bTo)
+ .reverse() // Puts text at the end
+ .setText('Path.smurve()')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/smurve_/readme.mdx b/sites/dev/docs/reference/api/path/smurve_/readme.mdx
index b677203c034..cf64310fa46 100644
--- a/sites/dev/docs/reference/api/path/smurve_/readme.mdx
+++ b/sites/dev/docs/reference/api/path/smurve_/readme.mdx
@@ -14,7 +14,7 @@ Path path.smurve_(Point cp2, Point end)
```
:::tip
-This method is chainable as it returns the `Path` object
+This method is chainable as it returns the `Path` objecti
:::
## Example
@@ -23,23 +23,21 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.aFrom = new Point(10, 10)
-points.aCp1 = new Point(40, 40)
-points.aCp2 = new Point(70, -20)
-points.aTo = new Point(100, 10)
+ points.aFrom = new Point(10, 10)
+ points.aCp1 = new Point(40, 40)
+ points.aCp2 = new Point(70, -20)
+ points.aTo = new Point(100, 10)
-points.bTo = new Point(10,50)
+ points.bTo = new Point(10,50)
-paths.smurve = new Path()
-.move(points.aFrom)
-.curve(points.aCp1, points.aCp2,points.aTo)
-.smurve\_(points.bTo)
-.reverse() // Puts text at the end
-.setText('Path.smurve()')
+ paths.smurve = new Path()
+ .move(points.aFrom)
+ .curve(points.aCp1, points.aCp2,points.aTo)
+ .smurve_(points.bTo)
+ .reverse() // Puts text at the end
+ .setText('Path.smurve()')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/start/readme.mdx b/sites/dev/docs/reference/api/path/start/readme.mdx
index bf01f1f7a3a..2a74758f579 100644
--- a/sites/dev/docs/reference/api/path/start/readme.mdx
+++ b/sites/dev/docs/reference/api/path/start/readme.mdx
@@ -20,22 +20,20 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, snippets, Snippet, part }) => {
-points.A = new Point(45, 60)
-points.B = new Point(10, 30)
-points.BCp2 = new Point(40, 20)
-points.C = new Point(90, 30)
-points.CCp1 = new Point(50, -30)
+ points.A = new Point(45, 60)
+ points.B = new Point(10, 30)
+ points.BCp2 = new Point(40, 20)
+ points.C = new Point(90, 30)
+ points.CCp1 = new Point(50, -30)
-paths.demo = new Path()
-.move(points.A)
-.line(points.B)
-.curve(points.BCp2, points.CCp1, points.C)
+ paths.demo = new Path()
+ .move(points.A)
+ .line(points.B)
+ .curve(points.BCp2, points.CCp1, points.C)
-snippets.end = new Snippet("notch", paths.demo.start())
+ snippets.end = new Snippet("notch", paths.demo.start())
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/path/ucurve/readme.mdx b/sites/dev/docs/reference/api/path/ucurve/readme.mdx
index 082f61b8e09..9c19f0f9cb8 100644
--- a/sites/dev/docs/reference/api/path/ucurve/readme.mdx
+++ b/sites/dev/docs/reference/api/path/ucurve/readme.mdx
@@ -23,17 +23,17 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.from = new Point(5, 20)
-points.cp2 = new Point(60, 50)
-points.to = new Point(90, 20)
+ points.from = new Point(5, 20)
+ points.cp2 = new Point(60, 50)
+ points.to = new Point(90, 20)
-paths.line = new Path()
-.move(points.from)
-.\_curve(points.cp2, points.to)
-.setText("Path.\_curve()", "text-sm center fill-note")
-.attr("data-text-dy", -1)
+ paths.line = new Path()
+ .move(points.from)
+ ._curve(points.cp2, points.to)
+ .setText("Path._curve()", "text-sm center fill-note")
+ .attr("data-text-dy", -1)
-return part
+ return part
}
````
diff --git a/sites/dev/docs/reference/api/path/unhide/readme.mdx b/sites/dev/docs/reference/api/path/unhide/readme.mdx
index 9fe308188e3..15a1ec1abc3 100644
--- a/sites/dev/docs/reference/api/path/unhide/readme.mdx
+++ b/sites/dev/docs/reference/api/path/unhide/readme.mdx
@@ -2,7 +2,7 @@
title: Path.unhide()
---
-The `Path.unhide()` method unhides the path so it appears in the output. By
+The `Path.unhide()` method unhides the path so it appears in the output. By
default, paths are not hidden. So you should only call this on path previously
hidden via `Path.hide()`.
@@ -22,17 +22,15 @@ This method is chainable as it returns the `Path` object
```js
({ Point, points, Path, paths, part }) => {
-points.top = new Point(50, 0)
-points.left = new Point (20,50)
-points.right = new Point (80,50)
+ points.top = new Point(50, 0)
+ points.left = new Point (20,50)
+ points.right = new Point (80,50)
-paths.a = new Path().move(points.top).line(points.right).setText('a')
-paths.b = new Path().move(points.right).line(points.left).setText('b').hide().unhide()
-paths.c = new Path().move(points.left).line(points.top).setText('c')
+ paths.a = new Path().move(points.top).line(points.right).setText('a')
+ paths.b = new Path().move(points.right).line(points.left).setText('b').hide().unhide()
+ paths.c = new Path().move(points.left).line(points.top).setText('c')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/point/addcircle/readme.mdx b/sites/dev/docs/reference/api/point/addcircle/readme.mdx
index a5670fb1f3e..11732fba30e 100644
--- a/sites/dev/docs/reference/api/point/addcircle/readme.mdx
+++ b/sites/dev/docs/reference/api/point/addcircle/readme.mdx
@@ -28,20 +28,18 @@ This method is chainable as it returns the `Point` object
.addCircle(3, 'lining dashed')
.addCircle(7, 'mark dashed')
-points.b = new Point(50, 10)
-.addCircle(1, 'interfacing')
-.addCircle(3, 'fabric')
-.addCircle(5, 'lining')
-.addCircle(7, 'mark')
-.addCircle(9, 'note')
+ points.b = new Point(50, 10)
+ .addCircle(1, 'interfacing')
+ .addCircle(3, 'fabric')
+ .addCircle(5, 'lining')
+ .addCircle(7, 'mark')
+ .addCircle(9, 'note')
-points.c = new Point(70, 10)
-.addCircle(3, 'interfacing')
-.addCircle(7, 'mark lashed')
+ points.c = new Point(70, 10)
+ .addCircle(3, 'interfacing')
+ .addCircle(7, 'mark lashed')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/point/addtext/readme.mdx b/sites/dev/docs/reference/api/point/addtext/readme.mdx
index c3fe109ffe1..07d6ec1a30f 100644
--- a/sites/dev/docs/reference/api/point/addtext/readme.mdx
+++ b/sites/dev/docs/reference/api/point/addtext/readme.mdx
@@ -28,19 +28,18 @@ This method is chainable as it returns the `Point` object
.addText('FreeSewing')
.addText('rocks')
-// Avoid the text getting cropped
-paths.hidden = new Path()
-.move(points.anchor)
-.line(points.anchor.shift(0, 80))
-.addClass('hidden')
+ // Avoid the text getting cropped
+ paths.hidden = new Path()
+ .move(points.anchor)
+ .line(points.anchor.shift(0, 80))
+ .addClass('hidden')
-return part
+
+ return part
}
-
```
## Notes
Remember to [use translation keys, not text](/guides/best-practices#use-translation-keys)
-```
diff --git a/sites/dev/docs/reference/api/point/attr/readme.mdx b/sites/dev/docs/reference/api/point/attr/readme.mdx
index 6d5a91baa63..fce80ff16b5 100644
--- a/sites/dev/docs/reference/api/point/attr/readme.mdx
+++ b/sites/dev/docs/reference/api/point/attr/readme.mdx
@@ -18,6 +18,7 @@ Point point.attr(
If the third parameter is set to `true` it will call [`this.attributes.set()`](/reference/api/attributes/set/) instead, thereby overwriting the value of the attribute.
+
:::tip
This method is chainable as it returns the `Point` object
:::
@@ -28,19 +29,18 @@ This method is chainable as it returns the `Point` object
```js
({ Point, points, Path, paths, part }) => {
-points.anchor = new Point(100, 25)
-.attr('data-text', 'FreeSewing')
-.attr('data-text', 'rocks')
+ points.anchor = new Point(100, 25)
+ .attr('data-text', 'FreeSewing')
+ .attr('data-text', 'rocks')
-// Avoid the text getting cropped
-paths.hidden = new Path()
-.move(points.anchor)
-.line(points.anchor.shift(0, 80))
-.addClass('hidden')
+ // Avoid the text getting cropped
+ paths.hidden = new Path()
+ .move(points.anchor)
+ .line(points.anchor.shift(0, 80))
+ .addClass('hidden')
-return part
+ return part
}
-
```
@@ -48,4 +48,3 @@ return part
See [Using Attributes](/howtos/code/attributes)
for information about custom Attributes that can be used with Points.
-```
diff --git a/sites/dev/docs/reference/api/point/clone/readme.mdx b/sites/dev/docs/reference/api/point/clone/readme.mdx
index 4b99dd5fe0d..1025c05455f 100644
--- a/sites/dev/docs/reference/api/point/clone/readme.mdx
+++ b/sites/dev/docs/reference/api/point/clone/readme.mdx
@@ -21,22 +21,21 @@ This method is chainable as it returns the `Point` object
```js
({ Point, points, Path, paths, Snippet, snippets, part }) => {
-points.A = new Point(25, 25)
-.setText("Point A", "text-xl")
-.attr("data-text-fill-opacity", "0.5")
-points.B = points.A.clone().setText("Point B")
+ points.A = new Point(25, 25)
+ .setText("Point A", "text-xl")
+ .attr("data-text-fill-opacity", "0.5")
+ points.B = points.A.clone().setText("Point B")
-snippets.x = new Snippet("notch", points.A)
+ snippets.x = new Snippet("notch", points.A)
-// Avoid the text getting cropped
-paths.hidden = new Path()
-.move(new Point(20,10))
-.move(new Point(75,30))
-.addClass('hidden')
+ // Avoid the text getting cropped
+ paths.hidden = new Path()
+ .move(new Point(20,10))
+ .move(new Point(75,30))
+ .addClass('hidden')
-return part
+ return part
}
-
```
@@ -46,4 +45,3 @@ return part
The [`Point.copy()`](/reference/api/point/copy/) method will only copy the
point's coordinates, whereas this `Point.clone()` method will also copy its
attributes.
-```
diff --git a/sites/dev/docs/reference/api/point/setcircle/readme.mdx b/sites/dev/docs/reference/api/point/setcircle/readme.mdx
index 37bc7b4cce5..cfb40878603 100644
--- a/sites/dev/docs/reference/api/point/setcircle/readme.mdx
+++ b/sites/dev/docs/reference/api/point/setcircle/readme.mdx
@@ -31,24 +31,22 @@ This method is chainable as it returns the `Point` object
```js
({ Point, points, part }) => {
-points.a = new Point(30, 10)
-.setCircle(3, 'lining dashed')
-.setCircle(7, 'mark dashed')
+ points.a = new Point(30, 10)
+ .setCircle(3, 'lining dashed')
+ .setCircle(7, 'mark dashed')
-points.b = new Point(50, 10)
-.setCircle(1, 'interfacing')
-.setCircle(3, 'fabric')
-.setCircle(5, 'lining')
-.setCircle(7, 'mark')
-.setCircle(9, 'note')
+ points.b = new Point(50, 10)
+ .setCircle(1, 'interfacing')
+ .setCircle(3, 'fabric')
+ .setCircle(5, 'lining')
+ .setCircle(7, 'mark')
+ .setCircle(9, 'note')
-points.c = new Point(70, 10)
-.setCircle(3, 'interfacing')
-.setCircle(7, 'mark lashed')
+ points.c = new Point(70, 10)
+ .setCircle(3, 'interfacing')
+ .setCircle(7, 'mark lashed')
-return part
+ return part
}
-
```
-```
diff --git a/sites/dev/docs/reference/api/point/settext/readme.mdx b/sites/dev/docs/reference/api/point/settext/readme.mdx
index 69eec3e4b0c..c0ee45a126d 100644
--- a/sites/dev/docs/reference/api/point/settext/readme.mdx
+++ b/sites/dev/docs/reference/api/point/settext/readme.mdx
@@ -25,23 +25,21 @@ This method is chainable as it returns the `Point` object
```js
({ Point, points, Path, paths, part }) => {
-points.anchor = new Point(100, 25)
-.setText('FreeSewing')
-.setText('rocks')
+ points.anchor = new Point(100, 25)
+ .setText('FreeSewing')
+ .setText('rocks')
-// Avoid the text getting cropped
-paths.hidden = new Path()
-.move(points.anchor)
-.line(points.anchor.shift(0, 80))
-.addClass('hidden')
+ // Avoid the text getting cropped
+ paths.hidden = new Path()
+ .move(points.anchor)
+ .line(points.anchor.shift(0, 80))
+ .addClass('hidden')
-return part
+ return part
}
-
```
## Notes
Remember to [use translation keys, not text](/guides/best-practices#use-translation-keys)
-```
diff --git a/sites/dev/docs/reference/api/snippet/attr/readme.mdx b/sites/dev/docs/reference/api/snippet/attr/readme.mdx
index f61a504d78f..5178912bbb5 100644
--- a/sites/dev/docs/reference/api/snippet/attr/readme.mdx
+++ b/sites/dev/docs/reference/api/snippet/attr/readme.mdx
@@ -3,7 +3,7 @@ title: Snippet.attr()
---
The `Snippet.attr()` method can be used to add attributes to the Snippet
-object. It calls `this.attributes.add()` under the hood, and returns the
+object. It calls `this.attributes.add()` under the hood, and returns the
Snippet object.
If the third parameter is set to `true` it will call `this.attributes.set()`
@@ -29,18 +29,17 @@ This method is chainable as it returns the `Snippet` object
```js
({ Point, points, Path, paths, Snippet, snippets, part }) => {
-snippets.logo = new Snippet('logo', new Point(0,0))
-.attr("data-scale", 0.75)
-.attr("data-rotate", 180)
+ snippets.logo = new Snippet('logo', new Point(0,0))
+ .attr("data-scale", 0.75)
+ .attr("data-rotate", 180)
-// Prevent clipping
-paths.diag = new Path()
-.move(new Point(-25,-10))
-.move(new Point(25,35))
+ // Prevent clipping
+ paths.diag = new Path()
+ .move(new Point(-25,-10))
+ .move(new Point(25,35))
-return part
+ return part
}
-
```
@@ -48,4 +47,3 @@ return part
See [Using Attributes](/howtos/code/attributes)
for information about what Attributes can be used with Snippets.
:::
-```
diff --git a/sites/dev/docs/reference/api/snippet/rotate/readme.mdx b/sites/dev/docs/reference/api/snippet/rotate/readme.mdx
index 2aa89075917..4a8b237055a 100644
--- a/sites/dev/docs/reference/api/snippet/rotate/readme.mdx
+++ b/sites/dev/docs/reference/api/snippet/rotate/readme.mdx
@@ -21,22 +21,20 @@ This method is chainable as it returns the `Snippet` object
```js
({ Point, Path, paths, Snippet, snippets, part }) => {
-for (const i of [0,1,2,3,4,5,6]) {
-snippets[`demo${i}`] = new Snippet(
-"logo",
-new Point(60*i, 0)
-).rotate(60 * i)
+ for (const i of [0,1,2,3,4,5,6]) {
+ snippets[`demo${i}`] = new Snippet(
+ "logo",
+ new Point(60*i, 0)
+ ).rotate(60 * i)
+ }
+
+ // Prevent clipping
+ paths.diag = new Path()
+ .move(new Point(-30,-50))
+ .move(new Point(400,50))
+
+ return part
}
-
-// Prevent clipping
-paths.diag = new Path()
-.move(new Point(-30,-50))
-.move(new Point(400,50))
-
-return part
-}
-
```
-```
diff --git a/sites/dev/docs/reference/api/snippet/scale/readme.mdx b/sites/dev/docs/reference/api/snippet/scale/readme.mdx
index c3c9f49adcd..6eaea35d026 100644
--- a/sites/dev/docs/reference/api/snippet/scale/readme.mdx
+++ b/sites/dev/docs/reference/api/snippet/scale/readme.mdx
@@ -21,22 +21,20 @@ This method is chainable as it returns the `Snippet` object
```js
({ Point, Path, paths, Snippet, snippets, part }) => {
-for (const i of [1,2,3,4,5,6]) {
-snippets[`demo${i}`] = new Snippet(
-"logo",
-new Point(30\*i, 0)
-).scale(i/10)
+ for (const i of [1,2,3,4,5,6]) {
+ snippets[`demo${i}`] = new Snippet(
+ "logo",
+ new Point(30*i, 0)
+ ).scale(i/10)
+ }
+
+ // Prevent clipping
+ paths.diag = new Path()
+ .move(new Point(0,-30))
+ .move(new Point(200,20))
+
+ return part
}
-
-// Prevent clipping
-paths.diag = new Path()
-.move(new Point(0,-30))
-.move(new Point(200,20))
-
-return part
-}
-
```
-```
diff --git a/sites/dev/docs/reference/api/utils/beamintersectsline/readme.mdx b/sites/dev/docs/reference/api/utils/beamintersectsline/readme.mdx
index fc3976d8389..d30c3a6297e 100644
--- a/sites/dev/docs/reference/api/utils/beamintersectsline/readme.mdx
+++ b/sites/dev/docs/reference/api/utils/beamintersectsline/readme.mdx
@@ -24,7 +24,7 @@ Point | false utils.beamIntersectsLine(
```js
-;({ Point, points, Path, paths, Snippet, snippets, utils, part }) => {
+({ Point, points, Path, paths, Snippet, snippets, utils, part }) => {
points.A = new Point(45, 20)
points.B = new Point(60, 15)
points.C = new Point(10, 10)
diff --git a/sites/dev/docs/reference/api/utils/curveintersectsx/readme.mdx b/sites/dev/docs/reference/api/utils/curveintersectsx/readme.mdx
index c85f2eaee6f..4fe6f395f72 100644
--- a/sites/dev/docs/reference/api/utils/curveintersectsx/readme.mdx
+++ b/sites/dev/docs/reference/api/utils/curveintersectsx/readme.mdx
@@ -28,41 +28,40 @@ multiple intersections are found.
```js
({ Point, points, Path, paths, Snippet, snippets, utils, part }) => {
-points.start = new Point(10, 15)
-points.cp1 = new Point(80, 10)
-points.cp2 = new Point(-50, 80)
-points.end = new Point(110, 70)
+ points.start = new Point(10, 15)
+ points.cp1 = new Point(80, 10)
+ points.cp2 = new Point(-50, 80)
+ points.end = new Point(110, 70)
-paths.curve = new Path()
-.move(points.start)
-.curve(points.cp1, points.cp2, points.end)
+ paths.curve = new Path()
+ .move(points.start)
+ .curve(points.cp1, points.cp2, points.end)
-for (let x of [30, 40]) {
-points["from" + x] = new Point(x, 10)
-points["to" + x] = new Point(x, 80)
-paths["line" + x] = new Path()
-.move(points["from" + x])
-.line(points["to" + x])
-.addClass("lining dashed")
+ for (let x of [30, 40]) {
+ points["from" + x] = new Point(x, 10)
+ points["to" + x] = new Point(x, 80)
+ paths["line" + x] = new Path()
+ .move(points["from" + x])
+ .line(points["to" + x])
+ .addClass("lining dashed")
+ }
+
+ snippets.i40 = new Snippet(
+ "notch",
+ utils.curveIntersectsX(points.start, points.cp1, points.cp2, points.end, 40)
+ )
+
+ for (let p of utils.curveIntersectsX(
+ points.start,
+ points.cp1,
+ points.cp2,
+ points.end,
+ 30
+ ))
+ snippets[p.y] = new Snippet("notch", p)
+
+ return part
}
-
-snippets.i40 = new Snippet(
-"notch",
-utils.curveIntersectsX(points.start, points.cp1, points.cp2, points.end, 40)
-)
-
-for (let p of utils.curveIntersectsX(
-points.start,
-points.cp1,
-points.cp2,
-points.end,
-30
-))
-snippets[p.y] = new Snippet("notch", p)
-
-return part
-}
-
```
@@ -73,4 +72,3 @@ This is a low-level (and faster) variant
of [`Path.intersectsX()`](/reference/api/path/intersectsx).
Instead of a path, you describe a single curve by passing the four
points that describes it.
-```
diff --git a/sites/dev/docs/reference/api/utils/curveintersectsy/readme.mdx b/sites/dev/docs/reference/api/utils/curveintersectsy/readme.mdx
index d842e8b8022..4c5234ca1f9 100644
--- a/sites/dev/docs/reference/api/utils/curveintersectsy/readme.mdx
+++ b/sites/dev/docs/reference/api/utils/curveintersectsy/readme.mdx
@@ -22,47 +22,46 @@ a single intersection is found, and an array
of [Point](/reference/api/point/) objects if
multiple intersections are found.
-## Example
+## Example
```js
({ Point, points, Path, paths, Snippet, snippets, utils, part }) => {
-points.start = new Point(10, 45)
-points.cp1 = new Point(50, 10)
-points.cp2 = new Point(0, 80)
-points.end = new Point(110, 70)
+ points.start = new Point(10, 45)
+ points.cp1 = new Point(50, 10)
+ points.cp2 = new Point(0, 80)
+ points.end = new Point(110, 70)
-paths.curve = new Path()
-.move(points.start)
-.curve(points.cp1, points.cp2, points.end)
+ paths.curve = new Path()
+ .move(points.start)
+ .curve(points.cp1, points.cp2, points.end)
-for (let y of [40, 50]) {
-points["from" + y] = new Point(10, y)
-points["to" + y] = new Point(110, y)
-paths["line" + y] = new Path()
-.move(points["from" + y])
-.line(points["to" + y])
-.addClass("lining dashed")
+ for (let y of [40, 50]) {
+ points["from" + y] = new Point(10, y)
+ points["to" + y] = new Point(110, y)
+ paths["line" + y] = new Path()
+ .move(points["from" + y])
+ .line(points["to" + y])
+ .addClass("lining dashed")
+ }
+
+ snippets.i50 = new Snippet(
+ "notch",
+ utils.curveIntersectsY(points.start, points.cp1, points.cp2, points.end, 50)
+ )
+
+ for (let p of utils.curveIntersectsY(
+ points.start,
+ points.cp1,
+ points.cp2,
+ points.end,
+ 40
+ ))
+ snippets[p.x] = new Snippet("notch", p)
+
+ return part
}
-
-snippets.i50 = new Snippet(
-"notch",
-utils.curveIntersectsY(points.start, points.cp1, points.cp2, points.end, 50)
-)
-
-for (let p of utils.curveIntersectsY(
-points.start,
-points.cp1,
-points.cp2,
-points.end,
-40
-))
-snippets[p.x] = new Snippet("notch", p)
-
-return part
-}
-
```
@@ -72,4 +71,3 @@ This is a low-level (and faster) variant
of [`Path.intersectsY()`](/reference/api/path/intersectsy).
Instead of a path, you describe a single curve by passing the four
points that describes it.
-```
diff --git a/sites/dev/docs/reference/api/utils/curvesintersect/readme.mdx b/sites/dev/docs/reference/api/utils/curvesintersect/readme.mdx
index 2fb5174b1f9..599f1c3d1c4 100644
--- a/sites/dev/docs/reference/api/utils/curvesintersect/readme.mdx
+++ b/sites/dev/docs/reference/api/utils/curvesintersect/readme.mdx
@@ -31,45 +31,43 @@ multiple intersections are found.
```js
({ Point, points, Path, paths, Snippet, snippets, utils, getId, part }) => {
-points.A = new Point(10, 10)
-points.Acp = new Point(310, 40)
-points.B = new Point(110, 70)
-points.Bcp = new Point(-210, 40)
+ points.A = new Point(10, 10)
+ points.Acp = new Point(310, 40)
+ points.B = new Point(110, 70)
+ points.Bcp = new Point(-210, 40)
-points.C = new Point(20, -5)
-points.Ccp = new Point(60, 300)
-points.D = new Point(100, 85)
-points.Dcp = new Point(70, -220)
-paths.curveA = new Path()
-.move(points.A)
-.curve(points.Acp, points.Bcp, points.B)
-paths.curveB = new Path()
-.move(points.C)
-.curve(points.Ccp, points.Dcp, points.D)
+ points.C = new Point(20, -5)
+ points.Ccp = new Point(60, 300)
+ points.D = new Point(100, 85)
+ points.Dcp = new Point(70, -220)
+ paths.curveA = new Path()
+ .move(points.A)
+ .curve(points.Acp, points.Bcp, points.B)
+ paths.curveB = new Path()
+ .move(points.C)
+ .curve(points.Ccp, points.Dcp, points.D)
-const intersections = utils.curvesIntersect(
-points.A,
-points.Acp,
-points.Bcp,
-points.B,
-points.C,
-points.Ccp,
-points.Dcp,
-points.D
-)
+ const intersections = utils.curvesIntersect(
+ points.A,
+ points.Acp,
+ points.Bcp,
+ points.B,
+ points.C,
+ points.Ccp,
+ points.Dcp,
+ points.D
+ )
-if (intersections) {
-if (intersections instanceof Array) {
-for (const p of intersections)
-snippets[getId()] = new Snippet('notch', p)
-} else {
-snippets[getId()] = new Snippet('notch', intersections)
+ if (intersections) {
+ if (intersections instanceof Array) {
+ for (const p of intersections)
+ snippets[getId()] = new Snippet('notch', p)
+ } else {
+ snippets[getId()] = new Snippet('notch', intersections)
+ }
+ }
+
+ return part
}
-}
-
-return part
-}
-
```
-```