Table of Contents

Class Lengthen2

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

Provides static methods that change how long a line segment is while keeping it on the line that carries it: lengthening or shortening it by a distance, extending an end out to a boundary, trimming an end back to one, and trimming or extending two segments until they meet in a corner.

The operations follow AutoCAD's LENGTHEN, EXTEND and TRIM commands, and FILLET with a radius of zero. A segment has no picked point to say which end is meant, so every method that moves one end takes a LineEnd; the other end never moves, and the direction of the segment never reverses.

TryExtendTo only ever lengthens: the end moves outward to the nearest place where the line meets the boundary. TryTrimTo only ever shortens: the end moves back to the nearest place, still within the segment, where the boundary crosses it. An end that already lies on the boundary, within tolerance, satisfies both and is left there, so either call can be repeated without moving the end again, and TryExtendTo(...) || TryTrimTo(...) fits an end to a boundary whichever side of it the end starts on.

A boundary is met where the infinite line carrying the segment crosses it. A boundary segment, polyline or polygon edge running parallel to the line is not a crossing, since it is either missed or shared along a whole stretch. A point is met where the line passes closest to it, at the foot of the perpendicular, so a point to one side of the line still pulls the end level with it.

public static class Lengthen2
Inheritance
Lengthen2
Inherited Members

Remarks

Only a segment could be extended or trimmed, which left the one case a reinforcing schedule asks about every day — lengthening a bar's end leg for anchorage — with no answer but rebuilding the chain by hand.

An arc is extended along itself: the radius and the centre stay, the sweep grows, and the distance asked for is arc length and not chord. That is exact, and it is the only reading that leaves the curve where it was. A whole turn is the limit, so an extension that would pass it is refused rather than wrapped.

A chain is extended by its end leg, along that leg: a straight leg carries on straight, a curved one carries on round, keeping its radius. Every other leg is untouched, so the bends and their radii survive. A chain is extended outwards only; shortening one belongs to the cutting family, which keeps the bends, and TryTrimTo below is that cut with the end named rather than the piece.

Methods

Extend(GeoArc2, double, LineEnd)

Lengthens an arc along itself at one end.

Extend(GeoArc2, double, LineEnd, Tolerance)

Lengthens an arc along itself at one end, within a tolerance.

Extend(GeoArc2, double, double)

Lengthens an arc along itself at both ends at once.

Extend(GeoArc2, double, double, Tolerance)

Lengthens an arc along itself at both ends at once, within a tolerance.

Extend(GeoLine2, double, LineEnd)

Lengthens one end of a segment by a distance, using the default tolerance. A negative distance shortens it.

Extend(GeoLine2, double, LineEnd, Tolerance)

Lengthens one end of a segment by a distance, within tolerance. A negative distance shortens it.

Extend(GeoLine2, double, double)

Lengthens both ends of a segment, each by its own distance, using the default tolerance. A negative distance shortens that end. This is the end offset Tekla Structures applies along a beam's axis.

Extend(GeoLine2, double, double, Tolerance)

Lengthens both ends of a segment, each by its own distance, within tolerance. A negative distance shortens that end.

Extend(GeoPolyline2, double, LineEnd)

Lengthens a chain along its end leg.

Extend(GeoPolyline2, double, LineEnd, Tolerance)

Lengthens a chain along its end leg, within a tolerance.

Extend(GeoPolylineArc2, double, LineEnd)

Lengthens a curved chain along its end leg, round if that leg curves.

Extend(GeoPolylineArc2, double, LineEnd, Tolerance)

Lengthens a curved chain along its end leg, round if that leg curves, within a tolerance.

ExtendToLength(GeoArc2, double, LineEnd)

Lengthens or shortens an arc at one end until it is a given arc length.

ExtendToLength(GeoArc2, double, LineEnd, Tolerance)

Lengthens or shortens an arc at one end until it is a given arc length, within a tolerance.

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.

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.

ExtendToLength(GeoPolyline2, double, LineEnd)

Lengthens a chain along its end leg until the whole chain is a given length.

ExtendToLength(GeoPolyline2, double, LineEnd, Tolerance)

Lengthens a chain along its end leg until the whole chain is a given length, within a tolerance.

ExtendToLength(GeoPolylineArc2, double, LineEnd)

Lengthens a curved chain along its end leg until the whole chain is a given length.

ExtendToLength(GeoPolylineArc2, double, LineEnd, Tolerance)

Lengthens a curved chain along its end leg until the whole chain is a given length, within a tolerance.

TryExtendTo(GeoArc2, GeoPoint2, LineEnd, out GeoArc2)

Lengthens an arc at one end until it reaches a point on its circle.

TryExtendTo(GeoArc2, GeoPoint2, LineEnd, out GeoArc2, Tolerance)

Lengthens an arc at one end until it reaches a point on its circle, within a tolerance.

TryExtendTo(GeoLine2, GeoCircle2, LineEnd, out GeoLine2)

Extends one end of a segment until it meets a circle, using the default tolerance.

TryExtendTo(GeoLine2, GeoCircle2, LineEnd, out GeoLine2, Tolerance)

Extends one end of a segment until it meets a circle, within tolerance. A line passing within tolerance of tangency touches the circle once, at the foot of the perpendicular from its centre.

TryExtendTo(GeoLine2, GeoLine2, LineEnd, out GeoLine2)

Extends one end of a segment until it meets a boundary segment, using the default tolerance.

TryExtendTo(GeoLine2, GeoLine2, LineEnd, out GeoLine2, Tolerance)

Extends one end of a segment until it meets a boundary segment, within tolerance.

TryExtendTo(GeoLine2, GeoPoint2, LineEnd, out GeoLine2)

Extends one end of a segment to the foot of the perpendicular from a point, using the default tolerance. This is Curve.Extend(bool, Point3d) in AutoCAD, for a point off the line as well.

TryExtendTo(GeoLine2, GeoPoint2, LineEnd, out GeoLine2, Tolerance)

Extends one end of a segment to the foot of the perpendicular from a point, within tolerance.

TryExtendTo(GeoLine2, GeoPolygon2, LineEnd, out GeoLine2)

Extends one end of a segment until it meets the boundary of a polygon, using the default tolerance.

TryExtendTo(GeoLine2, GeoPolygon2, LineEnd, out GeoLine2, Tolerance)

Extends one end of a segment until it meets the boundary of a polygon, within tolerance. The end stops at the nearest edge beyond it, so an end inside the polygon runs out to where the line leaves it and an end outside runs in to where the line enters.

TryExtendTo(GeoLine2, GeoPolyline2, LineEnd, out GeoLine2)

Extends one end of a segment until it meets a polyline, using the default tolerance.

TryExtendTo(GeoLine2, GeoPolyline2, LineEnd, out GeoLine2, Tolerance)

Extends one end of a segment until it meets a polyline, within tolerance. The end stops at the nearest crossing beyond it.

TryExtendTo(GeoLine2, GeoRectangle2, LineEnd, out GeoLine2)

Extends one end of a segment until it meets the boundary of a rectangle, using the default tolerance.

TryExtendTo(GeoLine2, GeoRectangle2, LineEnd, out GeoLine2, Tolerance)

Extends one end of a segment until it meets the boundary of a rectangle, within tolerance.

TryFilletCorner(GeoLine2, GeoLine2, double, out GeoArc2, out GeoLine2, out GeoLine2)

Rounds the corner between two segments with an arc of a given radius, using the default tolerance.

TryFilletCorner(GeoLine2, GeoLine2, double, out GeoArc2, out GeoLine2, out GeoLine2, Tolerance)

Rounds the corner between two segments with an arc of a given radius, within a tolerance.

TryTrimExtendToCorner(GeoLine2, GeoLine2, out GeoLine2, out GeoLine2)

Trims or extends two segments so that they meet in a corner, using the default tolerance. This is FILLET with a radius of zero.

TryTrimExtendToCorner(GeoLine2, GeoLine2, out GeoLine2, out GeoLine2, Tolerance)

Trims or extends two segments so that they meet in a corner, within tolerance.

TryTrimTo(GeoArc2, GeoPoint2, LineEnd, out GeoArc2)

Shortens an arc at one end back to a point on it.

TryTrimTo(GeoArc2, GeoPoint2, LineEnd, out GeoArc2, Tolerance)

Shortens an arc at one end back to a point on it, within a tolerance.

TryTrimTo(GeoLine2, GeoCircle2, LineEnd, out GeoLine2)

Trims one end of a segment back to the nearest place a circle crosses it, using the default tolerance.

TryTrimTo(GeoLine2, GeoCircle2, LineEnd, out GeoLine2, Tolerance)

Trims one end of a segment back to the nearest place a circle crosses it, within tolerance.

TryTrimTo(GeoLine2, GeoLine2, LineEnd, out GeoLine2)

Trims one end of a segment back to where a boundary segment crosses it, using the default tolerance.

TryTrimTo(GeoLine2, GeoLine2, LineEnd, out GeoLine2, Tolerance)

Trims one end of a segment back to where a boundary segment crosses it, within tolerance.

TryTrimTo(GeoLine2, GeoPoint2, LineEnd, out GeoLine2)

Trims one end of a segment back to the foot of the perpendicular from a point, using the default tolerance.

TryTrimTo(GeoLine2, GeoPoint2, LineEnd, out GeoLine2, Tolerance)

Trims one end of a segment back to the foot of the perpendicular from a point, within tolerance.

TryTrimTo(GeoLine2, GeoPolygon2, LineEnd, out GeoLine2)

Trims one end of a segment back to the nearest place the boundary of a polygon crosses it, using the default tolerance.

TryTrimTo(GeoLine2, GeoPolygon2, LineEnd, out GeoLine2, Tolerance)

Trims one end of a segment back to the nearest place the boundary of a polygon crosses it, within tolerance. A segment running out of a polygon is cut where it leaves.

TryTrimTo(GeoLine2, GeoPolyline2, LineEnd, out GeoLine2)

Trims one end of a segment back to the nearest place a polyline crosses it, using the default tolerance.

TryTrimTo(GeoLine2, GeoPolyline2, LineEnd, out GeoLine2, Tolerance)

Trims one end of a segment back to the nearest place a polyline crosses it, within tolerance.

TryTrimTo(GeoLine2, GeoRectangle2, LineEnd, out GeoLine2)

Trims one end of a segment back to the nearest place the boundary of a rectangle crosses it, using the default tolerance.

TryTrimTo(GeoLine2, GeoRectangle2, LineEnd, out GeoLine2, Tolerance)

Trims one end of a segment back to the nearest place the boundary of a rectangle crosses it, within tolerance.

TryTrimTo(GeoPolyline2, GeoPoint2, LineEnd, out GeoPolyline2)

Shortens a chain at one end back to a point on it.

TryTrimTo(GeoPolyline2, GeoPoint2, LineEnd, out GeoPolyline2, Tolerance)

Shortens a chain at one end back to a point on it, within a tolerance.

TryTrimTo(GeoPolylineArc2, GeoPoint2, LineEnd, out GeoPolylineArc2)

Shortens a curved chain at one end back to a point on it.

TryTrimTo(GeoPolylineArc2, GeoPoint2, LineEnd, out GeoPolylineArc2, Tolerance)

Shortens a curved chain at one end back to a point on it, within a tolerance.