1
0
Fork 0

fix(docs): Add warning to curve intersection methods and functions

This commit is contained in:
Benjamin F 2023-04-04 22:04:53 -07:00
parent b5f58fafd0
commit 080c75e733
7 changed files with 65 additions and 21 deletions

View file

@ -5,11 +5,18 @@ title: utils.curveIntersectsY()
The `utils.curveIntersectsY()` function finds the point(s) where a curve
intersects a given Y-value.
<Warning>
This function can sometimes fail to find intersections in some curves
due to a limitation in an underlying Bézier library.
Please see [Bug #3367](https://github.com/freesewing/freesewing/issues/3367)
for more information.
</Warning>
## Signature
```js
array | Point | false utils.curveIntersectsY(
Point start,
Point start,
Point cp1,
Point cp2,
Point end,
@ -32,11 +39,11 @@ multiple intersections are found.
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)
for (let y of [40, 50]) {
points["from" + y] = new Point(10, y)
points["to" + y] = new Point(110, y)
@ -45,12 +52,12 @@ multiple intersections are found.
.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,
@ -71,5 +78,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.