| Summary: | Add support for computing the nearest point on an ICurve with respect to a given reference point. | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Alexander Nyßen <nyssen> |
| Component: | GEF Geometry | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | matthias.wienand |
| Version: | 0.2.0 | ||
| Target Milestone: | 4.0.0 (Neon) M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 488353 | ||
|
Description
Alexander Nyßen
As all ICurves can be broken down into BezierCurves, this basically boils down to computing a point projection on a BezierCurve. I pushed the following to changes to master: - Added and implemented ICurve#getProjection(Point) that returns a point on the ICurve with minimal distance to the given reference point. - Added tests for the point projection onto Bézier curves. However, for a complete implementations, the following cases have to be taken into consideration as well: - A point can be projected onto multiple points with the same, minimal distance, for example, when the start and end point of a parabola are closest to the reference point. - A point can be projected onto infinite points with the same, minimal distance, for example, when the curve is circular (Arc, Ellipse) and the reference point is the center of the corresponding circle. Therefore, I would suggest to remove the ICurve#getProjection(Point):Point method, and provide the following set of methods instead: - ICurve#isInfiniteProjection(Point):boolean returns true if the given point can be projected onto an infinte number of points on the curve. - ICurve#getInfiniteProjection(Point):List<ICurve> returns the individual curves that describe all possible projections. - ICurve#getProjections(Point):List<Point> returns the points on the curve with the same, minimal distance to the given reference point. The implemented functionality is sufficient for the anchor computation, therefore, I resolve this as fixed for 4.0.0 M6. The functionality that is outlined in comment #2 can be added at a later point if needed. |