Table of Contents

Method TryExtendTo

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

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.

public static bool TryExtendTo(GeoLine2 line, GeoPoint2 point, LineEnd end, out GeoLine2 result)

Parameters

line GeoLine2

The segment.

point GeoPoint2

The point the end is brought level with.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

Returns

bool

true if the foot lies at or beyond the end; false if reaching it would shorten the segment.

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

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

public static bool TryExtendTo(GeoLine2 line, GeoPoint2 point, LineEnd end, out GeoLine2 result, Tolerance tolerance)

Parameters

line GeoLine2

The segment.

point GeoPoint2

The point the end is brought level with.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

tolerance Tolerance

The tolerance.

Returns

bool

true if the foot lies at or beyond the end; false if reaching it would shorten the segment.

TryExtendTo(GeoLine2, GeoLine2, LineEnd, out GeoLine2)

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

public static bool TryExtendTo(GeoLine2 line, GeoLine2 boundary, LineEnd end, out GeoLine2 result)

Parameters

line GeoLine2

The segment.

boundary GeoLine2

The boundary segment, which is not extended itself.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

Returns

bool

true if the extension meets the boundary; otherwise, false.

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

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

public static bool TryExtendTo(GeoLine2 line, GeoLine2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)

Parameters

line GeoLine2

The segment.

boundary GeoLine2

The boundary segment, which is not extended itself.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

tolerance Tolerance

The tolerance.

Returns

bool

true if the extension meets the boundary; otherwise, false.

Remarks

The boundary counts only where it is drawn, as with AutoCAD's default EDGEMODE. To extend to the line carrying a boundary however short it is drawn, find that point with TryIntersectWith(GeoLine2, GeoLine2, LineExtension, out GeoPoint2, Tolerance) and Both, and extend to the point.

TryExtendTo(GeoLine2, GeoPolyline2, LineEnd, out GeoLine2)

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

public static bool TryExtendTo(GeoLine2 line, GeoPolyline2 boundary, LineEnd end, out GeoLine2 result)

Parameters

line GeoLine2

The segment.

boundary GeoPolyline2

The polyline.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

Returns

bool

true if the extension meets the polyline; otherwise, false.

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.

public static bool TryExtendTo(GeoLine2 line, GeoPolyline2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)

Parameters

line GeoLine2

The segment.

boundary GeoPolyline2

The polyline.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

tolerance Tolerance

The tolerance.

Returns

bool

true if the extension meets the polyline; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the polyline is null.

TryExtendTo(GeoLine2, GeoPolygon2, LineEnd, out GeoLine2)

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

public static bool TryExtendTo(GeoLine2 line, GeoPolygon2 boundary, LineEnd end, out GeoLine2 result)

Parameters

line GeoLine2

The segment.

boundary GeoPolygon2

The polygon.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

Returns

bool

true if the extension meets the polygon boundary; otherwise, false.

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.

public static bool TryExtendTo(GeoLine2 line, GeoPolygon2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)

Parameters

line GeoLine2

The segment.

boundary GeoPolygon2

The polygon.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

tolerance Tolerance

The tolerance.

Returns

bool

true if the extension meets the polygon boundary; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

TryExtendTo(GeoLine2, GeoCircle2, LineEnd, out GeoLine2)

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

public static bool TryExtendTo(GeoLine2 line, GeoCircle2 boundary, LineEnd end, out GeoLine2 result)

Parameters

line GeoLine2

The segment.

boundary GeoCircle2

The circle.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

Returns

bool

true if the extension meets the circumference; otherwise, false.

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.

public static bool TryExtendTo(GeoLine2 line, GeoCircle2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)

Parameters

line GeoLine2

The segment.

boundary GeoCircle2

The circle.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

tolerance Tolerance

The tolerance.

Returns

bool

true if the extension meets the circumference; otherwise, false.

TryExtendTo(GeoLine2, GeoRectangle2, LineEnd, out GeoLine2)

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

public static bool TryExtendTo(GeoLine2 line, GeoRectangle2 boundary, LineEnd end, out GeoLine2 result)

Parameters

line GeoLine2

The segment.

boundary GeoRectangle2

The rectangle.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

Returns

bool

true if the extension meets the rectangle boundary; otherwise, false.

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

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

public static bool TryExtendTo(GeoLine2 line, GeoRectangle2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)

Parameters

line GeoLine2

The segment.

boundary GeoRectangle2

The rectangle.

end LineEnd

The end that moves.

result GeoLine2

The extended segment, or the segment unchanged when the method returns false.

tolerance Tolerance

The tolerance.

Returns

bool

true if the extension meets the rectangle boundary; otherwise, false.

TryExtendTo(GeoArc2, GeoPoint2, LineEnd, out GeoArc2)

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

public static bool TryExtendTo(GeoArc2 arc, GeoPoint2 point, LineEnd end, out GeoArc2 result)

Parameters

arc GeoArc2
point GeoPoint2
end LineEnd
result GeoArc2

Returns

bool

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

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

public static bool TryExtendTo(GeoArc2 arc, GeoPoint2 point, LineEnd end, out GeoArc2 result, Tolerance tolerance)

Parameters

arc GeoArc2

The arc.

point GeoPoint2

The point to reach; it has to lie on the arc's own circle.

end LineEnd

Which end to move.

result GeoArc2

The arc reaching the point, or the arc unchanged.

tolerance Tolerance

The tolerance.

Returns

bool

true when the arc was lengthened to the point; otherwise, false.

Remarks

Only a lengthening counts: a point the arc already covers is not reached by extending it, and TryTrimTo(GeoArc2, GeoPoint2, LineEnd, out GeoArc2) is the other direction. A point off the circle is refused rather than being drawn in to the nearest place on it.