Method Join
- Namespace
- GeometryHelper.Extension
- Assembly
- GeometryHelper.dll
Join(IEnumerable<GeoLine2>)
Joins segments into chains by matching their endpoints, as a drafting program's JOIN does.
public static GeoPolyline2[] Join(this IEnumerable<GeoLine2> lines)
Parameters
linesIEnumerable<GeoLine2>
Returns
Join(IEnumerable<GeoLine2>, Tolerance)
Joins segments into chains by matching their endpoints, within a tolerance.
public static GeoPolyline2[] Join(this IEnumerable<GeoLine2> lines, Tolerance tolerance)
Parameters
linesIEnumerable<GeoLine2>The segments, in any order and pointing either way.
toleranceToleranceThe tolerance: two ends nearer than this count as meeting.
Returns
- GeoPolyline2[]
One chain for every unbroken run, with redundant junctions between collinear pieces removed.
Remarks
Where three or more segments meet at a point, which one a run takes up is settled by input order: at a fork there is no geometric reason to prefer one branch. The answer is the same every time for a given input, but reordering the input can move a branch from one run to another.
Exceptions
- ArgumentNullException
Thrown when
linesis null.
Join(IEnumerable<GeoLine3>)
Joins segments into chains by matching their endpoints.
public static GeoPolyline3[] Join(this IEnumerable<GeoLine3> lines)
Parameters
linesIEnumerable<GeoLine3>
Returns
Join(IEnumerable<GeoLine3>, Tolerance)
Joins segments into chains by matching their endpoints, within a tolerance.
public static GeoPolyline3[] Join(this IEnumerable<GeoLine3> lines, Tolerance tolerance)
Parameters
linesIEnumerable<GeoLine3>The segments, in any order and pointing either way.
toleranceToleranceThe tolerance: two ends nearer than this count as meeting.
Returns
- GeoPolyline3[]
One chain for every unbroken run.
Exceptions
- ArgumentNullException
Thrown when
linesis null.
Join(IEnumerable<GeoPolyline3>)
Joins chains into longer chains by matching their ends.
public static GeoPolyline3[] Join(this IEnumerable<GeoPolyline3> polylines)
Parameters
polylinesIEnumerable<GeoPolyline3>
Returns
Join(IEnumerable<GeoPolyline3>, Tolerance)
Joins chains into longer chains by matching their ends, within a tolerance.
public static GeoPolyline3[] Join(this IEnumerable<GeoPolyline3> polylines, Tolerance tolerance)
Parameters
polylinesIEnumerable<GeoPolyline3>The chains, in any order and running either way.
toleranceToleranceThe tolerance.
Returns
- GeoPolyline3[]
One chain for every unbroken run.
Exceptions
- ArgumentNullException
Thrown when
polylinesis null.