Method ExtendToLength
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
ExtendToLength(GeoLine2, double, LineEnd)
Moves one end of a segment so that the segment measures a given length, using the default tolerance. The other end stays, so a length shorter than the segment trims it. This is LENGTHEN with its Total option.
public static GeoLine2 ExtendToLength(GeoLine2 line, double length, LineEnd end)
Parameters
lineGeoLine2The segment.
lengthdoubleThe length the segment should have.
endLineEndThe end that moves.
Returns
- GeoLine2
The segment of the requested length, running the same way from the end that stayed.
Exceptions
- InvalidOperationException
Thrown when the segment is too short to have a direction.
- ArgumentOutOfRangeException
Thrown when the length is not a finite number greater than the tolerance, or the end is not a defined value.
ExtendToLength(GeoLine2, double, LineEnd, Tolerance)
Moves one end of a segment so that the segment measures a given length, within tolerance. The other end stays, so a length shorter than the segment trims it.
public static GeoLine2 ExtendToLength(GeoLine2 line, double length, LineEnd end, Tolerance tolerance)
Parameters
lineGeoLine2The segment.
lengthdoubleThe length the segment should have.
endLineEndThe end that moves.
toleranceToleranceThe tolerance deciding when a segment is too short.
Returns
- GeoLine2
The segment of the requested length, running the same way from the end that stayed.
Exceptions
- InvalidOperationException
Thrown when the segment is too short to have a direction.
- ArgumentOutOfRangeException
Thrown when the length is not a finite number greater than the tolerance, or the end is not a defined value.
ExtendToLength(GeoArc2, double, LineEnd)
Lengthens or shortens an arc at one end until it is a given arc length.
public static GeoArc2 ExtendToLength(GeoArc2 arc, double length, LineEnd end)
Parameters
Returns
ExtendToLength(GeoArc2, double, LineEnd, Tolerance)
Lengthens or shortens an arc at one end until it is a given arc length, within a tolerance.
public static GeoArc2 ExtendToLength(GeoArc2 arc, double length, LineEnd end, Tolerance tolerance)
Parameters
arcGeoArc2The arc.
lengthdoubleThe arc length it should end up with, measured along the curve.
endLineEndWhich end to move; the other stays where it is.
toleranceToleranceThe tolerance.
Returns
- GeoArc2
The arc of that length, keeping its centre and radius.
Exceptions
- ArgumentOutOfRangeException
Thrown when the length is not a positive finite number, or is longer than the whole circle.
ExtendToLength(GeoPolyline2, double, LineEnd)
Lengthens a chain along its end leg until the whole chain is a given length.
public static GeoPolyline2 ExtendToLength(GeoPolyline2 chain, double length, LineEnd end)
Parameters
chainGeoPolyline2lengthdoubleendLineEnd
Returns
ExtendToLength(GeoPolyline2, double, LineEnd, Tolerance)
Lengthens a chain along its end leg until the whole chain is a given length, within a tolerance.
public static GeoPolyline2 ExtendToLength(GeoPolyline2 chain, double length, LineEnd end, Tolerance tolerance)
Parameters
chainGeoPolyline2The chain.
lengthdoubleThe length the whole chain should end up with, measured along it.
endLineEndWhich end to move.
toleranceToleranceThe tolerance.
Returns
- GeoPolyline2
The chain of that length.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
- ArgumentOutOfRangeException
Thrown when the length is not longer than the chain already is.
ExtendToLength(GeoPolylineArc2, double, LineEnd)
Lengthens a curved chain along its end leg until the whole chain is a given length.
public static GeoPolylineArc2 ExtendToLength(GeoPolylineArc2 chain, double length, LineEnd end)
Parameters
chainGeoPolylineArc2lengthdoubleendLineEnd
Returns
ExtendToLength(GeoPolylineArc2, double, LineEnd, Tolerance)
Lengthens a curved chain along its end leg until the whole chain is a given length, within a tolerance.
public static GeoPolylineArc2 ExtendToLength(GeoPolylineArc2 chain, double length, LineEnd end, Tolerance tolerance)
Parameters
chainGeoPolylineArc2The chain.
lengthdoubleThe length the whole chain should end up with, measured along its arcs.
endLineEndWhich end to move.
toleranceToleranceThe tolerance.
Returns
- GeoPolylineArc2
The chain of that length.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
- ArgumentOutOfRangeException
Thrown when the length is not longer than the chain already is.