Method TryTrimTo
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
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.
public static bool TryTrimTo(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 trimmed segment, or the segment unchanged when the method returns false.
Returns
- bool
true if the foot lies within the segment, short of the other end; otherwise, false.
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.
public static bool TryTrimTo(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 trimmed segment, or the segment unchanged when the method returns false.
toleranceToleranceThe tolerance.
Returns
- bool
true if the foot lies within the segment, short of the other end; otherwise, false.
TryTrimTo(GeoLine2, GeoLine2, LineEnd, out GeoLine2)
Trims one end of a segment back to where a boundary segment crosses it, using the default tolerance.
public static bool TryTrimTo(GeoLine2 line, GeoLine2 boundary, LineEnd end, out GeoLine2 result)
Parameters
lineGeoLine2The segment.
boundaryGeoLine2The boundary segment.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
Returns
- bool
true if the boundary crosses the segment; otherwise, false.
TryTrimTo(GeoLine2, GeoLine2, LineEnd, out GeoLine2, Tolerance)
Trims one end of a segment back to where a boundary segment crosses it, within tolerance.
public static bool TryTrimTo(GeoLine2 line, GeoLine2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)
Parameters
lineGeoLine2The segment.
boundaryGeoLine2The boundary segment.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
toleranceToleranceThe tolerance.
Returns
- bool
true if the boundary crosses the segment; otherwise, false.
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.
public static bool TryTrimTo(GeoLine2 line, GeoPolyline2 boundary, LineEnd end, out GeoLine2 result)
Parameters
lineGeoLine2The segment.
boundaryGeoPolyline2The polyline.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
Returns
- bool
true if the polyline crosses the segment; otherwise, false.
TryTrimTo(GeoLine2, GeoPolyline2, LineEnd, out GeoLine2, Tolerance)
Trims one end of a segment back to the nearest place a polyline crosses it, within tolerance.
public static bool TryTrimTo(GeoLine2 line, GeoPolyline2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)
Parameters
lineGeoLine2The segment.
boundaryGeoPolyline2The polyline.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
toleranceToleranceThe tolerance.
Returns
- bool
true if the polyline crosses the segment; otherwise, false.
Exceptions
- ArgumentNullException
Thrown when the polyline is null.
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.
public static bool TryTrimTo(GeoLine2 line, GeoPolygon2 boundary, LineEnd end, out GeoLine2 result)
Parameters
lineGeoLine2The segment.
boundaryGeoPolygon2The polygon.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
Returns
- bool
true if the polygon boundary crosses the segment; otherwise, false.
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.
public static bool TryTrimTo(GeoLine2 line, GeoPolygon2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)
Parameters
lineGeoLine2The segment.
boundaryGeoPolygon2The polygon.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
toleranceToleranceThe tolerance.
Returns
- bool
true if the polygon boundary crosses the segment; otherwise, false.
Exceptions
- ArgumentNullException
Thrown when the polygon is null.
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.
public static bool TryTrimTo(GeoLine2 line, GeoCircle2 boundary, LineEnd end, out GeoLine2 result)
Parameters
lineGeoLine2The segment.
boundaryGeoCircle2The circle.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
Returns
- bool
true if the circumference crosses the segment; otherwise, false.
TryTrimTo(GeoLine2, GeoCircle2, LineEnd, out GeoLine2, Tolerance)
Trims one end of a segment back to the nearest place a circle crosses it, within tolerance.
public static bool TryTrimTo(GeoLine2 line, GeoCircle2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)
Parameters
lineGeoLine2The segment.
boundaryGeoCircle2The circle.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
toleranceToleranceThe tolerance.
Returns
- bool
true if the circumference crosses the segment; otherwise, false.
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.
public static bool TryTrimTo(GeoLine2 line, GeoRectangle2 boundary, LineEnd end, out GeoLine2 result)
Parameters
lineGeoLine2The segment.
boundaryGeoRectangle2The rectangle.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
Returns
- bool
true if the rectangle boundary crosses the segment; otherwise, false.
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.
public static bool TryTrimTo(GeoLine2 line, GeoRectangle2 boundary, LineEnd end, out GeoLine2 result, Tolerance tolerance)
Parameters
lineGeoLine2The segment.
boundaryGeoRectangle2The rectangle.
endLineEndThe end that moves.
resultGeoLine2The trimmed segment, or the segment unchanged when the method returns false.
toleranceToleranceThe tolerance.
Returns
- bool
true if the rectangle boundary crosses the segment; otherwise, false.
TryTrimTo(GeoArc2, GeoPoint2, LineEnd, out GeoArc2)
Shortens an arc at one end back to a point on it.
public static bool TryTrimTo(GeoArc2 arc, GeoPoint2 point, LineEnd end, out GeoArc2 result)
Parameters
Returns
TryTrimTo(GeoArc2, GeoPoint2, LineEnd, out GeoArc2, Tolerance)
Shortens an arc at one end back to a point on it, within a tolerance.
public static bool TryTrimTo(GeoArc2 arc, GeoPoint2 point, LineEnd end, out GeoArc2 result, Tolerance tolerance)
Parameters
arcGeoArc2The arc.
pointGeoPoint2The point to stop at; it has to lie on the arc itself.
endLineEndWhich end to move.
resultGeoArc2The shortened arc, or the arc unchanged.
toleranceToleranceThe tolerance.
Returns
- bool
true when the arc was shortened to the point; otherwise, false.
TryTrimTo(GeoPolyline2, GeoPoint2, LineEnd, out GeoPolyline2)
Shortens a chain at one end back to a point on it.
public static bool TryTrimTo(GeoPolyline2 chain, GeoPoint2 point, LineEnd end, out GeoPolyline2 result)
Parameters
chainGeoPolyline2pointGeoPoint2endLineEndresultGeoPolyline2
Returns
TryTrimTo(GeoPolyline2, GeoPoint2, LineEnd, out GeoPolyline2, Tolerance)
Shortens a chain at one end back to a point on it, within a tolerance.
public static bool TryTrimTo(GeoPolyline2 chain, GeoPoint2 point, LineEnd end, out GeoPolyline2 result, Tolerance tolerance)
Parameters
chainGeoPolyline2The chain.
pointGeoPoint2The point to stop at; it has to lie on the chain.
endLineEndWhich end to give up.
resultGeoPolyline2The shortened chain, or the chain unchanged.
toleranceToleranceThe tolerance.
Returns
- bool
true when the chain was shortened; otherwise, false.
Remarks
This is the cut the splitting family makes, with the end named rather than the piece: the piece kept is the one holding the other end, so every leg and bend between them survives.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
TryTrimTo(GeoPolylineArc2, GeoPoint2, LineEnd, out GeoPolylineArc2)
Shortens a curved chain at one end back to a point on it.
public static bool TryTrimTo(GeoPolylineArc2 chain, GeoPoint2 point, LineEnd end, out GeoPolylineArc2 result)
Parameters
chainGeoPolylineArc2pointGeoPoint2endLineEndresultGeoPolylineArc2
Returns
TryTrimTo(GeoPolylineArc2, GeoPoint2, LineEnd, out GeoPolylineArc2, Tolerance)
Shortens a curved chain at one end back to a point on it, within a tolerance.
public static bool TryTrimTo(GeoPolylineArc2 chain, GeoPoint2 point, LineEnd end, out GeoPolylineArc2 result, Tolerance tolerance)
Parameters
chainGeoPolylineArc2The chain.
pointGeoPoint2The point to stop at; it has to lie on the chain.
endLineEndWhich end to give up.
resultGeoPolylineArc2The shortened chain, or the chain unchanged.
toleranceToleranceThe tolerance.
Returns
- bool
true when the chain was shortened; otherwise, false.
Remarks
The cut keeps the arcs: a bend the cut falls inside comes back as two arcs of the same radius, and only the piece holding the other end is kept.
Exceptions
- ArgumentNullException
Thrown when the chain is null.