Table of Contents

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

line GeoLine2

The segment.

length double

The length the segment should have.

end LineEnd

The 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

line GeoLine2

The segment.

length double

The length the segment should have.

end LineEnd

The end that moves.

tolerance Tolerance

The 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

arc GeoArc2
length double
end LineEnd

Returns

GeoArc2

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

arc GeoArc2

The arc.

length double

The arc length it should end up with, measured along the curve.

end LineEnd

Which end to move; the other stays where it is.

tolerance Tolerance

The 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

chain GeoPolyline2
length double
end LineEnd

Returns

GeoPolyline2

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

chain GeoPolyline2

The chain.

length double

The length the whole chain should end up with, measured along it.

end LineEnd

Which end to move.

tolerance Tolerance

The 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

chain GeoPolylineArc2
length double
end LineEnd

Returns

GeoPolylineArc2

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

chain GeoPolylineArc2

The chain.

length double

The length the whole chain should end up with, measured along its arcs.

end LineEnd

Which end to move.

tolerance Tolerance

The 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.