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
lineGeoLine2The segment.
pointGeoPoint2The point the end is brought level with.
endLineEndThe end that moves.
resultGeoLine2The 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
lineGeoLine2The segment.
pointGeoPoint2The point the end is brought level with.
endLineEndThe end that moves.
resultGeoLine2The extended segment, or the segment unchanged when the method returns false.
toleranceToleranceThe tolerance.
Returns
- bool
true if the foot lies at or beyond the end; false if reaching it would shorten the segment, or the segment or the point has a coordinate that is not a finite number.
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
lineGeoLine2The segment.
boundaryGeoLine2The boundary segment, which is not extended itself.
endLineEndThe end that moves.
resultGeoLine2The 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
lineGeoLine2The segment.
boundaryGeoLine2The boundary segment, which is not extended itself.
endLineEndThe end that moves.
resultGeoLine2The extended segment, or the segment unchanged when the method returns false.
toleranceToleranceThe 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
lineGeoLine2The segment.
boundaryGeoPolyline2The polyline.
endLineEndThe end that moves.
resultGeoLine2The 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
lineGeoLine2The segment.
boundaryGeoPolyline2The polyline.
endLineEndThe end that moves.
resultGeoLine2The extended segment, or the segment unchanged when the method returns false.
toleranceToleranceThe 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
lineGeoLine2The segment.
boundaryGeoPolygon2The polygon.
endLineEndThe end that moves.
resultGeoLine2The 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
lineGeoLine2The segment.
boundaryGeoPolygon2The polygon.
endLineEndThe end that moves.
resultGeoLine2The extended segment, or the segment unchanged when the method returns false.
toleranceToleranceThe 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
lineGeoLine2The segment.
boundaryGeoCircle2The circle.
endLineEndThe end that moves.
resultGeoLine2The 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 outside the circle within tolerance of its rim touches it once, at the foot of the perpendicular from its centre; one passing inside crosses it where it does, unless its two crossings lie within twice the tolerance of each other, when they are one, at the foot. A segment whose line runs inside the rim within tolerance of it, crossing it nowhere along its length, has an end already on the rim within tolerance left where it is: at a tolerance of 0.1, extending the end (-0.3, 49.97) of the segment from (-0.4, 49.97) against the circle of radius 50 about the origin leaves it there.
public static bool TryExtendTo(GeoLine2 line, GeoCircle2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)
Parameters
lineGeoLine2The segment.
boundaryGeoCircle2The circle.
endLineEndThe end that moves.
resultGeoLine2The extended segment, or the segment unchanged when the method returns false.
toleranceToleranceThe 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
lineGeoLine2The segment.
boundaryGeoRectangle2The rectangle.
endLineEndThe end that moves.
resultGeoLine2The 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
lineGeoLine2The segment.
boundaryGeoRectangle2The rectangle.
endLineEndThe end that moves.
resultGeoLine2The extended segment, or the segment unchanged when the method returns false.
toleranceToleranceThe 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
Returns
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
arcGeoArc2The arc.
pointGeoPoint2The point to reach; it has to lie on the arc's own circle.
endLineEndWhich end to move.
resultGeoArc2The arc reaching the point, or the arc unchanged.
toleranceToleranceThe 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.