Table of Contents

Method DistanceTo

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

DistanceTo(GeoPoint3)

Calculates the shortest distance from this box to a point. A point inside the box is at distance zero.

public double DistanceTo(GeoPoint3 point)

Parameters

point GeoPoint3

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.

DistanceTo(GeoPolyline3)

Gets the distance from this box to a polyline, using the default tolerance.

public double DistanceTo(GeoPolyline3 polyline)

Parameters

polyline GeoPolyline3

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.

DistanceTo(GeoPolyline3, Tolerance)

Gets the distance from this box to a polyline, within a tolerance.

public double DistanceTo(GeoPolyline3 polyline, Tolerance tolerance)

Parameters

polyline GeoPolyline3
tolerance Tolerance

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.

DistanceTo(GeoSolid3)

Gets the distance from this box to a solid, using the default tolerance.

public double DistanceTo(GeoSolid3 solid)

Parameters

solid GeoSolid3

Returns

double

Nought where the two lie within the global point tolerance of each other, otherwise the gap.

DistanceTo(GeoSolid3, Tolerance)

Gets the distance from this box to a solid, within a tolerance.

public double DistanceTo(GeoSolid3 solid, Tolerance tolerance)

Parameters

solid GeoSolid3
tolerance Tolerance

Returns

double

Nought where the two lie within the tolerance given of each other, otherwise the gap.

DistanceTo(GeoObb3)

Gets the distance from this box to a box, using the default tolerance.

public double DistanceTo(GeoObb3 other)

Parameters

other GeoObb3

Returns

double

Nought where the two lie within the global point tolerance of each other, otherwise the gap.

DistanceTo(GeoObb3, Tolerance)

Gets the distance from this box to a box, within a tolerance.

public double DistanceTo(GeoObb3 other, Tolerance tolerance)

Parameters

other GeoObb3
tolerance Tolerance

Returns

double

Nought where the two lie within the tolerance given of each other, otherwise the gap.

DistanceTo(GeoLine3)

Calculates the shortest distance between this oriented box and a segment: the answer of DistanceTo(GeoLine3, GeoObb3).

public double DistanceTo(GeoLine3 line)

Parameters

line GeoLine3

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.

Remarks

The answer about the box's body, ToSolid(). The box 100 by 100 by 100 about (50, 50, 50) is 50 from the segment from (150, 50, 50) to (150, 50, 150), and nought from one reaching into it.

DistanceTo(GeoLine3, Tolerance)

Calculates the shortest distance between this oriented box and a segment, within a tolerance: the answer of DistanceTo(GeoLine3, GeoObb3, Tolerance).

public double DistanceTo(GeoLine3 line, Tolerance tolerance)

Parameters

line GeoLine3
tolerance Tolerance

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.

Remarks

The answer about the box's body, ToSolid(). The box 100 by 100 by 100 about (50, 50, 50) is 50 from the segment from (150, 50, 50) to (150, 50, 150), and nought from one reaching into it.

DistanceTo(GeoRay3)

Calculates the shortest distance between this oriented box and a ray: the answer of DistanceTo(GeoRay3, GeoObb3).

public double DistanceTo(GeoRay3 ray)

Parameters

ray GeoRay3

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.

Remarks

The answer about the box's body, ToSolid(). The box 100 by 100 by 100 about (50, 50, 50) is 50 from the ray from (150, 50, 50) along X, and nought from the same ray turned round.

DistanceTo(GeoRay3, Tolerance)

Calculates the shortest distance between this oriented box and a ray, within a tolerance: the answer of DistanceTo(GeoRay3, GeoObb3, Tolerance).

public double DistanceTo(GeoRay3 ray, Tolerance tolerance)

Parameters

ray GeoRay3
tolerance Tolerance

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.

Remarks

The answer about the box's body, ToSolid(). The box 100 by 100 by 100 about (50, 50, 50) is 50 from the ray from (150, 50, 50) along X, and nought from the same ray turned round.

DistanceTo(GeoPlane3)

Calculates the shortest distance between this oriented box and a plane: the answer of DistanceTo(GeoPlane3, GeoObb3).

public double DistanceTo(GeoPlane3 plane)

Parameters

plane GeoPlane3

Returns

double

Nought where the plane crosses the shape or comes within the global point tolerance of it, otherwise the gap.

Remarks

The answer about the box's body, ToSolid(). The box 100 by 100 by 100 about (50, 50, 50) is 30 from the plane z = 130, and nought from the plane z = 50.

DistanceTo(GeoPlane3, Tolerance)

Calculates the shortest distance between this oriented box and a plane, within a tolerance: the answer of DistanceTo(GeoPlane3, GeoObb3, Tolerance).

public double DistanceTo(GeoPlane3 plane, Tolerance tolerance)

Parameters

plane GeoPlane3
tolerance Tolerance

Returns

double

Nought where the plane crosses the shape or comes within the tolerance given of it, otherwise the gap.

Remarks

The answer about the box's body, ToSolid(). The box 100 by 100 by 100 about (50, 50, 50) is 30 from the plane z = 130, and nought from the plane z = 50.

DistanceTo(GeoTriangle3)

Calculates the shortest distance between this oriented box and a triangle: the answer of DistanceTo(GeoTriangle3, GeoObb3).

public double DistanceTo(GeoTriangle3 triangle)

Parameters

triangle GeoTriangle3

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 triangle with corners (0, 0, 130), (100, 0, 130) and (0, 100, 130), and nought from one wholly inside it.

DistanceTo(GeoTriangle3, Tolerance)

Calculates the shortest distance between this oriented box and a triangle, within a tolerance: the answer of DistanceTo(GeoTriangle3, GeoObb3, Tolerance).

public double DistanceTo(GeoTriangle3 triangle, Tolerance tolerance)

Parameters

triangle GeoTriangle3
tolerance Tolerance

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 triangle with corners (0, 0, 130), (100, 0, 130) and (0, 100, 130), and nought from one wholly inside it.

DistanceTo(GeoPolygon3)

Calculates the shortest distance between this oriented box and a polygon: the answer of DistanceTo(GeoPolygon3, GeoObb3).

public double DistanceTo(GeoPolygon3 polygon)

Parameters

polygon GeoPolygon3

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 polygon is null.

DistanceTo(GeoPolygon3, Tolerance)

Calculates the shortest distance between this oriented box and a polygon, within a tolerance: the answer of DistanceTo(GeoPolygon3, GeoObb3, Tolerance).

public double DistanceTo(GeoPolygon3 polygon, Tolerance tolerance)

Parameters

polygon GeoPolygon3
tolerance Tolerance

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 polygon is null.

DistanceTo(GeoFace3)

Calculates the shortest distance between this oriented box and a face: the answer of DistanceTo(GeoFace3, GeoObb3).

public double DistanceTo(GeoFace3 face)

Parameters

face GeoFace3

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 face is read by its material. The box 100 by 100 by 100 about (50, 50, 50) 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 25 from its rim.

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoFace3, Tolerance)

Calculates the shortest distance between this oriented box and a face, within a tolerance: the answer of DistanceTo(GeoFace3, GeoObb3, Tolerance).

public double DistanceTo(GeoFace3 face, Tolerance tolerance)

Parameters

face GeoFace3
tolerance Tolerance

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 face is read by its material. The box 100 by 100 by 100 about (50, 50, 50) 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 25 from its rim.

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoAabb3)

Calculates the shortest distance between this oriented box and an axis-aligned box: the answer of DistanceTo(GeoObb3, GeoAabb3).

public double DistanceTo(GeoAabb3 box)

Parameters

box GeoAabb3

Returns

double

Nought where the two lie within the global point tolerance of each other, otherwise the gap.

Remarks

The answer of DistanceTo(GeoObb3, GeoObb3, Tolerance) with the axis-aligned box as ToObb(): two oriented boxes are measured as their bodies once the separating axis test has found them apart. The box from the origin to (100, 100, 100) and the box 100 by 100 by 100 about (250, 50, 50) are 100 apart.

Exceptions

InvalidOperationException

Thrown when the box is empty.

DistanceTo(GeoAabb3, Tolerance)

Calculates the shortest distance between this oriented box and an axis-aligned box, within a tolerance: the answer of DistanceTo(GeoObb3, GeoAabb3, Tolerance).

public double DistanceTo(GeoAabb3 box, Tolerance tolerance)

Parameters

box GeoAabb3
tolerance Tolerance

Returns

double

Nought where the two lie within the tolerance given of each other, otherwise the gap.

Remarks

The answer of DistanceTo(GeoObb3, GeoObb3, Tolerance) with the axis-aligned box as ToObb(): two oriented boxes are measured as their bodies once the separating axis test has found them apart. The box from the origin to (100, 100, 100) and the box 100 by 100 by 100 about (250, 50, 50) are 100 apart.

Exceptions

InvalidOperationException

Thrown when the box is empty.

DistanceTo(GeoSphere3)

Calculates the shortest distance from this oriented box to a ball.

public double DistanceTo(GeoSphere3 sphere)

Parameters

sphere GeoSphere3

Returns

double

Nought where the oriented box reaches the ball, otherwise the gap, measured exactly.

DistanceTo(GeoSpline3)

Calculates the shortest distance from this box to a spline, using the default tolerance.

public double DistanceTo(GeoSpline3 spline)

Parameters

spline GeoSpline3

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 box to a spline, within a tolerance.

public double DistanceTo(GeoSpline3 spline, Tolerance tolerance)

Parameters

spline GeoSpline3
tolerance Tolerance

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 box to an infinite line, using the default tolerance.

public double DistanceTo(GeoXLine3 xline)

Parameters

xline GeoXLine3

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.

DistanceTo(GeoXLine3, Tolerance)

Calculates the shortest distance from this box to an infinite line, within a tolerance.

public double DistanceTo(GeoXLine3 xline, Tolerance tolerance)

Parameters

xline GeoXLine3
tolerance Tolerance

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.