Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intersectBezier2Circle and intersectBeziers2Rectangle return not expected result for horizontal and vertical lines #48

Open
olivTo opened this issue Dec 26, 2019 · 0 comments

Comments

@olivTo
Copy link

olivTo commented Dec 26, 2019

I'm having an issue for some particular cases of intersection with Bezier curve, when the curve is actually a line (same abscissa or same ordinate for start point, end point and control point).
The return using and intersectBezier2Circle is empty.
The returned point using and intersectBeziers2Rectangle is the end point.
For the moment i use a work around consisting in delegate the compute to intersectCircleLine and intersectLineRectangle, but i think it would be better if these limit cases will be managed.

The use cases :

intersectBezier2Circle

const start = new Point2D(-621.1, 629);
const control = new Point2D(-461.70000000000005, 629);
const end = new Point2D(-302.3, 629);
const radius = 38.9;
Intersection.intersectBezier2Circle(start, control, end, end, radius);
result = [];

intersectBeziers2Rectangle

const start = new Point2D(-621.1, 629);
const control = new Point2D(-461.70000000000005, 629);
const end = new Point2D(-302.3, 629);
const r1 = new Point2D(-321, 609);
const r2: new Point2D(-279, 645);
Intersection.intersectBezier2Rectangle(start, control, end, r1, r2);
result = [Point2D{x: -302.3, y: 629}, Point2D{x: -302.3, y: 629}];
@olivTo olivTo changed the title Intersections Bezier2Circle and Beziers2Rectangle return the end point for horizontal and vertical lines intersectBezier2Circle and intersectBeziers2Rectangle return not expected result for horizontal and vertical lines Dec 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant