Table of Contents

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

line GeoLine2

The segment.

point GeoPoint2

The point the end is brought level with.

end LineEnd

The end that moves.

result GeoLine2

The 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

line GeoLine2

The segment.

point GeoPoint2

The point the end is brought level with.

end LineEnd

The end that moves.

result GeoLine2

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

tolerance Tolerance

The 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

line GeoLine2

The segment.

boundary GeoLine2

The boundary segment.

end LineEnd

The end that moves.

result GeoLine2

The 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

line GeoLine2

The segment.

boundary GeoLine2

The boundary segment.

end LineEnd

The end that moves.

result GeoLine2

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

tolerance Tolerance

The 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

line GeoLine2

The segment.

boundary GeoPolyline2

The polyline.

end LineEnd

The end that moves.

result GeoLine2

The 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

line GeoLine2

The segment.

boundary GeoPolyline2

The polyline.

end LineEnd

The end that moves.

result GeoLine2

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

tolerance Tolerance

The 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

line GeoLine2

The segment.

boundary GeoPolygon2

The polygon.

end LineEnd

The end that moves.

result GeoLine2

The 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

line GeoLine2

The segment.

boundary GeoPolygon2

The polygon.

end LineEnd

The end that moves.

result GeoLine2

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

tolerance Tolerance

The 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

line GeoLine2

The segment.

boundary GeoCircle2

The circle.

end LineEnd

The end that moves.

result GeoLine2

The 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

line GeoLine2

The segment.

boundary GeoCircle2

The circle.

end LineEnd

The end that moves.

result GeoLine2

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

tolerance Tolerance

The 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

line GeoLine2

The segment.

boundary GeoRectangle2

The rectangle.

end LineEnd

The end that moves.

result GeoLine2

The 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

line GeoLine2

The segment.

boundary GeoRectangle2

The rectangle.

end LineEnd

The end that moves.

result GeoLine2

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

tolerance Tolerance

The 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

arc GeoArc2
point GeoPoint2
end LineEnd
result GeoArc2

Returns

bool

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

arc GeoArc2

The arc.

point GeoPoint2

The point to stop at; it has to lie on the arc itself.

end LineEnd

Which end to move.

result GeoArc2

The shortened arc, or the arc unchanged.

tolerance Tolerance

The 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

chain GeoPolyline2
point GeoPoint2
end LineEnd
result GeoPolyline2

Returns

bool

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

chain GeoPolyline2

The chain.

point GeoPoint2

The point to stop at; it has to lie on the chain.

end LineEnd

Which end to give up.

result GeoPolyline2

The shortened chain, or the chain unchanged.

tolerance Tolerance

The 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

chain GeoPolylineArc2
point GeoPoint2
end LineEnd
result GeoPolylineArc2

Returns

bool

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

chain GeoPolylineArc2

The chain.

point GeoPoint2

The point to stop at; it has to lie on the chain.

end LineEnd

Which end to give up.

result GeoPolylineArc2

The shortened chain, or the chain unchanged.

tolerance Tolerance

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