Skip to content

intersectionsWithCurve not working with greater values #25

Open
@okandemirofficial

Description

@okandemirofficial

Hi! Thanks for the great package. It works very well and helps a lot. However, I recognized intersectionsWithCurve method was not working in greater values. Here are the details:

Scenario 1 (Works):

  • I am using some smaller numbers
final line =
        CubicBezier([Vector2(100, 100), Vector2(200, 100), Vector2(200, 100), Vector2(400, 100)]);
final curve =
        CubicBezier([Vector2(200, 50), Vector2(350, 150), Vector2(350, 150), Vector2(200, 200)]);

 final intersection = line.intersectionsWithCurve(curve);
 debugPrint('${intersection.length}');

>>> 1

Scenario 2 (Not work):

  • Bigger numbers
final line =
        CubicBezier([Vector2(100, 100), Vector2(400, 100), Vector2(400, 100), Vector2(3000, 100)]);

final curve = CubicBezier(
        [Vector2(2000, 50), Vector2(2350, 150), Vector2(2350, 150), Vector2(2000, 200)]);

 final intersection = line.intersectionsWithCurve(curve);
 debugPrint('${intersection.length}');

>>> 0

I also tried to increase curveIntersectionThreshold and decrease minTValueDifference but it did not help me. Would you happen to know any fixes/workarounds? I am not well-informed about bezier curves and might be wrong about some concepts. Thanks in advance!

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