Table of Contents

Method ConsecutiveLines

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

ConsecutiveLines(IEnumerable<GeoLine2>)

Rejoins the segments of a classified run that end where the next one begins, using the default tolerance.

public static GeoLine2[] ConsecutiveLines(IEnumerable<GeoLine2> segments)

Parameters

segments IEnumerable<GeoLine2>

Returns

GeoLine2[]

ConsecutiveLines(IEnumerable<GeoLine2>, Tolerance)

Rejoins the segments of a classified run that end where the next one begins.

public static GeoLine2[] ConsecutiveLines(IEnumerable<GeoLine2> segments, Tolerance tolerance)

Parameters

segments IEnumerable<GeoLine2>

The pieces landing on one side, in order along the subject.

tolerance Tolerance

The tolerance.

Returns

GeoLine2[]

One segment per unbroken stretch, in order along the subject.

Remarks

Pieces arrive here already sorted onto one side of the cutter, so two that touch were parted by a cut that turned out to separate nothing — the far side of it landed on this side too. Handing back both would report a seam the caller has no way to account for.

Joining start to end looks careless, since it discards whatever lay between them, but every piece here was cut from a single straight subject and the discarded point was on the line joining the two ends. The polyline form cannot take this shortcut and has to decide, which is what Polylines(GeoPolyline2, GeoPolyline2, Tolerance) is for.

Exceptions

ArgumentNullException

Thrown when segments is null.