Table of Contents

Method SplitAtDistances

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

SplitAtDistances(GeoPolylineArc2, IEnumerable<double>)

Cuts a chain that may curve at distances along it.

public static GeoPolylineArc2[] SplitAtDistances(GeoPolylineArc2 chain, IEnumerable<double> distances)

Parameters

chain GeoPolylineArc2

The chain to cut.

distances IEnumerable<double>

How far along to cut, in drawing units; the order does not matter, and a distance at either end or off the chain is ignored.

Returns

GeoPolylineArc2[]

The pieces, in order; the chain itself when nothing was cut.

Remarks

A cut inside an arc leaves two arcs of the same radius, not two chords, so the pieces put back end to end draw exactly what went in.

Exceptions

ArgumentNullException

Thrown when the chain or the distances are null.

SplitAtDistances(GeoPolylineArc2, IEnumerable<double>, Tolerance)

Cuts a chain that may curve at distances along it, within a tolerance.

public static GeoPolylineArc2[] SplitAtDistances(GeoPolylineArc2 chain, IEnumerable<double> distances, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
distances IEnumerable<double>
tolerance Tolerance

Returns

GeoPolylineArc2[]

Exceptions

ArgumentNullException

Thrown when the chain or the distances are null.

SplitAtDistances(GeoPolygonArc2, IEnumerable<double>)

Cuts a loop that may curve at distances round it.

public static GeoPolylineArc2[] SplitAtDistances(GeoPolygonArc2 loop, IEnumerable<double> distances)

Parameters

loop GeoPolygonArc2

The loop to cut.

distances IEnumerable<double>

How far round to cut, in drawing units.

Returns

GeoPolylineArc2[]

The pieces as open chains; an empty array when nothing was cut, because a loop cut nowhere is still the loop.

Remarks

A loop has no start of its own, so the vertex it happens to be held from is not a cut: the run after the last cut carries on through it into the run before the first one.

Exceptions

ArgumentNullException

Thrown when the loop or the distances are null.

SplitAtDistances(GeoPolygonArc2, IEnumerable<double>, Tolerance)

Cuts a loop that may curve at distances round it, within a tolerance.

public static GeoPolylineArc2[] SplitAtDistances(GeoPolygonArc2 loop, IEnumerable<double> distances, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
distances IEnumerable<double>
tolerance Tolerance

Returns

GeoPolylineArc2[]

Exceptions

ArgumentNullException

Thrown when the loop or the distances are null.

SplitAtDistances(GeoLine2, IEnumerable<double>)

Splits a line segment at several arc lengths measured from its start point, using the default tolerance.

public static GeoLine2[] SplitAtDistances(GeoLine2 line, IEnumerable<double> distances)

Parameters

line GeoLine2

The line segment to split.

distances IEnumerable<double>

Arc lengths from the start point, in any order.

Returns

GeoLine2[]

The pieces in order along the segment.

SplitAtDistances(GeoLine2, IEnumerable<double>, Tolerance)

Splits a line segment at several arc lengths measured from its start point, within tolerance.

public static GeoLine2[] SplitAtDistances(GeoLine2 line, IEnumerable<double> distances, Tolerance tolerance)

Parameters

line GeoLine2

The line segment to split.

distances IEnumerable<double>

Arc lengths from the start point, in any order.

tolerance Tolerance

The tolerance.

Returns

GeoLine2[]

The pieces in order along the segment; a single element holding the segment itself when no distance is usable. Distances outside the segment, and duplicates closer together than the tolerance, are dropped rather than producing empty pieces.

SplitAtDistances(GeoPolyline2, IEnumerable<double>)

Splits a polyline at several arc lengths measured from its first vertex, using the default tolerance.

public static GeoPolyline2[] SplitAtDistances(GeoPolyline2 polyline, IEnumerable<double> distances)

Parameters

polyline GeoPolyline2

The polyline to split.

distances IEnumerable<double>

Arc lengths from the first vertex, in any order.

Returns

GeoPolyline2[]

The pieces in order along the polyline.

SplitAtDistances(GeoPolyline2, IEnumerable<double>, Tolerance)

Splits a polyline at several arc lengths measured from its first vertex, within tolerance.

public static GeoPolyline2[] SplitAtDistances(GeoPolyline2 polyline, IEnumerable<double> distances, Tolerance tolerance)

Parameters

polyline GeoPolyline2

The polyline to split.

distances IEnumerable<double>

Arc lengths from the first vertex, in any order.

tolerance Tolerance

The tolerance.

Returns

GeoPolyline2[]

The pieces in order along the polyline; a single element holding the polyline itself when no distance is usable. N usable distances yield N + 1 pieces.