Method DistanceTo
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
DistanceTo(GeoPoint3)
Calculates the shortest distance from this polygon to a point.
public double DistanceTo(GeoPoint3 point)
Parameters
pointGeoPoint3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
The polygon counts as a filled surface, so a point above its interior is measured straight down to the surface rather than out to the nearest edge.
DistanceTo(GeoLine3)
Gets the distance from this polygon to a segment, using the default tolerance.
public double DistanceTo(GeoLine3 line)
Parameters
lineGeoLine3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment no longer than the global point tolerance is read as its start point, except where it truly meets the other shape.
DistanceTo(GeoLine3, Tolerance)
Gets the distance from this polygon to a segment, within a tolerance.
public double DistanceTo(GeoLine3 line, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment no longer than the tolerance given is read as its start point, except where it truly meets the other shape.
DistanceTo(GeoPolyline3)
Gets the distance from this polygon to a polyline, using the default tolerance.
public double DistanceTo(GeoPolyline3 polyline)
Parameters
polylineGeoPolyline3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoPolyline3, Tolerance)
Gets the distance from this polygon to a polyline, within a tolerance.
public double DistanceTo(GeoPolyline3 polyline, Tolerance tolerance)
Parameters
polylineGeoPolyline3toleranceTolerance
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoSolid3)
Gets the distance from this polygon to a solid, using the default tolerance.
public double DistanceTo(GeoSolid3 solid)
Parameters
solidGeoSolid3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. Within a billionth of a millimetre of the outside of a solid it reads nought, so that rounding in a turned body cannot lose a crossing.
DistanceTo(GeoSolid3, Tolerance)
Gets the distance from this polygon to a solid, within a tolerance.
public double DistanceTo(GeoSolid3 solid, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. Within a billionth of a millimetre of the outside of a solid it reads nought, so that rounding in a turned body cannot lose a crossing.
DistanceTo(GeoFace3)
Calculates the shortest distance between this polygon and a face: the answer of DistanceTo(GeoFace3, GeoPolygon3).
public double DistanceTo(GeoFace3 face)
Parameters
faceGeoFace3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
The face is read by its material and the polygon as a filled surface. A square 20 by 20 standing upright in the middle of the hole of the square 100 by 100 in the floor with a corner at the origin and a hole 40 by 40 in its middle, along y = 50 from x = 40 to 60, is 10 from it.
Exceptions
- ArgumentNullException
Thrown when the face is null.
DistanceTo(GeoFace3, Tolerance)
Calculates the shortest distance between this polygon and a face, within a tolerance: the answer of DistanceTo(GeoFace3, GeoPolygon3, Tolerance).
public double DistanceTo(GeoFace3 face, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
The face is read by its material and the polygon as a filled surface. A square 20 by 20 standing upright in the middle of the hole of the square 100 by 100 in the floor with a corner at the origin and a hole 40 by 40 in its middle, along y = 50 from x = 40 to 60, is 10 from it.
Exceptions
- ArgumentNullException
Thrown when the face is null.
DistanceTo(GeoPolygon3)
Calculates the shortest distance between this polygon and another one: the answer of DistanceTo(GeoPolygon3, GeoPolygon3).
public double DistanceTo(GeoPolygon3 other)
Parameters
otherGeoPolygon3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
Both are read as filled surfaces. A square 100 by 100 in the floor with a corner at the origin and one standing upright along y = 50 from z = 10 to 110 are 10 apart; one lying 0.0004 above it is 0.0004 away and touches it.
Exceptions
- ArgumentNullException
Thrown when the polygon is null.
DistanceTo(GeoPolygon3, Tolerance)
Calculates the shortest distance between this polygon and another one, within a tolerance: the answer of DistanceTo(GeoPolygon3, GeoPolygon3, Tolerance).
public double DistanceTo(GeoPolygon3 other, Tolerance tolerance)
Parameters
otherGeoPolygon3toleranceTolerance
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
Both are read as filled surfaces. A square 100 by 100 in the floor with a corner at the origin and one standing upright along y = 50 from z = 10 to 110 are 10 apart; one lying 0.0004 above it is 0.0004 away and touches it.
Exceptions
- ArgumentNullException
Thrown when the polygon is null.
DistanceTo(GeoRay3)
Calculates the shortest distance between this polygon and a ray: the answer of DistanceTo(GeoRay3, GeoPolygon3).
public double DistanceTo(GeoRay3 ray)
Parameters
rayGeoRay3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
The polygon is read as a filled surface. Beside the square 100 by 100 in the floor with a corner at the origin, the ray from (130, 50, 40) along X is 50 from its edge; the ray from (20, 20, 10) pointing straight down runs into it and is nought away.
DistanceTo(GeoRay3, Tolerance)
Calculates the shortest distance between this polygon and a ray, within a tolerance: the answer of DistanceTo(GeoRay3, GeoPolygon3, Tolerance).
public double DistanceTo(GeoRay3 ray, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
The polygon is read as a filled surface. Beside the square 100 by 100 in the floor with a corner at the origin, the ray from (130, 50, 40) along X is 50 from its edge; the ray from (20, 20, 10) pointing straight down runs into it and is nought away.
DistanceTo(GeoTriangle3)
Calculates the shortest distance between this polygon and a triangle: the answer of DistanceTo(GeoTriangle3, GeoPolygon3).
public double DistanceTo(GeoTriangle3 triangle)
Parameters
triangleGeoTriangle3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
Both are read as filled surfaces. The triangle with corners (0, 0, 0), (100, 0, 0) and (0, 100, 0) and the square 100 by 100 standing upright along y = 50 from z = 10 to 110 are 10 apart; standing from z = -50, the square crosses the triangle and is nought from it.
DistanceTo(GeoTriangle3, Tolerance)
Calculates the shortest distance between this polygon and a triangle, within a tolerance: the answer of DistanceTo(GeoTriangle3, GeoPolygon3, Tolerance).
public double DistanceTo(GeoTriangle3 triangle, Tolerance tolerance)
Parameters
triangleGeoTriangle3toleranceTolerance
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
Both are read as filled surfaces. The triangle with corners (0, 0, 0), (100, 0, 0) and (0, 100, 0) and the square 100 by 100 standing upright along y = 50 from z = 10 to 110 are 10 apart; standing from z = -50, the square crosses the triangle and is nought from it.
DistanceTo(GeoPlane3)
Calculates the shortest distance between this polygon and a plane: the answer of DistanceTo(GeoPlane3, GeoPolygon3).
public double DistanceTo(GeoPlane3 plane)
Parameters
planeGeoPlane3
Returns
- double
Nought where the plane crosses the shape or comes within the global point tolerance of it, otherwise the gap.
Remarks
The heights of the corners decide, as for a chain. A square 100 by 100 standing upright along y = 50 from z = 10 to 110 is 10 above the floor plane; one standing from z = -50 crosses it and is nought away.
DistanceTo(GeoPlane3, Tolerance)
Calculates the shortest distance between this polygon and a plane, within a tolerance: the answer of DistanceTo(GeoPlane3, GeoPolygon3, Tolerance).
public double DistanceTo(GeoPlane3 plane, Tolerance tolerance)
Parameters
Returns
- double
Nought where the plane crosses the shape or comes within the tolerance given of it, otherwise the gap.
Remarks
The heights of the corners decide, as for a chain. A square 100 by 100 standing upright along y = 50 from z = 10 to 110 is 10 above the floor plane; one standing from z = -50 crosses it and is nought away.
DistanceTo(GeoObb3)
Calculates the shortest distance between this polygon and an oriented box: the answer of DistanceTo(GeoPolygon3, GeoObb3).
public double DistanceTo(GeoObb3 box)
Parameters
boxGeoObb3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A triangle, polygon or face within a billionth of a millimetre of the outside of a box reads nought, for the same reason.
Remarks
The answer about the box's body, ToSolid(). The box 100 by 100 by 100 about (50, 50, 50) is 30 from the square 100 by 100 lying flat at a height of 130 over it, and nought from the square 200 by 200 lying across it at half its height.
Exceptions
- ArgumentNullException
Thrown when the oriented box is null.
DistanceTo(GeoObb3, Tolerance)
Calculates the shortest distance between this polygon and an oriented box, within a tolerance: the answer of DistanceTo(GeoPolygon3, GeoObb3, Tolerance).
public double DistanceTo(GeoObb3 box, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A triangle, polygon or face within a billionth of a millimetre of the outside of a box reads nought, for the same reason.
Remarks
The answer about the box's body, ToSolid(). The box 100 by 100 by 100 about (50, 50, 50) is 30 from the square 100 by 100 lying flat at a height of 130 over it, and nought from the square 200 by 200 lying across it at half its height.
Exceptions
- ArgumentNullException
Thrown when the oriented box is null.
DistanceTo(GeoAabb3)
Calculates the shortest distance between this polygon and an axis-aligned box: the answer of DistanceTo(GeoPolygon3, GeoAabb3).
public double DistanceTo(GeoAabb3 box)
Parameters
boxGeoAabb3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A triangle, polygon or face within a billionth of a millimetre of the outside of a box reads nought, for the same reason.
Remarks
The answer about the box's body, ToObb().ToSolid(). The box from the origin to (100, 100, 100) is 30 from
the square 100 by 100 lying flat at a height of 130 over it, and nought from the square 200 by 200 lying across
it at half its height.
Exceptions
- InvalidOperationException
Thrown when the box is empty.
DistanceTo(GeoAabb3, Tolerance)
Calculates the shortest distance between this polygon and an axis-aligned box, within a tolerance: the answer of DistanceTo(GeoPolygon3, GeoAabb3, Tolerance).
public double DistanceTo(GeoAabb3 box, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A triangle, polygon or face within a billionth of a millimetre of the outside of a box reads nought, for the same reason.
Remarks
The answer about the box's body, ToObb().ToSolid(). The box from the origin to (100, 100, 100) is 30 from
the square 100 by 100 lying flat at a height of 130 over it, and nought from the square 200 by 200 lying across
it at half its height.
Exceptions
- InvalidOperationException
Thrown when the box is empty.
DistanceTo(GeoSphere3)
Calculates the shortest distance from this polygon to a ball, using the default tolerance.
public double DistanceTo(GeoSphere3 sphere)
Parameters
sphereGeoSphere3
Returns
- double
Nought where the polygon reaches the ball, otherwise the gap, measured exactly.
DistanceTo(GeoSphere3, Tolerance)
Calculates the shortest distance from this polygon to a ball, within a tolerance.
public double DistanceTo(GeoSphere3 sphere, Tolerance tolerance)
Parameters
sphereGeoSphere3toleranceTolerance
Returns
- double
Nought where the polygon reaches the ball, otherwise the gap, measured exactly.
DistanceTo(GeoSpline3)
Calculates the shortest distance from this polygon to a spline, using the default tolerance.
public double DistanceTo(GeoSpline3 spline)
Parameters
splineGeoSpline3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the spline is null.
DistanceTo(GeoSpline3, Tolerance)
Calculates the shortest distance from this polygon to a spline, within a tolerance.
public double DistanceTo(GeoSpline3 spline, Tolerance tolerance)
Parameters
splineGeoSpline3toleranceTolerance
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly; the tolerance is not read.
Exceptions
- ArgumentNullException
Thrown when the spline is null.
DistanceTo(GeoXLine3)
Calculates the shortest distance from this polygon to an infinite line, using the default tolerance.
public double DistanceTo(GeoXLine3 xline)
Parameters
xlineGeoXLine3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoXLine3, Tolerance)
Calculates the shortest distance from this polygon to an infinite line, within a tolerance.
public double DistanceTo(GeoXLine3 xline, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.