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: beamIntersectsCircle()
|
||||
---
|
||||
title: beamIntersectsCircle()
|
||||
---
|
||||
|
||||
```js
|
||||
array | false utils.beamIntersectsCircle(
|
||||
|
@ -16,13 +16,13 @@ Finds the intersection between an endless line through points `point1` and `poin
|
|||
and a circle with its center at point `center` and a radius of `radius` mm.
|
||||
|
||||
The 5th and last parameter controls the *sorting* of the found intersections.
|
||||
This will (almost) always return 2 intersections, and you can choose how
|
||||
This will (almost) always return 2 intersections, and you can choose how
|
||||
they are ordered in the returned array:
|
||||
|
||||
Set sort to:
|
||||
|
||||
* `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)
|
||||
- `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)
|
||||
|
||||
<Example part="utils_beamintersectscircle" caption="A Utils.beamIntersectsCircle() example" />
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: beamIntersectsX()
|
||||
---
|
||||
title: beamIntersectsX()
|
||||
---
|
||||
|
||||
```js
|
||||
Point | false utils.beamIntersectsX(Point A, Point B, float X)
|
||||
|
@ -34,3 +34,4 @@ for the intersection, or `false` there is no intersection.
|
|||
.line(new Point(40, 35))
|
||||
.attr("class", "note dashed");
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: beamIntersectsY()
|
||||
---
|
||||
title: beamIntersectsY()
|
||||
---
|
||||
|
||||
```js
|
||||
Point | false utils.beamIntersectsY(Point A, Point B, float Y)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: beamsIntersect()
|
||||
---
|
||||
title: beamsIntersect()
|
||||
---
|
||||
|
||||
```js
|
||||
Point | false utils.beamsIntersect(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: circlesIntersect()
|
||||
---
|
||||
title: circlesIntersect()
|
||||
---
|
||||
|
||||
```js
|
||||
array | false utils.circlesIntersect(
|
||||
|
@ -19,8 +19,8 @@ When this returns 2 intersections, you can choose how they are ordered in the re
|
|||
|
||||
Set sort to:
|
||||
|
||||
* `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)
|
||||
- `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)
|
||||
|
||||
<Example part="utils_circlesintersect" caption="A Utils.circlesIntersect() example" />
|
||||
|
||||
|
@ -59,3 +59,4 @@ snippets.second1 = new Snippet("notch", intersections1[1]);
|
|||
snippets.first2 = new Snippet("bnotch", intersections2[0]);
|
||||
snippets.second2 = new Snippet("notch", intersections2[1]);
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: curveIntersectsX()
|
||||
---
|
||||
title: curveIntersectsX()
|
||||
---
|
||||
|
||||
```js
|
||||
array | Point | false utils.curveIntersectsX(
|
||||
|
@ -13,15 +13,15 @@ array | Point | false utils.curveIntersectsX(
|
|||
|
||||
Finds the point(s) where a curve intersects a given X-value.
|
||||
|
||||
This is a low-level variant
|
||||
This is a low-level variant
|
||||
of [`Path.intersectsX()`](/en/docs/developer/api/path/#pathintersectsx).
|
||||
Instead of a path, you describe a single curve by passing the four
|
||||
points that describes it.
|
||||
|
||||
This returns `false` if no intersections are found,
|
||||
a [Point](/en/docs/developer/api/point/) object if
|
||||
a single intersection is found, and an array
|
||||
of [Point](/en/docs/developer/api/point/) objects if
|
||||
This returns `false` if no intersections are found,
|
||||
a [Point](/en/docs/developer/api/point/) object if
|
||||
a single intersection is found, and an array
|
||||
of [Point](/en/docs/developer/api/point/) objects if
|
||||
multiple intersections are found.
|
||||
|
||||
<Example part="utils_curveintersectsx" caption="A Utils.curveIntersectX() example" />
|
||||
|
@ -69,3 +69,4 @@ for (let p of utils.curveIntersectsX(
|
|||
))
|
||||
snippets[p.y] = new Snippet("notch", p);
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: curveIntersectsY()
|
||||
---
|
||||
title: curveIntersectsY()
|
||||
---
|
||||
|
||||
```js
|
||||
array | Point | false utils.curveIntersectsY(
|
||||
|
@ -13,15 +13,15 @@ array | Point | false utils.curveIntersectsY(
|
|||
|
||||
Finds the point(s) where a curve intersects a given Y-value.
|
||||
|
||||
This is a low-level variant
|
||||
This is a low-level variant
|
||||
of [`Path.intersectsY()`](/en/docs/developer/api/path/#pathintersectsy).
|
||||
Instead of a path, you describe a single curve by passing the four
|
||||
points that describes it.
|
||||
|
||||
This returns `false` if no intersections are found,
|
||||
a [Point](/en/docs/developer/api/point/) object if
|
||||
a single intersection is found, and an array
|
||||
of [Point](/en/docs/developer/api/point/) objects if
|
||||
This returns `false` if no intersections are found,
|
||||
a [Point](/en/docs/developer/api/point/) object if
|
||||
a single intersection is found, and an array
|
||||
of [Point](/en/docs/developer/api/point/) objects if
|
||||
multiple intersections are found.
|
||||
|
||||
<Example part="utils_curveintersectsy" caption="A Utils.curveIntersectY() example" />
|
||||
|
@ -69,3 +69,4 @@ for (let p of utils.curveIntersectsY(
|
|||
))
|
||||
snippets[p.x] = new Snippet("notch", p);
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: curvesIntersect()
|
||||
---
|
||||
title: curvesIntersect()
|
||||
---
|
||||
|
||||
```js
|
||||
array | false utils.curvesIntersect(
|
||||
|
@ -58,3 +58,4 @@ for (let p of utils.curvesIntersect(
|
|||
snippets[part.getId()] = new Snippet("notch", p);
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: deg2rad()
|
||||
---
|
||||
title: deg2rad()
|
||||
---
|
||||
|
||||
```js
|
||||
float deg2rad(float degrees)
|
||||
|
@ -10,3 +10,4 @@ Returns the degrees you pass to it as radians.
|
|||
|
||||
This is useful for when you use methods like `Math.cos()` that expects a corner
|
||||
in radians, when we typically use degrees.
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Utils
|
||||
order: 95
|
||||
---------
|
||||
---
|
||||
|
||||
The `Utils` object provides the following utility methods to facilitate your work:
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: lineIntersectsCircle()
|
||||
---
|
||||
title: lineIntersectsCircle()
|
||||
---
|
||||
|
||||
```js
|
||||
array | false utils.lineIntersectsCircle(
|
||||
|
@ -20,8 +20,8 @@ When this returns 2 intersections, you can choose how they are ordered in the re
|
|||
|
||||
Set sort to:
|
||||
|
||||
* `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)
|
||||
- `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)
|
||||
|
||||
<Example part="utils_lineintersectscircle" caption="A Utils.lineIntersectsCircle() example" />
|
||||
|
||||
|
@ -76,3 +76,4 @@ snippets.second2 = new Snippet("notch", intersections2[1]);
|
|||
snippets.first3 = new Snippet("bnotch", intersections3[0]);
|
||||
snippets.second3 = new Snippet("notch", intersections3[1]);
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: lineIntersectsCurve()
|
||||
---
|
||||
title: lineIntersectsCurve()
|
||||
---
|
||||
|
||||
```js
|
||||
array | false utils.lineIntersectsCurve(
|
||||
|
@ -14,7 +14,7 @@ array | false utils.lineIntersectsCurve(
|
|||
```
|
||||
|
||||
Finds the intersection between a line segment from point `from` to point `to`
|
||||
and a curve described by points `start`, `cp1`, `cp2, and `end\`.
|
||||
and a curve described by points `start`, `cp1`, `cp2, and `end`.
|
||||
|
||||
<Example part="utils_lineintersectscurve" caption="A Utils.lineIntersectsCurve() example" />
|
||||
|
||||
|
@ -51,3 +51,4 @@ for (let p of utils.lineIntersectsCurve(
|
|||
snippets[part.getId()] = new Snippet("notch", p);
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: linesIntersect()
|
||||
---
|
||||
title: linesIntersect()
|
||||
---
|
||||
|
||||
```js
|
||||
Point | false utils.linesIntersect(
|
||||
|
@ -40,3 +40,5 @@ snippets.X = new Snippet(
|
|||
utils.linesIntersect(points.A, points.B, points.C, points.D)
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: pointOnBeam()
|
||||
---
|
||||
title: pointOnBeam()
|
||||
---
|
||||
|
||||
```js
|
||||
bool utils.pointOnBeam(
|
||||
|
@ -18,8 +18,8 @@ The fourth parameter controls the precision. Lower numbers make the check less p
|
|||
|
||||
###### Tweak precision only when needed
|
||||
|
||||
Typically, you don't need to worry about precision. But occasionally, you may get
|
||||
unexpected results because of floating point errors, rounding errors, or
|
||||
Typically, you don't need to worry about precision. But occasionally, you may get
|
||||
unexpected results because of floating point errors, rounding errors, or
|
||||
cubic bezier juggling.
|
||||
|
||||
When that happens, you can lower the precision so you get what you expect.
|
||||
|
@ -79,3 +79,4 @@ paths.lne2 = new Path()
|
|||
.line(points.b2)
|
||||
.attr("class", "fabric dashed");
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: pointOnCurve()
|
||||
---
|
||||
title: pointOnCurve()
|
||||
---
|
||||
|
||||
```js
|
||||
bool utils.pointOnCurve(
|
||||
|
@ -64,3 +64,4 @@ paths.curve = new Path()
|
|||
.curve(points.cp1, points.cp2, points.end)
|
||||
.attr("class", "fabric stroke-lg");
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: pointOnLine()
|
||||
---
|
||||
title: pointOnLine()
|
||||
---
|
||||
|
||||
```js
|
||||
bool utils.pointOnLine(
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
***
|
||||
|
||||
## title: rad2deg()
|
||||
---
|
||||
title: rad2deg()
|
||||
---
|
||||
|
||||
```js
|
||||
float rad2deg(float radians)
|
||||
```
|
||||
|
||||
Returns the radians you pass to it as degrees.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: round()
|
||||
---
|
||||
title: round()
|
||||
---
|
||||
|
||||
```js
|
||||
float utils.round(float value)
|
||||
|
@ -8,5 +8,6 @@ float utils.round(float value)
|
|||
|
||||
Rounds a value to two decimals. For example:
|
||||
|
||||
* 0.1234 becomes 0.12
|
||||
* 5.6789 becomes 5.68
|
||||
- 0.1234 becomes 0.12
|
||||
- 5.6789 becomes 5.68
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: stretchToScale()
|
||||
---
|
||||
title: stretchToScale()
|
||||
---
|
||||
|
||||
```js
|
||||
float utils.stretchToScale(float stretch)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
***
|
||||
|
||||
## title: units()
|
||||
---
|
||||
title: units()
|
||||
---
|
||||
|
||||
```js
|
||||
string utils.units(float value, string format = 'metric')
|
||||
|
@ -16,3 +16,5 @@ The [Part.shorthand](/reference/api/part/shorthand/) call provides a context-awa
|
|||
`unit()` method that will call this method and pass it the units requested by the user.
|
||||
|
||||
</Tip>
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue