Method GetShortestLineTo
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
GetShortestLineTo(GeoPoint3)
Gets the shortest segment joining this solid to a point.
public GeoLine3 GetShortestLineTo(GeoPoint3 point)
Parameters
pointGeoPoint3
Returns
Remarks
The segment leaves the surface, so it has a length even for a point inside the body, where DistanceTo(GeoPoint3) reports nothing at all.
GetShortestLineTo(GeoPoint3, Tolerance)
Gets the shortest segment joining this solid to a point, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoPoint3 point, Tolerance tolerance)
Parameters
Returns
GetShortestLineTo(GeoLine3)
Gets the shortest segment joining this solid to a line segment.
public GeoLine3 GetShortestLineTo(GeoLine3 line)
Parameters
lineGeoLine3
Returns
Remarks
A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
GetShortestLineTo(GeoLine3, Tolerance)
Gets the shortest segment joining this solid to a line segment, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoLine3 line, Tolerance tolerance)
Parameters
Returns
Remarks
A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
GetShortestLineTo(GeoTriangle3)
Gets the shortest segment joining this solid to a triangle.
public GeoLine3 GetShortestLineTo(GeoTriangle3 triangle)
Parameters
triangleGeoTriangle3
Returns
Remarks
A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
GetShortestLineTo(GeoTriangle3, Tolerance)
Gets the shortest segment joining this solid to a triangle, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoTriangle3 triangle, Tolerance tolerance)
Parameters
triangleGeoTriangle3toleranceTolerance
Returns
Remarks
A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
GetShortestLineTo(GeoSolid3)
Gets the shortest segment joining this solid to another solid.
public GeoLine3 GetShortestLineTo(GeoSolid3 other)
Parameters
otherGeoSolid3
Returns
Remarks
The line is the true gap, and the distance between two bodies is not: DistanceTo(GeoSolid3) still reads nought for bodies within the point tolerance of each other. The box 100 by 100 by 50 with its top in the floor and another standing 0.0004 clear of its side are joined by a line 0.0004 long, and are nought apart by their distance.
GetShortestLineTo(GeoSolid3, Tolerance)
Gets the shortest segment joining this solid to another solid, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoSolid3 other, Tolerance tolerance)
Parameters
Returns
Remarks
The line is the true gap, and the distance between two bodies is not: DistanceTo(GeoSolid3) still reads nought for bodies within the point tolerance of each other. The box 100 by 100 by 50 with its top in the floor and another standing 0.0004 clear of its side are joined by a line 0.0004 long, and are nought apart by their distance.
GetShortestLineTo(GeoRay3)
Gets the shortest segment joining this solid to a ray.
public GeoLine3 GetShortestLineTo(GeoRay3 ray)
Parameters
rayGeoRay3
Returns
Remarks
A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
GetShortestLineTo(GeoRay3, Tolerance)
Gets the shortest segment joining this solid to a ray, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoRay3 ray, Tolerance tolerance)
Parameters
Returns
Remarks
A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
GetShortestLineTo(GeoPolyline3)
Gets the shortest segment joining this solid to a polyline, using the default tolerance.
public GeoLine3 GetShortestLineTo(GeoPolyline3 polyline)
Parameters
polylineGeoPolyline3
Returns
Remarks
The segment runs from the surface of this body to the chain, so a chain lying wholly inside is joined out to the nearest face, where DistanceTo(GeoPolyline3) answers nought; outside, it is as long as that distance. In the box 100 by 100 by 100 with a corner at the origin, the chain (50, 50, 10), (50, 50, 60), (50, 70, 60) is joined from the bottom face at (50, 50, 0) to (50, 50, 10), 10 long. A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
Exceptions
- ArgumentNullException
Thrown when the polyline is null.
GetShortestLineTo(GeoPolyline3, Tolerance)
Gets the shortest segment joining this solid to a polyline, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoPolyline3 polyline, Tolerance tolerance)
Parameters
polylineGeoPolyline3toleranceTolerance
Returns
Remarks
The segment runs from the surface of this body to the chain, so a chain lying wholly inside is joined out to the nearest face, where DistanceTo(GeoPolyline3) answers nought; outside, it is as long as that distance. In the box 100 by 100 by 100 with a corner at the origin, the chain (50, 50, 10), (50, 50, 60), (50, 70, 60) is joined from the bottom face at (50, 50, 0) to (50, 50, 10), 10 long. A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
Exceptions
- ArgumentNullException
Thrown when the polyline is null.
GetShortestLineTo(GeoPolygon3)
Gets the shortest segment joining this solid to a polygon, using the default tolerance.
public GeoLine3 GetShortestLineTo(GeoPolygon3 polygon)
Parameters
polygonGeoPolygon3
Returns
Remarks
The segment runs from the surface of this body to the polygon, read as a filled surface, so a polygon lying wholly inside is joined out to the nearest face, where DistanceTo(GeoPolygon3) answers nought; outside, it is as long as that distance. In the box 100 by 100 by 100 with a corner at the origin, the square 20 by 20 lying flat at a height of 30 is joined from the bottom face, 30 long. A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
Exceptions
- ArgumentNullException
Thrown when the polygon is null.
GetShortestLineTo(GeoPolygon3, Tolerance)
Gets the shortest segment joining this solid to a polygon, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoPolygon3 polygon, Tolerance tolerance)
Parameters
polygonGeoPolygon3toleranceTolerance
Returns
Remarks
The segment runs from the surface of this body to the polygon, read as a filled surface, so a polygon lying wholly inside is joined out to the nearest face, where DistanceTo(GeoPolygon3) answers nought; outside, it is as long as that distance. In the box 100 by 100 by 100 with a corner at the origin, the square 20 by 20 lying flat at a height of 30 is joined from the bottom face, 30 long. A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
Exceptions
- ArgumentNullException
Thrown when the polygon is null.
GetShortestLineTo(GeoPlane3)
Gets the shortest segment joining this solid to a plane, using the default tolerance.
public GeoLine3 GetShortestLineTo(GeoPlane3 plane)
Parameters
planeGeoPlane3
Returns
Remarks
A body that crosses or touches the plane meets it in a segment of no length at the first point of contact, walking the triangles of its surface in order; one clear of it is joined from its nearest corner, as long as DistanceTo(GeoPlane3). The box 100 by 100 by 100 with a corner at the origin is joined to the plane 30 under it from a corner of its bottom face, 30 long. A body of separate pieces either side of the plane, neither touching it, is nought from it by the distance, which reads only its corners, and is joined from its nearest corner all the same. The segment is never snapped: a shape a hair off the plane is joined by a segment that short, though the distance, read within the point tolerance, is nought.
GetShortestLineTo(GeoPlane3, Tolerance)
Gets the shortest segment joining this solid to a plane, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoPlane3 plane, Tolerance tolerance)
Parameters
Returns
Remarks
A body that crosses or touches the plane meets it in a segment of no length at the first point of contact, walking the triangles of its surface in order; one clear of it is joined from its nearest corner, as long as DistanceTo(GeoPlane3). The box 100 by 100 by 100 with a corner at the origin is joined to the plane 30 under it from a corner of its bottom face, 30 long. A body of separate pieces either side of the plane, neither touching it, is nought from it by the distance, which reads only its corners, and is joined from its nearest corner all the same. The segment is never snapped: a shape a hair off the plane is joined by a segment that short, though the distance, read within the point tolerance, is nought.
GetShortestLineTo(GeoFace3)
Gets the shortest segment joining this solid to a face, using the default tolerance.
public GeoLine3 GetShortestLineTo(GeoFace3 face)
Parameters
faceGeoFace3
Returns
Remarks
The segment runs from the surface of this body to the material of the face, so a face lying wholly inside is joined out to the nearest face of the body, where DistanceTo(GeoFace3) answers nought; outside, it is as long as that distance. The box 100 by 100 by 100 with a corner at the origin passes through the hole of the square 200 by 200 from (-50, -50, 50) to (150, 150, 50) with a hole 150 by 150 in its middle and is joined to its rim across the 25 between them. A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
Exceptions
- ArgumentNullException
Thrown when the face is null.
GetShortestLineTo(GeoFace3, Tolerance)
Gets the shortest segment joining this solid to a face, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoFace3 face, Tolerance tolerance)
Parameters
Returns
Remarks
The segment runs from the surface of this body to the material of the face, so a face lying wholly inside is joined out to the nearest face of the body, where DistanceTo(GeoFace3) answers nought; outside, it is as long as that distance. The box 100 by 100 by 100 with a corner at the origin passes through the hole of the square 200 by 200 from (-50, -50, 50) to (150, 150, 50) with a hole 150 by 150 in its middle and is joined to its rim across the 25 between them. A shape coming end-on at the other and stopping within the point tolerance of it is read as crossing it, so the line can be of no length where the distance is the gap: the segment from (5, 5, 0.0004) to (5, 5, 9), over the square 100 by 100 in the floor, is joined by a segment of no length at (5, 5, 0.0004), and is 0.0004 from it by its distance.
Exceptions
- ArgumentNullException
Thrown when the face is null.
GetShortestLineTo(GeoSphere3)
Gets the shortest segment leaving this solid and landing on a ball, using the default tolerance.
public GeoLine3 GetShortestLineTo(GeoSphere3 sphere)
Parameters
sphereGeoSphere3
Returns
GetShortestLineTo(GeoSphere3, Tolerance)
Gets the shortest segment leaving this solid and landing on a ball, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoSphere3 sphere, Tolerance tolerance)
Parameters
sphereGeoSphere3toleranceTolerance
Returns
- GeoLine3
The segment of GetShortestLineTo(GeoSolid3, Tolerance) turned round, so that it leaves this solid and lands on the surface of the ball.
GetShortestLineTo(GeoSpline3)
Gets the shortest segment leaving this solid and landing on a spline, using the default tolerance.
public GeoLine3 GetShortestLineTo(GeoSpline3 spline)
Parameters
splineGeoSpline3
Returns
Exceptions
- ArgumentNullException
Thrown when the spline is null.
GetShortestLineTo(GeoSpline3, Tolerance)
Gets the shortest segment leaving this solid and landing on a spline, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoSpline3 spline, Tolerance tolerance)
Parameters
splineGeoSpline3toleranceTolerance
Returns
- GeoLine3
The segment the spline gives, turned round: it starts on this solid and lands on the spline.
Exceptions
- ArgumentNullException
Thrown when the spline is null.
GetShortestLineTo(GeoXLine3)
Gets the shortest segment leaving this solid and landing on an infinite line, using the default tolerance.
public GeoLine3 GetShortestLineTo(GeoXLine3 xline)
Parameters
xlineGeoXLine3
Returns
GetShortestLineTo(GeoXLine3, Tolerance)
Gets the shortest segment leaving this solid and landing on an infinite line, within a tolerance.
public GeoLine3 GetShortestLineTo(GeoXLine3 xline, Tolerance tolerance)