feat: Flat import of markdown repo
This is a flat (without history) import of (some of) the content from our markdown module. We've imported this without history because the repo contains our blog posts and showcases posts content prior to porting them to strapi. Since this contains many images, it would balloon the size of this repo to import the full history. Instead, please refer to the history of the (archived) markdown repo at: https://github.com/freesewing/markdown
This commit is contained in:
parent
1671a896b5
commit
b34a2ee2ed
6132 changed files with 244167 additions and 0 deletions
54
markdown/dev/reference/api/utils/lineintersectscurve/en.md
Normal file
54
markdown/dev/reference/api/utils/lineintersectscurve/en.md
Normal file
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
title: lineIntersectsCurve()
|
||||
---
|
||||
|
||||
```js
|
||||
array | false utils.lineIntersectsCurve(
|
||||
Point from,
|
||||
Point to,
|
||||
Point start,
|
||||
Point cp1,
|
||||
Point cp2,
|
||||
Point end
|
||||
)
|
||||
```
|
||||
|
||||
Finds the intersection between a line segment from point `from` to point `to`
|
||||
and a curve described by points `start`, `cp1`, `cp2, and `end`.
|
||||
|
||||
<Example part="utils_lineintersectscurve" caption="A Utils.lineIntersectsCurve() example" />
|
||||
|
||||
```js
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
utils
|
||||
} = part.shorthand();
|
||||
|
||||
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.E = new Point(20, -5);
|
||||
points.D = new Point(100, 85);
|
||||
paths.curve = new Path()
|
||||
.move(points.A)
|
||||
.curve(points.Acp, points.Bcp, points.B);
|
||||
paths.line = new Path().move(points.E).line(points.D);
|
||||
|
||||
for (let p of utils.lineIntersectsCurve(
|
||||
points.D,
|
||||
points.E,
|
||||
points.A,
|
||||
points.Acp,
|
||||
points.Bcp,
|
||||
points.B
|
||||
)) {
|
||||
snippets[part.getId()] = new Snippet("notch", p);
|
||||
}
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue