Table of Contents

Method ConsecutiveLines

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

ConsecutiveLines(IEnumerable<GeoLine3>)

Merges runs of consecutive collinear segments, using the default tolerance.

public static GeoLine3[] ConsecutiveLines(IEnumerable<GeoLine3> lines)

Parameters

lines IEnumerable<GeoLine3>

Returns

GeoLine3[]

ConsecutiveLines(IEnumerable<GeoLine3>, Tolerance)

Merges runs of consecutive collinear segments, within a tolerance.

public static GeoLine3[] ConsecutiveLines(IEnumerable<GeoLine3> lines, Tolerance tolerance)

Parameters

lines IEnumerable<GeoLine3>

The segments, in order along the path.

tolerance Tolerance

The tolerance deciding contact and collinearity.

Returns

GeoLine3[]

The segments with each collinear run replaced by the single segment spanning it.

Remarks

Two segments are merged only when the end of one meets the start of the next and their directions agree. Anti-parallel directions are not merged even though they are parallel: a segment doubling back on itself covers the same ground twice, and replacing the pair with the span between its outer endpoints would silently lose that.