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
chainGeoPolylineArc2The chain to cut.
distancesIEnumerable<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
chainGeoPolylineArc2distancesIEnumerable<double>toleranceTolerance
Returns
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
loopGeoPolygonArc2The loop to cut.
distancesIEnumerable<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
loopGeoPolygonArc2distancesIEnumerable<double>toleranceTolerance
Returns
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
lineGeoLine2The line segment to split.
distancesIEnumerable<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
lineGeoLine2The line segment to split.
distancesIEnumerable<double>Arc lengths from the start point, in any order.
toleranceToleranceThe 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
polylineGeoPolyline2The polyline to split.
distancesIEnumerable<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
polylineGeoPolyline2The polyline to split.
distancesIEnumerable<double>Arc lengths from the first vertex, in any order.
toleranceToleranceThe 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.