Skip to content

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

@olivTo

Description

@olivTo

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}];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions