Table of Contents

Method DistanceTo

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

DistanceTo(GeoPoint3)

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

public double DistanceTo(GeoPoint3 point)

Parameters

point GeoPoint3

The point.

Returns

double

The distance from the point to the nearest point of the curve. Nought only where the point truly lies on it, otherwise the gap, measured exactly; exact to rounding, however the curve bends.

DistanceTo(GeoPoint3, Tolerance)

Gets the distance from this spline to a point, within a tolerance.

public double DistanceTo(GeoPoint3 point, Tolerance tolerance)

Parameters

point GeoPoint3

The point.

tolerance Tolerance

The tolerance; not read, since the nearest point takes none.

Returns

double

The distance from the point to the nearest point of the curve, measured exactly. The circle of radius 100 about the origin in the floor, as FromCircle(GeoCircle3) makes it, is 60 from (160, 0, 0), 100 from its own centre and 104.4 from (0, 0, 30), which is 100 across and 30 up from every point of the rim.

Remarks

The nearest point is found as GetKnotAtPoint(GeoPoint3) finds it: on each span the parameters where the curve stops coming nearer, all of them, from the roots of a polynomial in Bernstein form, and the ends; whichever span cannot be nearer than the best found, by the box of its control points, is not solved. The boxes are kept in a tree, built once, so the spans near the point are reached without looking at the rest: a query costs time in the logarithm of the number of spans and the number whose boxes are near the point, as in the plane.

DistanceTo(GeoLine3)

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

public double DistanceTo(GeoLine3 line)

Parameters

line GeoLine3

Returns

double

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

DistanceTo(GeoLine3, Tolerance)

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

public double DistanceTo(GeoLine3 line, Tolerance tolerance)

Parameters

line GeoLine3

The line segment.

tolerance Tolerance

The tolerance: a line segment no longer than its point tolerance is read as its start where it does not truly meet the spline.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

DistanceTo(GeoRay3)

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

public double DistanceTo(GeoRay3 ray)

Parameters

ray GeoRay3

Returns

double

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

DistanceTo(GeoRay3, Tolerance)

Calculates the shortest distance from this spline to a ray, within a tolerance.

public double DistanceTo(GeoRay3 ray, Tolerance tolerance)

Parameters

ray GeoRay3

The ray.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

DistanceTo(GeoXLine3)

Calculates the shortest distance from this spline 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 spline to an infinite line, within a tolerance.

public double DistanceTo(GeoXLine3 xline, Tolerance tolerance)

Parameters

xline GeoXLine3

The infinite line.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

DistanceTo(GeoPlane3)

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

public double DistanceTo(GeoPlane3 plane)

Parameters

plane GeoPlane3

Returns

double

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

DistanceTo(GeoPlane3, Tolerance)

Calculates the shortest distance from this spline to a plane, within a tolerance.

public double DistanceTo(GeoPlane3 plane, Tolerance tolerance)

Parameters

plane GeoPlane3

The plane.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

A plane is a surface without ends, not a half of space: a spline that lies off it on one side is as far from it as its nearest point.

DistanceTo(GeoPolyline3)

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

Exceptions

ArgumentNullException

Thrown when the polyline is null.

DistanceTo(GeoPolyline3, Tolerance)

Calculates the shortest distance from this spline to a polyline, within a tolerance.

public double DistanceTo(GeoPolyline3 polyline, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The polyline.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Exceptions

ArgumentNullException

Thrown when the polyline is null.

DistanceTo(GeoPolygon3)

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

public double DistanceTo(GeoPolygon3 polygon)

Parameters

polygon GeoPolygon3

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoPolygon3, Tolerance)

Calculates the shortest distance from this spline to a polygon, within a tolerance.

public double DistanceTo(GeoPolygon3 polygon, Tolerance tolerance)

Parameters

polygon GeoPolygon3

The polygon.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

A polygon is a flat region here, as every curve reads it: a spline that pierces it, or lies in it, is nought from it.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoTriangle3)

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

public double DistanceTo(GeoTriangle3 triangle)

Parameters

triangle GeoTriangle3

Returns

double

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

DistanceTo(GeoTriangle3, Tolerance)

Calculates the shortest distance from this spline to a triangle, within a tolerance.

public double DistanceTo(GeoTriangle3 triangle, Tolerance tolerance)

Parameters

triangle GeoTriangle3

The triangle.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

A triangle is a flat region here, as every curve reads it: a spline that pierces it, or lies in it, is nought from it.

DistanceTo(GeoFace3)

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

public double DistanceTo(GeoFace3 face)

Parameters

face GeoFace3

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoFace3, Tolerance)

Calculates the shortest distance from this spline to a face, within a tolerance.

public double DistanceTo(GeoFace3 face, Tolerance tolerance)

Parameters

face GeoFace3

The face.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

A face is a flat region here, as every curve reads it: a spline that pierces it, or lies in it, is nought from it.

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoAabb3)

Calculates the shortest distance from this spline to an axis-aligned box, using the default tolerance.

public double DistanceTo(GeoAabb3 box)

Parameters

box GeoAabb3

Returns

double

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

DistanceTo(GeoAabb3, Tolerance)

Calculates the shortest distance from this spline to an axis-aligned box, within a tolerance.

public double DistanceTo(GeoAabb3 box, Tolerance tolerance)

Parameters

box GeoAabb3

The box.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

An axis-aligned box is material here, as every curve reads a body: a spline inside it is nought from it, though it crosses nothing.

DistanceTo(GeoObb3)

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

public double DistanceTo(GeoObb3 box)

Parameters

box GeoObb3

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the box is null.

DistanceTo(GeoObb3, Tolerance)

Calculates the shortest distance from this spline to an oriented box, within a tolerance.

public double DistanceTo(GeoObb3 box, Tolerance tolerance)

Parameters

box GeoObb3

The box.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

An oriented box is material here, as every curve reads a body: a spline inside it is nought from it, though it crosses nothing.

Exceptions

ArgumentNullException

Thrown when the box is null.

DistanceTo(GeoSolid3)

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

public double DistanceTo(GeoSolid3 solid)

Parameters

solid GeoSolid3

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the solid is null.

DistanceTo(GeoSolid3, Tolerance)

Calculates the shortest distance from this spline to a solid, within a tolerance.

public double DistanceTo(GeoSolid3 solid, Tolerance tolerance)

Parameters

solid GeoSolid3

The solid.

tolerance Tolerance

The tolerance; read only to cut the solid's openings in, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

A solid is material here, as every curve reads a body: a spline inside it is nought from it, though it crosses nothing.

Exceptions

ArgumentNullException

Thrown when the solid is null.

DistanceTo(GeoSphere3)

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

public double DistanceTo(GeoSphere3 sphere)

Parameters

sphere GeoSphere3

Returns

double

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

DistanceTo(GeoSphere3, Tolerance)

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

public double DistanceTo(GeoSphere3 sphere, Tolerance tolerance)

Parameters

sphere GeoSphere3

The ball.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

A ball is material here, as every curve reads a body: a spline inside it is nought from it, though it crosses nothing.

DistanceTo(GeoArc3)

Calculates the shortest distance from this spline to an arc, using the default tolerance.

public double DistanceTo(GeoArc3 arc)

Parameters

arc GeoArc3

Returns

double

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

DistanceTo(GeoArc3, Tolerance)

Calculates the shortest distance from this spline to an arc, within a tolerance.

public double DistanceTo(GeoArc3 arc, Tolerance tolerance)

Parameters

arc GeoArc3

The arc.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

DistanceTo(GeoCircle3)

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

public double DistanceTo(GeoCircle3 circle)

Parameters

circle GeoCircle3

Returns

double

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

DistanceTo(GeoCircle3, Tolerance)

Calculates the shortest distance from this spline to a circle, within a tolerance.

public double DistanceTo(GeoCircle3 circle, Tolerance tolerance)

Parameters

circle GeoCircle3

The circle.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

A circle is read as the disc it is for the distance, as its own distance to a point reads it: a spline that pierces the disc, or lies in it, is nought from it, though it meets no rim.

DistanceTo(GeoEllipse3)

Calculates the shortest distance from this spline to an ellipse, using the default tolerance.

public double DistanceTo(GeoEllipse3 ellipse)

Parameters

ellipse GeoEllipse3

Returns

double

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

DistanceTo(GeoEllipse3, Tolerance)

Calculates the shortest distance from this spline to an ellipse, within a tolerance.

public double DistanceTo(GeoEllipse3 ellipse, Tolerance tolerance)

Parameters

ellipse GeoEllipse3

The ellipse.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

An ellipse is read as the disc it is for the distance, as its own distance to a point reads it: a spline that pierces the disc, or lies in it, is nought from it, though it meets no rim.

DistanceTo(GeoEdge3)

Calculates the shortest distance from this spline to an edge, using the default tolerance.

public double DistanceTo(GeoEdge3 edge)

Parameters

edge GeoEdge3

Returns

double

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

DistanceTo(GeoEdge3, Tolerance)

Calculates the shortest distance from this spline to an edge, within a tolerance.

public double DistanceTo(GeoEdge3 edge, Tolerance tolerance)

Parameters

edge GeoEdge3

The edge.

tolerance Tolerance

The tolerance: a straight edge no longer than its point tolerance is read as its start where it does not truly meet the spline.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

DistanceTo(GeoPolylineArc3)

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

public double DistanceTo(GeoPolylineArc3 chain)

Parameters

chain GeoPolylineArc3

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc3, Tolerance)

Calculates the shortest distance from this spline to a curved chain, within a tolerance.

public double DistanceTo(GeoPolylineArc3 chain, Tolerance tolerance)

Parameters

chain GeoPolylineArc3

The curved chain.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolygonArc3)

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

public double DistanceTo(GeoPolygonArc3 loop)

Parameters

loop GeoPolygonArc3

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc3, Tolerance)

Calculates the shortest distance from this spline to a curved loop, within a tolerance.

public double DistanceTo(GeoPolygonArc3 loop, Tolerance tolerance)

Parameters

loop GeoPolygonArc3

The curved loop.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Remarks

A curved loop is measured to its outline, as its own distance to a point is: a spline inside it is not nought from it.

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoSpline3)

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

public double DistanceTo(GeoSpline3 other)

Parameters

other GeoSpline3

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the other spline is null.

DistanceTo(GeoSpline3, Tolerance)

Calculates the shortest distance from this spline to another, within a tolerance.

public double DistanceTo(GeoSpline3 other, Tolerance tolerance)

Parameters

other GeoSpline3

The other spline.

tolerance Tolerance

The tolerance; not read, since a distance is measured rather than judged.

Returns

double

Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.

Exceptions

ArgumentNullException

Thrown when the other spline is null.