Table of Contents

Method DistanceTo

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

DistanceTo(GeoPoint3)

Calculates the shortest distance from this segment to a point.

public double DistanceTo(GeoPoint3 point)

Parameters

point GeoPoint3

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)

Calculates the shortest distance between this segment and another segment.

public double DistanceTo(GeoLine3 other)

Parameters

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

DistanceTo(GeoRay3)

Calculates the shortest distance between this segment and a ray.

public double DistanceTo(GeoRay3 ray)

Parameters

ray GeoRay3

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(GeoPlane3)

Calculates the shortest distance between this segment and a plane.

public double DistanceTo(GeoPlane3 plane)

Parameters

plane GeoPlane3

Returns

double

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

DistanceTo(GeoTriangle3)

Calculates the shortest distance between this segment and a triangle.

public double DistanceTo(GeoTriangle3 triangle)

Parameters

triangle GeoTriangle3

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(GeoTriangle3, Tolerance)

Calculates the shortest distance between this segment and a triangle, within a tolerance: the same answer as DistanceTo(GeoLine3, 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 segment no longer than the tolerance given is read as its start point, except where it truly meets the other shape.

DistanceTo(GeoPolygon3)

Calculates the shortest distance between this segment and a polygon.

public double DistanceTo(GeoPolygon3 polygon)

Parameters

polygon GeoPolygon3

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(GeoPolygon3, Tolerance)

Calculates the shortest distance between this segment and a polygon, within a tolerance: the same answer as DistanceTo(GeoLine3, 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 segment no longer than the tolerance given is read as its start point, except where it truly meets the other shape.

DistanceTo(GeoSolid3)

Calculates the shortest distance between this segment and a solid. A segment reaching into the body is at distance zero.

public double DistanceTo(GeoSolid3 solid)

Parameters

solid GeoSolid3

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. A segment no longer than the global point tolerance is read as its start point, except where it truly meets the other shape.

DistanceTo(GeoSolid3, Tolerance)

Calculates the shortest distance between this segment and a solid, within a tolerance: the same answer as DistanceTo(GeoLine3, Tolerance).

public double DistanceTo(GeoSolid3 solid, Tolerance tolerance)

Parameters

solid GeoSolid3
tolerance Tolerance

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. 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 segment 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. A segment no longer than the global point tolerance is read as its start point, except where it truly meets the other shape.

DistanceTo(GeoPolyline3, Tolerance)

Gets the distance from this segment 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. A segment no longer than the tolerance given is read as its start point, except where it truly meets the other shape.

DistanceTo(GeoFace3)

Calculates the shortest distance between this segment and a face: the answer of DistanceTo(GeoLine3, GeoFace3).

public double DistanceTo(GeoFace3 face)

Parameters

face GeoFace3

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 face is read by its material. Over the square 100 by 100 in the floor with a corner at the origin and a hole 40 by 40 in its middle, the segment from (45, 50, -10) to (45, 50, 10), through the hole, is 15 from the rim; the segment from (20, 20, -10) to (20, 20, 10) crosses the material and is nought from it.

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoFace3, Tolerance)

Calculates the shortest distance between this segment and a face, within a tolerance: the answer of DistanceTo(GeoLine3, GeoFace3, 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 segment no longer than the tolerance given is read as its start point, except where it truly meets the other shape.

Remarks

The face is read by its material. Over the square 100 by 100 in the floor with a corner at the origin and a hole 40 by 40 in its middle, the segment from (45, 50, -10) to (45, 50, 10), through the hole, is 15 from the rim; the segment from (20, 20, -10) to (20, 20, 10) crosses the material and is nought from it.

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoObb3)

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

public double DistanceTo(GeoObb3 box)

Parameters

box GeoObb3

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.

Exceptions

ArgumentNullException

Thrown when the oriented box is null.

DistanceTo(GeoObb3, Tolerance)

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

public double DistanceTo(GeoObb3 box, Tolerance tolerance)

Parameters

box GeoObb3
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.

Exceptions

ArgumentNullException

Thrown when the oriented box is null.

DistanceTo(GeoAabb3)

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

public double DistanceTo(GeoAabb3 box)

Parameters

box GeoAabb3

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, ToObb().ToSolid(). The box from the origin to (100, 100, 100) is 50 from the segment from (150, 50, 50) to (150, 50, 150), and nought from one reaching into it.

Exceptions

InvalidOperationException

Thrown when the box is empty.

DistanceTo(GeoAabb3, Tolerance)

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

public double DistanceTo(GeoAabb3 box, Tolerance tolerance)

Parameters

box GeoAabb3
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, ToObb().ToSolid(). The box from the origin to (100, 100, 100) is 50 from the segment from (150, 50, 50) to (150, 50, 150), and nought from one reaching into it.

Exceptions

InvalidOperationException

Thrown when the box is empty.

DistanceTo(GeoSphere3)

Calculates the shortest distance from this segment to a ball, using the default tolerance.

public double DistanceTo(GeoSphere3 sphere)

Parameters

sphere GeoSphere3

Returns

double

Nought where the segment reaches the ball, otherwise the gap, measured exactly.

DistanceTo(GeoSphere3, Tolerance)

Calculates the shortest distance from this segment to a ball, within a tolerance.

public double DistanceTo(GeoSphere3 sphere, Tolerance tolerance)

Parameters

sphere GeoSphere3
tolerance Tolerance

Returns

double

Nought where the segment reaches the ball, otherwise the gap, measured exactly.

DistanceTo(GeoSpline3)

Calculates the shortest distance from this line segment 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 line segment 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 line segment 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 line segment 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.