Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 485607

Summary: [GEF4] geometry intersection not found
Product: [Tools] GEF Reporter: Sylvain Bi <sylvain.bilange>
Component: GEF GeometryAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand
Version: unspecified   
Target Milestone: 4.0.0 / 3.11.0 (Neon) M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Sylvain Bi CLA 2016-01-12 03:44:36 EST
GEF VERSION : 0.3.0  M3
=======================

Hello, I am trying to find an intersection between a BezierCurve and a Line

But it fails with this code :

Code:
Line line = new Line(new Point(14.5428, -10000.0), new Point(14.5428, 10000.0));
BezierCurve curve = new BezierCurve(new Point(24.200000000000077, -2.3727936609778726), new Point(17.56250052131255, -2.372947931952322), new Point(13.137498435758783, -2.3730630604781013), new Point(6.499999999999994, -2.372678596158668));
Point[] intersectionPoint = line.getIntersections(curve);


No intersections are found (empty array returned, length = 0)
if I decrease my line Y bounds (1000.0 instead of 10000.0) :

Code:
Line line = new Line(new Point(14.5428, 1000.0), new Point(14.5428, 1000.0));


the intersection is found
Comment 1 Matthias Wienand CLA 2016-01-15 07:09:28 EST
Nice finding! The intersection slipped through the convergence test. I ensured that if one of the two curves converges to a single point, this point is tested on the other curve for containment, regardless of the size of the other curve. This fixes the issue. In order to prevent this mistake in the future, I added a test case for the data provided by you. The code is published on the master branch, therefore, I resolve this ticket as fixed for 3.11.0M5.