Table of Contents

Class ClosestEdge2

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

Picking the one piece of a shape that lies nearest something else.

public static class ClosestEdge2
Inheritance
ClosestEdge2
Inherited Members

Remarks

This answers a different question from Projection2, which builds the segment joining two shapes. Nothing is built here: one of the shape's own edges is handed back, whole, the one lying nearest the probe.

The probe is always a single primitive — a point, a segment, a circle or an arc. A shape that is itself made of edges is not offered, because the nearest edge of one such shape to another is really a pair of edges, and that is a different answer from the one this name promises.

Each edge is measured on its own, so a probe lying inside a closed shape still names the edge nearest it rather than reporting nothing, which is where this parts company with Distance2. Where two edges are equally near — and a probe crossing the outline touches several at nothing at all — the earlier one in the shape's own order wins, so the answer does not drift from one run to the next.

Every shape measures each of its edges as its own distance does: a straight side no longer than the point tolerance is the side it is, not the point at its start, and a segment you give no longer than the tolerance is read as its start where it crosses no side. At a hundredth, the loop (0, 0), (10, 0), (10, 0.006), (0, 10) names its side 0.006 long for the point (10.03, 0.003), 0.03 from it, where read as its start it stood 0.0301496 off, as far as the side along the bottom, which came first. A polygon, a polyline and a rectangle take no tolerance here: they measure every side exactly, and read a segment you give as its start by the global tolerance. The rectangle 10 by 0.0006 on the origin names its right-hand side, 0.0006 long, for the point (10.03, 0.0003).

Methods

GetClosestEdge(GeoPolygon2, GeoCircle2)

Gets the edge of a polygon nearest a circle.

GetClosestEdge(GeoPolygon2, GeoLine2)

Gets the edge of a polygon nearest a segment.

GetClosestEdge(GeoPolygon2, GeoPoint2)

Gets the edge of a polygon nearest a point.

GetClosestEdge(GeoPolygonArc2, GeoArc2)

Gets the edge of a curved loop nearest an arc.

GetClosestEdge(GeoPolygonArc2, GeoArc2, Tolerance)

Gets the edge of a curved loop nearest an arc, within a tolerance.

GetClosestEdge(GeoPolygonArc2, GeoCircle2)

Gets the edge of a curved loop nearest a circle.

GetClosestEdge(GeoPolygonArc2, GeoCircle2, Tolerance)

Gets the edge of a curved loop nearest a circle, within a tolerance.

GetClosestEdge(GeoPolygonArc2, GeoLine2)

Gets the edge of a curved loop nearest a segment.

GetClosestEdge(GeoPolygonArc2, GeoLine2, Tolerance)

Gets the edge of a curved loop nearest a segment, within a tolerance.

GetClosestEdge(GeoPolygonArc2, GeoPoint2)

Gets the edge of a curved loop nearest a point.

GetClosestEdge(GeoPolygonArc2, GeoPoint2, Tolerance)

Gets the edge of a curved loop nearest a point, within a tolerance.

GetClosestEdge(GeoPolyline2, GeoCircle2)

Gets the edge of a polyline nearest a circle.

GetClosestEdge(GeoPolyline2, GeoLine2)

Gets the edge of a polyline nearest a segment.

GetClosestEdge(GeoPolyline2, GeoPoint2)

Gets the edge of a polyline nearest a point.

GetClosestEdge(GeoPolylineArc2, GeoArc2)

Gets the edge of a curved chain nearest an arc.

GetClosestEdge(GeoPolylineArc2, GeoArc2, Tolerance)

Gets the edge of a curved chain nearest an arc, within a tolerance.

GetClosestEdge(GeoPolylineArc2, GeoCircle2)

Gets the edge of a curved chain nearest a circle.

GetClosestEdge(GeoPolylineArc2, GeoCircle2, Tolerance)

Gets the edge of a curved chain nearest a circle, within a tolerance.

GetClosestEdge(GeoPolylineArc2, GeoLine2)

Gets the edge of a curved chain nearest a segment.

GetClosestEdge(GeoPolylineArc2, GeoLine2, Tolerance)

Gets the edge of a curved chain nearest a segment, within a tolerance.

GetClosestEdge(GeoPolylineArc2, GeoPoint2)

Gets the edge of a curved chain nearest a point.

GetClosestEdge(GeoPolylineArc2, GeoPoint2, Tolerance)

Gets the edge of a curved chain nearest a point, within a tolerance.

GetClosestEdge(GeoRectangle2, GeoCircle2)

Gets the edge of a rectangle nearest a circle.

GetClosestEdge(GeoRectangle2, GeoLine2)

Gets the edge of a rectangle nearest a segment.

GetClosestEdge(GeoRectangle2, GeoPoint2)

Gets the edge of a rectangle nearest a point.