Comments (7)
hi @harjis can you please file this as a new issue. Closed issues should remain closed, to keep single issues tied to single PRs.
from bezierjs.
Further investigation reveals that the problem is something to do with the fact that my line is a perfectly straight horizontal line. If I vary the y
coordinate on either end of the line by even so much as 0.00000001
, then the intercept is found. It's only when they're equal that the intercept fails.
from bezierjs.
hm, that sounds like somewhere the y delta being 0 is leading to bad stuff... division by zero perhaps. Good find!
from bezierjs.
No worries. Great library overall though, so thanks- it's saved me a tonne of time!
from bezierjs.
Vertical lines too.
But it works:
var vertical = {
p1: { x: x, y: 0 },
p2: { x: x + 1e-10, y: 1 },
};
bezier.intersects(vertical);
from bezierjs.
Hi!
First of all great work with the library! Has saved me a ton of time.
The issue I have is an intersection with cubic bezier curves and straight horizontal bezier curve. My code is as follows:
const r = 150;
const k = 0.55228;
const circleArc = [
{ x: r * 2, y: r }, // Intersection point
{ x: r * 2, y: r + k * r },
{ x: r + k * r, y: r * 2 },
{ x: r, y: r * 2 }
];
const straightLine = [
{ x: r, y: r },
{ x: r * 2, y: r }, //Intersection point
{ x: r * 2 + k * r, y: r },
{ x: r * 4, y: r }
];
const circleArcBezier = new Bezier([...circleArc]);
const straighLineBezier = new Bezier([...straightLine]);
console.log(circleArcBezier.intersects(straighLineBezier)); // Empty array
To my understanding the lines should intersect each other at point { x: r * 2, y: r }
. Also If I change the straight line even 1px the intersection is detected.
I'm not sure if this is the same issue as in #70 so I commented here.
Thanks again for your awesome work!
from bezierjs.
Oh yeah and this happens in Chrome Version 58.0.3029.110 (64-bit) and Firefox 53.0.3 (64-bit) at least with version 2.2.3
from bezierjs.
Related Issues (20)
- Release v6.1.2 broken HOT 3
- Why get(t = 0.5) point is not the middle point of the curve? HOT 5
- Find optmal D1 - Bezier.cubicFromPoints HOT 1
- PolyBezier is not exported correct for ES Module. HOT 3
- Rational Bezier Curve Support HOT 1
- Example usage of `dist/bezier.js` HOT 4
- How to make a "strict" version of bezier.project(point)? HOT 2
- Should bezier.lineIntersects(line) work for line-line intersections? HOT 3
- intersects bug Bezier to Bezier HOT 3
- Suspicious line in `utils.compute()` HOT 2
- The intersection of the two bezier is empty HOT 10
- The intersection of two identical curves HOT 2
- Intersect line method does not always return existing intersections HOT 6
- Ability to get and estimate the centerline of a list of 3D points HOT 3
- PR for extending API to interpolate values along curve and find point on curve at distance?
- Artifact when offsetting an SVG path
- Split curves do not follow old curve. HOT 2
- Missing LICENSE file HOT 1
- How to Find Y-Coordinate for a Given X-Coordinate on a Bezier Curve HOT 3
- Q: PolyBezier surface calculation HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bezierjs.