Table of Contents

Method CollidesWith

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

CollidesWith(GeoTriangle3, GeoSolid3)

Determines whether a triangle touches the material of a solid, using the default tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoSolid3 solid)

Parameters

triangle GeoTriangle3
solid GeoSolid3

Returns

bool

Remarks

A box 100 by 100 by 100 with a corner at the origin is touched by a triangle lying across it at half its height and by one wholly inside it, and not by one standing 10 clear of its top.

Exceptions

ArgumentNullException

Thrown when the solid is null.

CollidesWith(GeoTriangle3, GeoSolid3, Tolerance)

Determines whether a triangle touches the material of a solid, within a tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoSolid3 solid, Tolerance tolerance)

Parameters

triangle GeoTriangle3

The triangle.

solid GeoSolid3

The solid, read by its material.

tolerance Tolerance

The tolerance.

Returns

bool

true when the triangle comes within the point tolerance of the surface, crossing it included, or lies in the material; otherwise, false.

Remarks

A triangle wholly inside the body crosses no face and touches it all the same, so where its first corner is is asked once nothing crosses. A box 100 by 100 by 100 with a corner at the origin is touched by a triangle lying across it at half its height and by one wholly inside it, and not by one standing 10 clear of its top. A triangle with no area is the segment it has collapsed to, and touches as its distance says. Whether a point is in the body is asked to within rounding, a billionth of a millimetre (1E-9, not nought), so that rounding in a body turned about in space cannot lose a crossing: a point within 1E-9 outside the body reads as in it, and a point 5E-10 outside a box is nought away from it. Further out than a million the billionth is 1E-15 of the largest coordinate of the body and the point, past the rounding of numbers that size.

Exceptions

ArgumentNullException

Thrown when the solid is null.

CollidesWith(GeoTriangle3, GeoObb3)

Determines whether a triangle touches an oriented box, using the default tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoObb3 box)

Parameters

triangle GeoTriangle3
box GeoObb3

Returns

bool

Remarks

The answer of CollidesWith(GeoTriangle3, GeoSolid3, Tolerance) for ToSolid(): a box 100 by 100 by 100 is touched by a triangle wholly inside it and not by one 10 clear of its top. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: a box 100 by 100 by 0 is missed by a triangle lying 20 over it.

Exceptions

ArgumentNullException

Thrown when the box is null.

CollidesWith(GeoTriangle3, GeoObb3, Tolerance)

Determines whether a triangle touches an oriented box, within a tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoObb3 box, Tolerance tolerance)

Parameters

triangle GeoTriangle3
box GeoObb3
tolerance Tolerance

Returns

bool

Remarks

The answer of CollidesWith(GeoTriangle3, GeoSolid3, Tolerance) for ToSolid(): a box 100 by 100 by 100 is touched by a triangle wholly inside it and not by one 10 clear of its top. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: a box 100 by 100 by 0 is missed by a triangle lying 20 over it.

Exceptions

ArgumentNullException

Thrown when the box is null.

CollidesWith(GeoTriangle3, GeoAabb3)

Determines whether a triangle touches an axis-aligned box, using the default tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoAabb3 box)

Parameters

triangle GeoTriangle3
box GeoAabb3

Returns

bool

Remarks

The answer of CollidesWith(GeoTriangle3, GeoSolid3, Tolerance) for ToObb().ToSolid(): the box from the origin to (100, 100, 100) is touched by a triangle wholly inside it and not by one 10 clear of its top. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is missed by a triangle lying 20 over it.

Exceptions

InvalidOperationException

Thrown when the box is empty.

CollidesWith(GeoTriangle3, GeoAabb3, Tolerance)

Determines whether a triangle touches an axis-aligned box, within a tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoAabb3 box, Tolerance tolerance)

Parameters

triangle GeoTriangle3
box GeoAabb3
tolerance Tolerance

Returns

bool

Remarks

The answer of CollidesWith(GeoTriangle3, GeoSolid3, Tolerance) for ToObb().ToSolid(): the box from the origin to (100, 100, 100) is touched by a triangle wholly inside it and not by one 10 clear of its top. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is missed by a triangle lying 20 over it.

Exceptions

InvalidOperationException

Thrown when the box is empty.

CollidesWith(GeoPolygon3, GeoAabb3)

Determines whether a polygon touches an axis-aligned box, using the default tolerance.

public static bool CollidesWith(GeoPolygon3 polygon, GeoAabb3 box)

Parameters

polygon GeoPolygon3
box GeoAabb3

Returns

bool

Remarks

The answer of CollidesWith(GeoPolygon3, GeoSolid3, Tolerance) for ToObb().ToSolid(), as CollidesWith(GeoPolygon3, GeoObb3, Tolerance) reads an oriented box: the box from the origin to (100, 100, 100) is touched by the square 200 by 200 lying across it at half its height and not by one lying 10 above its top. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is touched by a square standing upright across it.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

InvalidOperationException

Thrown when the box is empty.

CollidesWith(GeoPolygon3, GeoAabb3, Tolerance)

Determines whether a polygon touches an axis-aligned box, within a tolerance.

public static bool CollidesWith(GeoPolygon3 polygon, GeoAabb3 box, Tolerance tolerance)

Parameters

polygon GeoPolygon3
box GeoAabb3
tolerance Tolerance

Returns

bool

Remarks

The answer of CollidesWith(GeoPolygon3, GeoSolid3, Tolerance) for ToObb().ToSolid(), as CollidesWith(GeoPolygon3, GeoObb3, Tolerance) reads an oriented box: the box from the origin to (100, 100, 100) is touched by the square 200 by 200 lying across it at half its height and not by one lying 10 above its top. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is touched by a square standing upright across it.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

InvalidOperationException

Thrown when the box is empty.

CollidesWith(GeoFace3, GeoObb3)

Determines whether the material of a face touches an oriented box, using the default tolerance.

public static bool CollidesWith(GeoFace3 face, GeoObb3 box)

Parameters

face GeoFace3
box GeoObb3

Returns

bool

Remarks

The answer of CollidesWith(GeoFace3, GeoSolid3, Tolerance) for ToSolid(): a box 100 by 100 by 100 is touched by the square 200 by 200 lying across it at half its height. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: a box 100 by 100 by 0 is not touched by a ring round it in its own plane, 60 from its edges.

Exceptions

ArgumentNullException

Thrown when the face or the box is null.

CollidesWith(GeoFace3, GeoObb3, Tolerance)

Determines whether the material of a face touches an oriented box, within a tolerance.

public static bool CollidesWith(GeoFace3 face, GeoObb3 box, Tolerance tolerance)

Parameters

face GeoFace3
box GeoObb3
tolerance Tolerance

Returns

bool

Remarks

The answer of CollidesWith(GeoFace3, GeoSolid3, Tolerance) for ToSolid(): a box 100 by 100 by 100 is touched by the square 200 by 200 lying across it at half its height. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: a box 100 by 100 by 0 is not touched by a ring round it in its own plane, 60 from its edges.

Exceptions

ArgumentNullException

Thrown when the face or the box is null.

CollidesWith(GeoFace3, GeoAabb3)

Determines whether the material of a face touches an axis-aligned box, using the default tolerance.

public static bool CollidesWith(GeoFace3 face, GeoAabb3 box)

Parameters

face GeoFace3
box GeoAabb3

Returns

bool

Remarks

The answer of CollidesWith(GeoFace3, GeoSolid3, Tolerance) for ToObb().ToSolid(): the box from the origin to (100, 100, 100) is touched by the square 200 by 200 lying across it at half its height. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is not touched by a ring round it in its own plane, 60 from its edges.

Exceptions

ArgumentNullException

Thrown when the face is null.

InvalidOperationException

Thrown when the box is empty.

CollidesWith(GeoFace3, GeoAabb3, Tolerance)

Determines whether the material of a face touches an axis-aligned box, within a tolerance.

public static bool CollidesWith(GeoFace3 face, GeoAabb3 box, Tolerance tolerance)

Parameters

face GeoFace3
box GeoAabb3
tolerance Tolerance

Returns

bool

Remarks

The answer of CollidesWith(GeoFace3, GeoSolid3, Tolerance) for ToObb().ToSolid(): the box from the origin to (100, 100, 100) is touched by the square 200 by 200 lying across it at half its height. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is not touched by a ring round it in its own plane, 60 from its edges.

Exceptions

ArgumentNullException

Thrown when the face is null.

InvalidOperationException

Thrown when the box is empty.

CollidesWith(GeoPlane3, GeoObb3)

Determines whether an oriented box touches a plane, using the default tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoObb3 box)

Parameters

plane GeoPlane3
box GeoObb3

Returns

bool

Remarks

The answer of CollidesWith(GeoPlane3, GeoSolid3, Tolerance) for ToSolid(): a box 100 by 100 by 100 standing on the floor is touched by the plane z = 100 through its top and missed by the plane z = 101. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: a box 100 by 100 by 0 lying on the floor is touched by the plane x = 30 and missed by the plane z = 20.

Exceptions

ArgumentNullException

Thrown when the box is null.

CollidesWith(GeoPlane3, GeoObb3, Tolerance)

Determines whether an oriented box touches a plane, within a tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoObb3 box, Tolerance tolerance)

Parameters

plane GeoPlane3
box GeoObb3
tolerance Tolerance

Returns

bool

Remarks

The answer of CollidesWith(GeoPlane3, GeoSolid3, Tolerance) for ToSolid(): a box 100 by 100 by 100 standing on the floor is touched by the plane z = 100 through its top and missed by the plane z = 101. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: a box 100 by 100 by 0 lying on the floor is touched by the plane x = 30 and missed by the plane z = 20.

Exceptions

ArgumentNullException

Thrown when the box is null.

CollidesWith(GeoPlane3, GeoAabb3)

Determines whether an axis-aligned box touches a plane, using the default tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoAabb3 box)

Parameters

plane GeoPlane3
box GeoAabb3

Returns

bool

Remarks

The answer of CollidesWith(GeoPlane3, GeoSolid3, Tolerance) for ToObb().ToSolid(): the box from the origin to (100, 100, 100) is touched by the plane z = 100 and missed by the plane z = 101. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is touched by the plane x = 30 and missed by the plane z = 20.

Exceptions

InvalidOperationException

Thrown when the box is empty.

CollidesWith(GeoPlane3, GeoAabb3, Tolerance)

Determines whether an axis-aligned box touches a plane, within a tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoAabb3 box, Tolerance tolerance)

Parameters

plane GeoPlane3
box GeoAabb3
tolerance Tolerance

Returns

bool

Remarks

The answer of CollidesWith(GeoPlane3, GeoSolid3, Tolerance) for ToObb().ToSolid(): the box from the origin to (100, 100, 100) is touched by the plane z = 100 and missed by the plane z = 101. A box flat on some axis, or no thicker than the point tolerance on two, is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is touched by the plane x = 30 and missed by the plane z = 20.

Exceptions

InvalidOperationException

Thrown when the box is empty.

CollidesWith(GeoAabb3, GeoAabb3)

Checks whether two axis-aligned boxes overlap, using the default tolerance.

public static bool CollidesWith(GeoAabb3 box1, GeoAabb3 box2)

Parameters

box1 GeoAabb3
box2 GeoAabb3

Returns

bool

CollidesWith(GeoAabb3, GeoAabb3, Tolerance)

Checks whether two axis-aligned boxes overlap, within a tolerance.

public static bool CollidesWith(GeoAabb3 box1, GeoAabb3 box2, Tolerance tolerance)

Parameters

box1 GeoAabb3
box2 GeoAabb3
tolerance Tolerance

Returns

bool

CollidesWith(GeoObb3, GeoObb3)

Checks whether two oriented boxes overlap, using the default tolerance.

public static bool CollidesWith(GeoObb3 box1, GeoObb3 box2)

Parameters

box1 GeoObb3
box2 GeoObb3

Returns

bool

CollidesWith(GeoObb3, GeoObb3, Tolerance)

Checks whether two oriented boxes overlap, within a tolerance.

public static bool CollidesWith(GeoObb3 box1, GeoObb3 box2, Tolerance tolerance)

Parameters

box1 GeoObb3

The first box.

box2 GeoObb3

The second box.

tolerance Tolerance

The tolerance; boxes closer than this count as touching.

Returns

bool

true if the boxes overlap or touch; otherwise, false.

Remarks

This is the separating axis theorem. Two convex shapes miss each other exactly when some direction exists along which their shadows do not overlap, and for a pair of boxes it is enough to try fifteen directions: the three axes of each box, and the nine cross products pairing one axis from each. The first six catch a face separating them and the last nine catch an edge, the case where two boxes pass by each other at an angle with no face facing the gap. Along every one of them the boxes may stand the point tolerance apart and no more, so two boxes whose nearest edges cross at a sine of a tenth, 0.005 apart, do not touch, and 0.0009 apart they do.

CollidesWith(GeoLine3, GeoObb3)

Checks whether a line segment reaches into an oriented box, using the default tolerance.

public static bool CollidesWith(GeoLine3 line, GeoObb3 box)

Parameters

line GeoLine3
box GeoObb3

Returns

bool

CollidesWith(GeoLine3, GeoObb3, Tolerance)

Checks whether a line segment reaches into an oriented box, within a tolerance.

public static bool CollidesWith(GeoLine3 line, GeoObb3 box, Tolerance tolerance)

Parameters

line GeoLine3
box GeoObb3
tolerance Tolerance

Returns

bool

Remarks

The box is read as its body, as DistanceTo(GeoLine3, GeoObb3, Tolerance) reads it, and they touch where that distance is no longer than the point tolerance: the box 100 by 100 by 50 with its top in the floor is touched by a segment in the floor starting 0.0005 off its side, and not by one starting 0.0012 off its corner, 0.00085 off in each direction.

CollidesWith(GeoTriangle3, GeoTriangle3)

Checks whether two triangles overlap, using the default tolerance.

public static bool CollidesWith(GeoTriangle3 triangle1, GeoTriangle3 triangle2)

Parameters

triangle1 GeoTriangle3
triangle2 GeoTriangle3

Returns

bool

CollidesWith(GeoTriangle3, GeoTriangle3, Tolerance)

Checks whether two triangles overlap, within a tolerance.

public static bool CollidesWith(GeoTriangle3 triangle1, GeoTriangle3 triangle2, Tolerance tolerance)

Parameters

triangle1 GeoTriangle3
triangle2 GeoTriangle3
tolerance Tolerance

Returns

bool

Remarks

Two triangles that are not coplanar can only meet along a line, so it is enough to ask whether any edge of one pierces the other. Coplanar triangles meet across an area instead and that test finds nothing, so they are handled separately by looking for a vertex of one inside the other or for a pair of edges crossing. They count as coplanar when their normals are parallel and either lies wholly within the planar tolerance of the other's plane, as two flat regions do, so the answer is the same whichever is asked first. Two that do neither touch where they come within the point tolerance of each other, the gap their distance measures.

CollidesWith(GeoSolid3, GeoSolid3)

Checks whether two solids overlap, using the default tolerance.

public static bool CollidesWith(GeoSolid3 solid1, GeoSolid3 solid2)

Parameters

solid1 GeoSolid3
solid2 GeoSolid3

Returns

bool

CollidesWith(GeoSolid3, GeoSolid3, Tolerance)

Checks whether two solids overlap, within a tolerance.

public static bool CollidesWith(GeoSolid3 solid1, GeoSolid3 solid2, Tolerance tolerance)

Parameters

solid1 GeoSolid3

The first solid.

solid2 GeoSolid3

The second solid.

tolerance Tolerance

The tolerance.

Returns

bool

true if the solids share any space; otherwise, false.

Remarks

Two closed bodies overlap in one of exactly two ways: their surfaces cross, or one sits wholly inside the other with no surface contact at all. The first is found by testing the surface triangles against each other, the second by testing a single vertex of each body against the other, which settles it because a body that is inside without touching is entirely inside. Bounding boxes are checked first, since that rejects most pairs before any triangle is touched.

CollidesWith(GeoObb3, GeoSolid3)

Checks whether an oriented box overlaps a solid, using the default tolerance.

public static bool CollidesWith(GeoObb3 box, GeoSolid3 solid)

Parameters

box GeoObb3
solid GeoSolid3

Returns

bool

CollidesWith(GeoObb3, GeoSolid3, Tolerance)

Checks whether an oriented box overlaps a solid, within a tolerance.

public static bool CollidesWith(GeoObb3 box, GeoSolid3 solid, Tolerance tolerance)

Parameters

box GeoObb3
solid GeoSolid3
tolerance Tolerance

Returns

bool

Remarks

A box flat on some axis, or no thicker than the point tolerance on two, bounds no body and is read as its rectangle, its segment or its point: a box 100 by 100 by 0 lying on the floor is missed by a cube 40 on a side standing 20 over it.

CollidesWith(GeoObb3, GeoAabb3)

Checks whether an oriented box overlaps an axis-aligned one, using the default tolerance.

public static bool CollidesWith(GeoObb3 box1, GeoAabb3 box2)

Parameters

box1 GeoObb3
box2 GeoAabb3

Returns

bool

CollidesWith(GeoObb3, GeoAabb3, Tolerance)

Checks whether an oriented box overlaps an axis-aligned one, within a tolerance.

public static bool CollidesWith(GeoObb3 box1, GeoAabb3 box2, Tolerance tolerance)

Parameters

box1 GeoObb3
box2 GeoAabb3
tolerance Tolerance

Returns

bool

Remarks

An axis-aligned box is an oriented box that happens to line up with the world, so this is the same separating axis test with one of the two frames already known.

CollidesWith(GeoLine3, GeoAabb3)

Checks whether a line segment reaches into an axis-aligned box, using the default tolerance.

public static bool CollidesWith(GeoLine3 line, GeoAabb3 box)

Parameters

line GeoLine3
box GeoAabb3

Returns

bool

CollidesWith(GeoLine3, GeoAabb3, Tolerance)

Checks whether a line segment reaches into an axis-aligned box, within a tolerance.

public static bool CollidesWith(GeoLine3 line, GeoAabb3 box, Tolerance tolerance)

Parameters

line GeoLine3
box GeoAabb3
tolerance Tolerance

Returns

bool

CollidesWith(GeoLine3, GeoSolid3)

Checks whether a line segment reaches into a solid, using the default tolerance.

public static bool CollidesWith(GeoLine3 line, GeoSolid3 solid)

Parameters

line GeoLine3
solid GeoSolid3

Returns

bool

CollidesWith(GeoLine3, GeoSolid3, Tolerance)

Checks whether a line segment reaches into a solid, within a tolerance.

public static bool CollidesWith(GeoLine3 line, GeoSolid3 solid, Tolerance tolerance)

Parameters

line GeoLine3
solid GeoSolid3
tolerance Tolerance

Returns

bool

Remarks

A segment lying wholly inside the body touches it without crossing its surface, so where its ends lie is asked as well as where it crosses. They touch where DistanceTo(GeoLine3, GeoSolid3, Tolerance) is no longer than the point tolerance, the openings the segment can reach cut in: a segment in the plane of the top of the box 100 by 100 by 50, starting 0.0005 off its side, touches it, and one starting 0.0012 off its corner, 0.00085 off in each direction, does not. Whether a point is in the body is asked to within rounding, a billionth of a millimetre (1E-9, not nought), so that rounding in a body turned about in space cannot lose a crossing: a point within 1E-9 outside the body reads as in it, and a point 5E-10 outside a box is nought away from it. Further out than a million the billionth is 1E-15 of the largest coordinate of the body and the point, past the rounding of numbers that size. The boxes are asked first as far apart as that too, which reaches every point tolerance below that billionth, or below 1E-15 of the largest coordinate further out than a million: at a tolerance of nought, and of 1E-12, 1E-10 or 3E-10, the segment standing up from 5E-10 over the top of the box 100 by 80 by 50 touches it, as it is nought from it, and so does the one from 1E-7 over the top of that box a thousand million out at nought, where the boxes were asked at the tolerance given and they touched nothing.

CollidesWith(GeoPolyline3, GeoSolid3)

Checks whether a polyline reaches into a solid, using the default tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoSolid3 solid)

Parameters

polyline GeoPolyline3
solid GeoSolid3

Returns

bool

CollidesWith(GeoPolyline3, GeoSolid3, Tolerance)

Checks whether a polyline reaches into a solid, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoSolid3 solid, Tolerance tolerance)

Parameters

polyline GeoPolyline3
solid GeoSolid3
tolerance Tolerance

Returns

bool

Remarks

Whether a point is in the body is asked to within rounding, a billionth of a millimetre (1E-9, not nought), so that rounding in a body turned about in space cannot lose a crossing: a point within 1E-9 outside the body reads as in it, and a point 5E-10 outside a box is nought away from it. Further out than a million the billionth is 1E-15 of the largest coordinate of the body and the point, past the rounding of numbers that size.

CollidesWith(GeoPolygon3, GeoSolid3)

Checks whether a polygon overlaps a solid, using the default tolerance.

public static bool CollidesWith(GeoPolygon3 polygon, GeoSolid3 solid)

Parameters

polygon GeoPolygon3
solid GeoSolid3

Returns

bool

CollidesWith(GeoPolygon3, GeoSolid3, Tolerance)

Checks whether a polygon overlaps a solid, within a tolerance.

public static bool CollidesWith(GeoPolygon3 polygon, GeoSolid3 solid, Tolerance tolerance)

Parameters

polygon GeoPolygon3
solid GeoSolid3
tolerance Tolerance

Returns

bool

Remarks

The polygon is read filled and the body by its material, every opening the polygon can reach cut in, as a triangle is read against a body (CollidesWith(GeoTriangle3, GeoSolid3, Tolerance)): they meet where an edge of the polygon crosses the surface, where an edge of the body crosses the polygon, or where a corner of the polygon lies in the material. Through the box 40 by 40 by 20 from the origin with an opening 10 by 10 from x, y = 15 to 25 right through it, the square standing upright in y = 20 from x = 17 to 23, 2 clear of the opening's walls, touches nothing. Whether a point is in the body is asked to within rounding, a billionth of a millimetre (1E-9, not nought), so that rounding in a body turned about in space cannot lose a crossing: a point within 1E-9 outside the body reads as in it, and a point 5E-10 outside a box is nought away from it. Further out than a million the billionth is 1E-15 of the largest coordinate of the body and the point, past the rounding of numbers that size.

CollidesWith(GeoPolygon3, GeoObb3)

Checks whether a polygon overlaps an oriented box, using the default tolerance.

public static bool CollidesWith(GeoPolygon3 polygon, GeoObb3 box)

Parameters

polygon GeoPolygon3
box GeoObb3

Returns

bool

CollidesWith(GeoPolygon3, GeoObb3, Tolerance)

Checks whether a polygon overlaps an oriented box, within a tolerance.

public static bool CollidesWith(GeoPolygon3 polygon, GeoObb3 box, Tolerance tolerance)

Parameters

polygon GeoPolygon3
box GeoObb3
tolerance Tolerance

Returns

bool

Remarks

A box flat on some axis, or no thicker than the point tolerance on two, bounds no body and is read as its rectangle, its segment or its point: a box 100 by 100 by 0 lying on the floor is touched by a square standing upright across it.

CollidesWith(GeoFace3, GeoSolid3)

Checks whether a face overlaps a solid, using the default tolerance.

public static bool CollidesWith(GeoFace3 face, GeoSolid3 solid)

Parameters

face GeoFace3
solid GeoSolid3

Returns

bool

CollidesWith(GeoFace3, GeoSolid3, Tolerance)

Checks whether a face overlaps a solid, within a tolerance.

public static bool CollidesWith(GeoFace3 face, GeoSolid3 solid, Tolerance tolerance)

Parameters

face GeoFace3
solid GeoSolid3
tolerance Tolerance

Returns

bool

Remarks

The face is read by its material and the body by its own, every opening the face can reach cut in, as a polygon is: they meet where an edge of the face, round its outline or round a hole, crosses the surface, where an edge of the body crosses the material, or where a corner of the face lies in the body. A hole is material that is not there, so a body reaching only into a hole touches nothing, while the rim of the hole is material and counts. A diamond standing on its corner on the top of the box 40 by 40 by 20 from the origin touches it whatever holes it has above. Whether a point is in the body is asked to within rounding, a billionth of a millimetre (1E-9, not nought), so that rounding in a body turned about in space cannot lose a crossing: a point within 1E-9 outside the body reads as in it, and a point 5E-10 outside a box is nought away from it. Further out than a million the billionth is 1E-15 of the largest coordinate of the body and the point, past the rounding of numbers that size.

CollidesWith(GeoLine3, GeoPlane3)

Determines whether a segment touches a plane.

public static bool CollidesWith(GeoLine3 line, GeoPlane3 plane)

Parameters

line GeoLine3
plane GeoPlane3

Returns

bool

CollidesWith(GeoLine3, GeoPlane3, Tolerance)

Determines whether a segment touches a plane, within a tolerance.

public static bool CollidesWith(GeoLine3 line, GeoPlane3 plane, Tolerance tolerance)

Parameters

line GeoLine3
plane GeoPlane3
tolerance Tolerance

Returns

bool

Remarks

A plane is endless, so this is not a crossing test: a segment lying in the plane touches it along its whole length and crosses it nowhere. The two ends decide it — either one on the plane, or one each side of it.

CollidesWith(GeoLine3, GeoTriangle3)

Determines whether a segment touches a triangle.

public static bool CollidesWith(GeoLine3 line, GeoTriangle3 triangle)

Parameters

line GeoLine3
triangle GeoTriangle3

Returns

bool

CollidesWith(GeoLine3, GeoTriangle3, Tolerance)

Determines whether a segment touches a triangle, within a tolerance.

public static bool CollidesWith(GeoLine3 line, GeoTriangle3 triangle, Tolerance tolerance)

Parameters

line GeoLine3
triangle GeoTriangle3
tolerance Tolerance

Returns

bool

Remarks

They touch where DistanceTo(GeoLine3, GeoTriangle3, Tolerance) is no longer than the point tolerance: the segment from (-10, 10, 0) to (110, 10, 0), lying in the plane of the triangle with corners (0, 0, 0), (100, 0, 0) and (0, 100, 0) and across it, touches it; the one from (60, 60, 0) to (90, 60, 0), beyond its long side, touches nothing; and the one from (50, -0.0005, 0) to (50, -50, 0), starting 0.0005 off its side y = 0, touches it, from either end. A triangle with no area is the segment it has collapsed to, and touches as its distance says: the one with corners (0, 0, 0), (100, 0, 0) and (50, 1E-8, 0) is nought from a segment through its middle and collides with it, where it collided with nothing.

CollidesWith(GeoLine3, GeoPolygon3)

Determines whether a segment touches a polygon.

public static bool CollidesWith(GeoLine3 line, GeoPolygon3 polygon)

Parameters

line GeoLine3
polygon GeoPolygon3

Returns

bool

CollidesWith(GeoLine3, GeoPolygon3, Tolerance)

Determines whether a segment touches a polygon, within a tolerance.

public static bool CollidesWith(GeoLine3 line, GeoPolygon3 polygon, Tolerance tolerance)

Parameters

line GeoLine3
polygon GeoPolygon3
tolerance Tolerance

Returns

bool

Remarks

They touch where DistanceTo(GeoLine3, GeoPolygon3, Tolerance) is no longer than the point tolerance, the polygon read filled: the segment from (-10, 10, 0) to (110, 10, 0) touches the square 100 by 100 in the floor with a corner at the origin, and so does one lying wholly inside it, and one starting 0.0005 off its side in its plane; one hovering 0.0003 over it touches it, and one 0.0009 up and 0.0009 out from its side does not.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

CollidesWith(GeoLine3, GeoFace3)

Determines whether a segment touches a face.

public static bool CollidesWith(GeoLine3 line, GeoFace3 face)

Parameters

line GeoLine3
face GeoFace3

Returns

bool

CollidesWith(GeoLine3, GeoFace3, Tolerance)

Determines whether a segment touches a face, within a tolerance.

public static bool CollidesWith(GeoLine3 line, GeoFace3 face, Tolerance tolerance)

Parameters

line GeoLine3
face GeoFace3
tolerance Tolerance

Returns

bool

Remarks

They touch where DistanceTo(GeoLine3, GeoFace3, Tolerance) is no longer than the point tolerance, the face read by its material: a segment passing over a hole of the face touches nothing, because the holes are the absences they are. Over the square 100 by 100 in the floor with a hole 40 by 40 in its middle, the segment from (-10, 10, 0) to (110, 10, 0) touches it, and the one from (40, 50, 0) to (60, 50, 0), lying in the hole and reaching its rim, touches it there; the one from (41, 50, 0) to (59, 50, 0), a thousandth short of the rim either side, touches nothing.

Exceptions

ArgumentNullException

Thrown when the face is null.

CollidesWith(GeoRay3, GeoTriangle3)

Determines whether a ray runs into a triangle.

public static bool CollidesWith(GeoRay3 ray, GeoTriangle3 triangle)

Parameters

ray GeoRay3
triangle GeoTriangle3

Returns

bool

CollidesWith(GeoRay3, GeoTriangle3, Tolerance)

Determines whether a ray runs into a triangle, within a tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoTriangle3 triangle, Tolerance tolerance)

Parameters

ray GeoRay3
triangle GeoTriangle3
tolerance Tolerance

Returns

bool

Remarks

They touch where DistanceTo(GeoRay3, GeoTriangle3, Tolerance) is no longer than the point tolerance. A ray lying in the plane of the triangle crosses it nowhere, and is read as a segment lying in the plane as far as the corner farthest from its origin, since past that it only draws away: the ray from (-10, 10, 0) along X runs into the triangle with corners (0, 0, 0), (100, 0, 0) and (0, 100, 0), and the one pointing along -X from there misses it. A triangle with no area is the segment it has collapsed to, and touches as its distance says.

CollidesWith(GeoRay3, GeoPolygon3)

Determines whether a ray runs into a polygon.

public static bool CollidesWith(GeoRay3 ray, GeoPolygon3 polygon)

Parameters

ray GeoRay3
polygon GeoPolygon3

Returns

bool

CollidesWith(GeoRay3, GeoPolygon3, Tolerance)

Determines whether a ray runs into a polygon, within a tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoPolygon3 polygon, Tolerance tolerance)

Parameters

ray GeoRay3
polygon GeoPolygon3
tolerance Tolerance

Returns

bool

Remarks

They touch where DistanceTo(GeoRay3, GeoPolygon3, Tolerance) is no longer than the point tolerance. A ray lying in the plane of the polygon crosses it nowhere, and is read as a segment lying in the plane as far as the corner farthest from its origin, since past that it only draws away: the ray from (-10, 10, 0) along X runs into the square 100 by 100 in the floor with a corner at the origin, one starting inside the square touches it whichever way along the floor it points, and one starting 0.0005 off its side and pointing away touches it.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

CollidesWith(GeoRay3, GeoFace3)

Determines whether a ray runs into a face.

public static bool CollidesWith(GeoRay3 ray, GeoFace3 face)

Parameters

ray GeoRay3
face GeoFace3

Returns

bool

CollidesWith(GeoRay3, GeoFace3, Tolerance)

Determines whether a ray runs into a face, within a tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoFace3 face, Tolerance tolerance)

Parameters

ray GeoRay3
face GeoFace3
tolerance Tolerance

Returns

bool

Remarks

They touch where DistanceTo(GeoRay3, GeoFace3, Tolerance) is no longer than the point tolerance. A ray lying in the plane of the face crosses it nowhere, and is read as a segment lying in the plane as far as the corner of the outline farthest from its origin, since past that it only draws away: the ray from (-10, 10, 0) along X runs into the square 100 by 100 in the floor, and the one from (50, 50, 0), in the middle of a hole 20 by 20 cut out of it, runs into the rim of the hole whichever way along the floor it points.

Exceptions

ArgumentNullException

Thrown when the face is null.

CollidesWith(GeoRay3, GeoAabb3)

Determines whether a ray starts inside an axis-aligned box or runs into it.

public static bool CollidesWith(GeoRay3 ray, GeoAabb3 box)

Parameters

ray GeoRay3
box GeoAabb3

Returns

bool

CollidesWith(GeoRay3, GeoAabb3, Tolerance)

Determines whether a ray starts inside an axis-aligned box or runs into it, within a tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoAabb3 box, Tolerance tolerance)

Parameters

ray GeoRay3
box GeoAabb3
tolerance Tolerance

Returns

bool

CollidesWith(GeoRay3, GeoObb3)

Determines whether a ray starts inside an oriented box or runs into it.

public static bool CollidesWith(GeoRay3 ray, GeoObb3 box)

Parameters

ray GeoRay3
box GeoObb3

Returns

bool

CollidesWith(GeoRay3, GeoObb3, Tolerance)

Determines whether a ray starts inside an oriented box or runs into it, within a tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoObb3 box, Tolerance tolerance)

Parameters

ray GeoRay3
box GeoObb3
tolerance Tolerance

Returns

bool

CollidesWith(GeoAabb3, GeoSolid3)

Determines whether an axis-aligned box touches or overlaps a solid.

public static bool CollidesWith(GeoAabb3 box, GeoSolid3 solid)

Parameters

box GeoAabb3
solid GeoSolid3

Returns

bool

CollidesWith(GeoAabb3, GeoSolid3, Tolerance)

Determines whether an axis-aligned box touches or overlaps a solid, within a tolerance.

public static bool CollidesWith(GeoAabb3 box, GeoSolid3 solid, Tolerance tolerance)

Parameters

box GeoAabb3
solid GeoSolid3
tolerance Tolerance

Returns

bool

Remarks

An axis-aligned box is an oriented box whose axes happen to be the world's, so this is the oriented answer and not an approximation of it. A box flat on some axis is read as its rectangle, its segment or its point: the box from the origin to (100, 100, 0) is missed by a cube 40 on a side standing 20 over it.

Exceptions

ArgumentNullException

Thrown when the solid is null.

CollidesWith(GeoPolyline3, GeoPlane3)

Determines whether a straight chain touches a plane.

public static bool CollidesWith(GeoPolyline3 polyline, GeoPlane3 plane)

Parameters

polyline GeoPolyline3
plane GeoPlane3

Returns

bool

CollidesWith(GeoPolyline3, GeoPlane3, Tolerance)

Determines whether a straight chain touches a plane, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoPlane3 plane, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

plane GeoPlane3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoLine3)

Determines whether a straight chain touches a segment.

public static bool CollidesWith(GeoPolyline3 polyline, GeoLine3 line)

Parameters

polyline GeoPolyline3
line GeoLine3

Returns

bool

CollidesWith(GeoPolyline3, GeoLine3, Tolerance)

Determines whether a straight chain touches a segment, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoLine3 line, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

line GeoLine3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoRay3)

Determines whether a straight chain touches a ray.

public static bool CollidesWith(GeoPolyline3 polyline, GeoRay3 ray)

Parameters

polyline GeoPolyline3
ray GeoRay3

Returns

bool

CollidesWith(GeoPolyline3, GeoRay3, Tolerance)

Determines whether a straight chain touches a ray, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoRay3 ray, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

ray GeoRay3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoArc3)

Determines whether a straight chain touches an arc.

public static bool CollidesWith(GeoPolyline3 polyline, GeoArc3 arc)

Parameters

polyline GeoPolyline3
arc GeoArc3

Returns

bool

CollidesWith(GeoPolyline3, GeoArc3, Tolerance)

Determines whether a straight chain touches an arc, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoArc3 arc, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

arc GeoArc3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoCircle3)

Determines whether a straight chain touches a circle.

public static bool CollidesWith(GeoPolyline3 polyline, GeoCircle3 circle)

Parameters

polyline GeoPolyline3
circle GeoCircle3

Returns

bool

CollidesWith(GeoPolyline3, GeoCircle3, Tolerance)

Determines whether a straight chain touches a circle, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoCircle3 circle, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

circle GeoCircle3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoTriangle3)

Determines whether a straight chain touches a triangle.

public static bool CollidesWith(GeoPolyline3 polyline, GeoTriangle3 triangle)

Parameters

polyline GeoPolyline3
triangle GeoTriangle3

Returns

bool

CollidesWith(GeoPolyline3, GeoTriangle3, Tolerance)

Determines whether a straight chain touches a triangle, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoTriangle3 triangle, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

triangle GeoTriangle3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoPolygon3)

Determines whether a straight chain touches a polygon.

public static bool CollidesWith(GeoPolyline3 polyline, GeoPolygon3 polygon)

Parameters

polyline GeoPolyline3
polygon GeoPolygon3

Returns

bool

CollidesWith(GeoPolyline3, GeoPolygon3, Tolerance)

Determines whether a straight chain touches a polygon, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoPolygon3 polygon, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

polygon GeoPolygon3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoFace3)

Determines whether a straight chain touches a face.

public static bool CollidesWith(GeoPolyline3 polyline, GeoFace3 face)

Parameters

polyline GeoPolyline3
face GeoFace3

Returns

bool

CollidesWith(GeoPolyline3, GeoFace3, Tolerance)

Determines whether a straight chain touches a face, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoFace3 face, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

face GeoFace3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoObb3)

Determines whether a straight chain touches a box.

public static bool CollidesWith(GeoPolyline3 polyline, GeoObb3 box)

Parameters

polyline GeoPolyline3
box GeoObb3

Returns

bool

CollidesWith(GeoPolyline3, GeoObb3, Tolerance)

Determines whether a straight chain touches a box, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoObb3 box, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

box GeoObb3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoAabb3)

Determines whether a straight chain touches a square box.

public static bool CollidesWith(GeoPolyline3 polyline, GeoAabb3 box)

Parameters

polyline GeoPolyline3
box GeoAabb3

Returns

bool

CollidesWith(GeoPolyline3, GeoAabb3, Tolerance)

Determines whether a straight chain touches a square box, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoAabb3 box, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The chain.

box GeoAabb3

The shape to test against.

tolerance Tolerance

The tolerance.

Returns

bool

true when any of its segments touches; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the chain is null.

CollidesWith(GeoPolyline3, GeoPolyline3)

Determines whether two straight chains touch.

public static bool CollidesWith(GeoPolyline3 polyline, GeoPolyline3 other)

Parameters

polyline GeoPolyline3
other GeoPolyline3

Returns

bool

CollidesWith(GeoPolyline3, GeoPolyline3, Tolerance)

Determines whether two straight chains touch, within a tolerance.

public static bool CollidesWith(GeoPolyline3 polyline, GeoPolyline3 other, Tolerance tolerance)

Parameters

polyline GeoPolyline3

The first chain.

other GeoPolyline3

The second chain.

tolerance Tolerance

The tolerance.

Returns

bool

true when they meet anywhere, whether at a place or along a length; otherwise, false.

Remarks

Two segments lying along each other meet along a length and cross nowhere, so this is not the crossing test with the place thrown away.

Exceptions

ArgumentNullException

Thrown when either chain is null.

CollidesWith(GeoRay3, GeoSolid3)

Determines whether a ray starts inside a solid or runs into it.

public static bool CollidesWith(GeoRay3 ray, GeoSolid3 solid)

Parameters

ray GeoRay3
solid GeoSolid3

Returns

bool

CollidesWith(GeoRay3, GeoSolid3, Tolerance)

Determines whether a ray starts inside a solid or runs into it, within a tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoSolid3 solid, Tolerance tolerance)

Parameters

ray GeoRay3
solid GeoSolid3
tolerance Tolerance

Returns

bool

Remarks

A ray leaving from inside the body never crosses its surface on the way out of nothing, so where it starts is asked before any face is tried. They touch where DistanceTo(GeoRay3, GeoSolid3, Tolerance) is no longer than the point tolerance: a ray in the plane of the top of the box 100 by 100 by 50, starting 0.0005 off its side and pointing away, touches it. Whether a point is in the body is asked to within rounding, a billionth of a millimetre (1E-9, not nought), so that rounding in a body turned about in space cannot lose a crossing: a point within 1E-9 outside the body reads as in it, and a point 5E-10 outside a box is nought away from it. Further out than a million the billionth is 1E-15 of the largest coordinate of the body and the point, past the rounding of numbers that size.

CollidesWith(GeoTriangle3, GeoPolygon3)

Determines whether a triangle and a polygon touch, using the default tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoPolygon3 polygon)

Parameters

triangle GeoTriangle3
polygon GeoPolygon3

Returns

bool

Remarks

The triangle with corners (0, 0, 0), (100, 0, 0) and (0, 100, 0) touches the square 100 by 100 standing upright across it along y = 50; moved up to stand on z = 10 the square misses it.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

CollidesWith(GeoTriangle3, GeoPolygon3, Tolerance)

Determines whether a triangle and a polygon touch, within a tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoPolygon3 polygon, Tolerance tolerance)

Parameters

triangle GeoTriangle3

The triangle.

polygon GeoPolygon3

The polygon.

tolerance Tolerance

The tolerance.

Returns

bool

true when they overlap or touch anywhere; otherwise, false.

Remarks

The triangle with corners (0, 0, 0), (100, 0, 0) and (0, 100, 0) touches the square 100 by 100 standing upright across it along y = 50; moved up to stand on z = 10 the square misses it. A triangle with no area is the segment it has collapsed to, as CollidesWith(GeoTriangle3, GeoTriangle3, Tolerance) reads it.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

CollidesWith(GeoTriangle3, GeoFace3)

Determines whether a triangle and the material of a face touch, using the default tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoFace3 face)

Parameters

triangle GeoTriangle3
face GeoFace3

Returns

bool

Remarks

The square 100 by 100 in the floor with a hole 40 by 40 in its middle is not touched by the triangle with corners (40, 50, -10), (60, 50, -10) and (50, 50, 10) standing in the hole; moved 30 along X, onto the material, it is.

Exceptions

ArgumentNullException

Thrown when the face is null.

CollidesWith(GeoTriangle3, GeoFace3, Tolerance)

Determines whether a triangle and the material of a face touch, within a tolerance.

public static bool CollidesWith(GeoTriangle3 triangle, GeoFace3 face, Tolerance tolerance)

Parameters

triangle GeoTriangle3

The triangle.

face GeoFace3

The face, read by its material.

tolerance Tolerance

The tolerance.

Returns

bool

true when the triangle overlaps or touches the material anywhere; otherwise, false.

Remarks

The square 100 by 100 in the floor with a hole 40 by 40 in its middle is not touched by the triangle with corners (40, 50, -10), (60, 50, -10) and (50, 50, 10) standing in the hole; moved 30 along X, onto the material, it is.

Exceptions

ArgumentNullException

Thrown when the face is null.

CollidesWith(GeoPolygon3, GeoPolygon3)

Determines whether two polygons touch, using the default tolerance.

public static bool CollidesWith(GeoPolygon3 polygon1, GeoPolygon3 polygon2)

Parameters

polygon1 GeoPolygon3
polygon2 GeoPolygon3

Returns

bool

Remarks

A square 100 by 100 lying in the floor with a corner at the origin touches one standing upright across it along y = 50, and one lying beside it from x = 100 to 200; one lying 10 above it touches nothing.

Exceptions

ArgumentNullException

Thrown when either polygon is null.

CollidesWith(GeoPolygon3, GeoPolygon3, Tolerance)

Determines whether two polygons touch, within a tolerance.

public static bool CollidesWith(GeoPolygon3 polygon1, GeoPolygon3 polygon2, Tolerance tolerance)

Parameters

polygon1 GeoPolygon3

The first polygon.

polygon2 GeoPolygon3

The second polygon.

tolerance Tolerance

The tolerance.

Returns

bool

true when they overlap or touch anywhere; otherwise, false.

Remarks

A square 100 by 100 lying in the floor with a corner at the origin touches one standing upright across it along y = 50, and one lying beside it from x = 100 to 200; one lying 10 above it touches nothing. They touch exactly where DistanceTo(GeoPolygon3, GeoPolygon3, Tolerance) is no longer than the point tolerance: the square from x = 100.0005 to 200 touches it at a tolerance of a thousandth, and the one from x = 100.0012 does not.

Exceptions

ArgumentNullException

Thrown when either polygon is null.

CollidesWith(GeoFace3, GeoPolygon3)

Determines whether the material of a face and a polygon touch, using the default tolerance.

public static bool CollidesWith(GeoFace3 face, GeoPolygon3 polygon)

Parameters

face GeoFace3
polygon GeoPolygon3

Returns

bool

Remarks

The square 100 by 100 in the floor with a hole 40 by 40 in its middle is not touched by a square 20 by 20 standing upright in the middle of the hole, nor by one lying in the hole; one lying across the rim touches it.

Exceptions

ArgumentNullException

Thrown when the face or the polygon is null.

CollidesWith(GeoFace3, GeoPolygon3, Tolerance)

Determines whether the material of a face and a polygon touch, within a tolerance.

public static bool CollidesWith(GeoFace3 face, GeoPolygon3 polygon, Tolerance tolerance)

Parameters

face GeoFace3

The face, read by its material.

polygon GeoPolygon3

The polygon.

tolerance Tolerance

The tolerance.

Returns

bool

true when the polygon overlaps or touches the material anywhere; otherwise, false.

Remarks

The square 100 by 100 in the floor with a hole 40 by 40 in its middle is not touched by a square 20 by 20 standing upright in the middle of the hole, nor by one lying in the hole; one lying across the rim touches it.

Exceptions

ArgumentNullException

Thrown when the face or the polygon is null.

CollidesWith(GeoFace3, GeoFace3)

Determines whether the materials of two faces touch, using the default tolerance.

public static bool CollidesWith(GeoFace3 face1, GeoFace3 face2)

Parameters

face1 GeoFace3
face2 GeoFace3

Returns

bool

Remarks

A face lying wholly in a hole of another, in its plane or standing across it, touches nothing; one lying on its material touches it.

Exceptions

ArgumentNullException

Thrown when either face is null.

CollidesWith(GeoFace3, GeoFace3, Tolerance)

Determines whether the materials of two faces touch, within a tolerance.

public static bool CollidesWith(GeoFace3 face1, GeoFace3 face2, Tolerance tolerance)

Parameters

face1 GeoFace3

The first face, read by its material.

face2 GeoFace3

The second face, read by its material.

tolerance Tolerance

The tolerance.

Returns

bool

true when the materials overlap or touch anywhere; otherwise, false.

Remarks

A face lying wholly in a hole of another, in its plane or standing across it, touches nothing; one lying on its material touches it. The square 100 by 100 in the floor with a hole 40 by 40 in its middle is not touched by a square 20 by 20 about (50, 50) lying in its hole, and is by one about (15, 50).

Exceptions

ArgumentNullException

Thrown when either face is null.

CollidesWith(GeoPlane3, GeoTriangle3)

Determines whether a triangle touches a plane, using the default tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoTriangle3 triangle)

Parameters

plane GeoPlane3
triangle GeoTriangle3

Returns

bool

Remarks

The floor plane touches the triangle with corners (0, 50, -50), (100, 50, -50) and (0, 50, 50) standing across it, and one lying in it; moved up 10 above the floor, a triangle lying flat misses it.

CollidesWith(GeoPlane3, GeoTriangle3, Tolerance)

Determines whether a triangle touches a plane, within a tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoTriangle3 triangle, Tolerance tolerance)

Parameters

plane GeoPlane3

The plane.

triangle GeoTriangle3

The triangle.

tolerance Tolerance

The tolerance.

Returns

bool

true when the heights of its corners above the plane change sign or one of them is nought within the point tolerance, or the triangle lies in the plane; otherwise, false.

Remarks

The floor plane touches the triangle with corners (0, 50, -50), (100, 50, -50) and (0, 50, 50) standing across it, and one lying in it; moved up 10 above the floor, a triangle lying flat misses it.

CollidesWith(GeoPlane3, GeoPolygon3)

Determines whether a polygon touches a plane, using the default tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoPolygon3 polygon)

Parameters

plane GeoPlane3
polygon GeoPolygon3

Returns

bool

Remarks

The floor plane touches a square 100 by 100 standing upright across it from z = -50 to 50, one standing on it from z = 0 to 100, and one lying in it; one standing from z = 10 misses it.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

CollidesWith(GeoPlane3, GeoPolygon3, Tolerance)

Determines whether a polygon touches a plane, within a tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoPolygon3 polygon, Tolerance tolerance)

Parameters

plane GeoPlane3

The plane.

polygon GeoPolygon3

The polygon.

tolerance Tolerance

The tolerance.

Returns

bool

true when the heights of its corners above the plane change sign or one of them is nought within the point tolerance, or the polygon lies in the plane; otherwise, false.

Remarks

The floor plane touches a square 100 by 100 standing upright across it from z = -50 to 50, one standing on it from z = 0 to 100, and one lying in it; one standing from z = 10 misses it.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

CollidesWith(GeoPlane3, GeoFace3)

Determines whether the material of a face touches a plane, using the default tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoFace3 face)

Parameters

plane GeoPlane3
face GeoFace3

Returns

bool

Remarks

The floor plane touches the square 100 by 100 with a hole 40 by 40 in its middle, stood upright across it from z = -50 to 50; stood up from z = 10 it misses it.

Exceptions

ArgumentNullException

Thrown when the face is null.

CollidesWith(GeoPlane3, GeoFace3, Tolerance)

Determines whether the material of a face touches a plane, within a tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoFace3 face, Tolerance tolerance)

Parameters

plane GeoPlane3

The plane.

face GeoFace3

The face.

tolerance Tolerance

The tolerance.

Returns

bool

true when the heights of the corners of its outline above the plane change sign or one of them is nought within the point tolerance, or the face lies in the plane; otherwise, false.

Remarks

The outline decides: a plane reaching the outline reaches the material along it, and the holes lie within it. The floor plane touches the square 100 by 100 with a hole 40 by 40 in its middle, stood upright across it from z = -50 to 50; stood up from z = 10 it misses it.

Exceptions

ArgumentNullException

Thrown when the face is null.

CollidesWith(GeoPlane3, GeoSolid3)

Determines whether a body touches a plane, using the default tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoSolid3 solid)

Parameters

plane GeoPlane3
solid GeoSolid3

Returns

bool

Remarks

A box 100 by 100 by 100 standing on the floor is touched by the plane z = 50 and by the plane z = 100 through its top, and missed by the plane z = 101.

Exceptions

ArgumentNullException

Thrown when the solid is null.

CollidesWith(GeoPlane3, GeoSolid3, Tolerance)

Determines whether a body touches a plane, within a tolerance.

public static bool CollidesWith(GeoPlane3 plane, GeoSolid3 solid, Tolerance tolerance)

Parameters

plane GeoPlane3

The plane.

solid GeoSolid3

The solid, read by its material.

tolerance Tolerance

The tolerance.

Returns

bool

true when the heights of the corners of one of its faces above the plane change sign or one of them is nought within the point tolerance; otherwise, false.

Remarks

Every face is flat and its outline runs unbroken round it, so a plane meets the face exactly when the corners of the outline are not all on one side of it, and a plane meeting the body meets a face, since the body is bounded and the plane is not. Asked over all the corners at once, the test would find a body in two pieces either side of the plane touching it; asked face by face, it does not. The openings the plane passes through are cut in first, so a plane through an opening alone touches nothing. A box 100 by 100 by 100 standing on the floor is touched by the plane z = 50 and by the plane z = 100 through its top, and missed by the plane z = 101.

Exceptions

ArgumentNullException

Thrown when the solid is null.

CollidesWith(GeoRay3, GeoPlane3)

Determines whether a ray touches a plane, using the default tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoPlane3 plane)

Parameters

ray GeoRay3
plane GeoPlane3

Returns

bool

Remarks

A ray from (0, 0, 10) pointing straight down touches the floor plane, and one lying in it touches it everywhere; one pointing straight up misses it.

CollidesWith(GeoRay3, GeoPlane3, Tolerance)

Determines whether a ray touches a plane, within a tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoPlane3 plane, Tolerance tolerance)

Parameters

ray GeoRay3

The ray.

plane GeoPlane3

The plane.

tolerance Tolerance

The tolerance.

Returns

bool

true when the ray starts on the plane within the planar tolerance, or reaches it as TryIntersectWith(GeoRay3, GeoPlane3, out GeoPoint3, Tolerance) reads it; otherwise, false.

Remarks

A ray lying in the plane crosses it nowhere and touches it everywhere, which is the one place this and GetIntersections(GeoRay3, GeoPlane3, Tolerance) part. A ray from (0, 0, 10) pointing straight down touches the floor plane; one pointing straight up misses it.

CollidesWith(GeoRay3, GeoRay3)

Determines whether two rays touch, using the default tolerance.

public static bool CollidesWith(GeoRay3 ray1, GeoRay3 ray2)

Parameters

ray1 GeoRay3
ray2 GeoRay3

Returns

bool

Remarks

A ray from the origin along X touches one from (50, -50, 0) along Y, and one along the X axis from 100 facing back; one from (50, 10, 0) along Y misses it.

CollidesWith(GeoRay3, GeoRay3, Tolerance)

Determines whether two rays touch, within a tolerance.

public static bool CollidesWith(GeoRay3 ray1, GeoRay3 ray2, Tolerance tolerance)

Parameters

ray1 GeoRay3

The first ray.

ray2 GeoRay3

The second ray.

tolerance Tolerance

The tolerance.

Returns

bool

true when they meet, whether at a point or along a length; otherwise, false.

Remarks

Two rays meet where the shortest line between them is no longer than the point tolerance, exactly where GetIntersections(GeoRay3, GeoRay3, Tolerance) names their crossing; rays parallel within rounding meet where either starts on the other, along the stretch they share, and name no place, as two segments lying along each other do. A ray from the origin along X touches one from (50, -50, 0) along Y, and one along the X axis from 100 facing back; one from (50, 10, 0) along Y misses it, and so does one along the X axis from -100 facing away.

CollidesWith(GeoLine3, GeoLine3)

Determines whether two segments touch.

public static bool CollidesWith(GeoLine3 line1, GeoLine3 line2)

Parameters

line1 GeoLine3
line2 GeoLine3

Returns

bool

CollidesWith(GeoLine3, GeoLine3, Tolerance)

Determines whether two segments touch, within a tolerance.

public static bool CollidesWith(GeoLine3 line1, GeoLine3 line2, Tolerance tolerance)

Parameters

line1 GeoLine3

The first segment.

line2 GeoLine3

The second segment.

tolerance Tolerance

The tolerance.

Returns

bool

true when they meet, whether at a point or along a length; false when they are apart or skew.

CollidesWith(GeoLine3, GeoRay3)

Determines whether a segment touches a ray.

public static bool CollidesWith(GeoLine3 line, GeoRay3 ray)

Parameters

line GeoLine3
ray GeoRay3

Returns

bool

CollidesWith(GeoLine3, GeoRay3, Tolerance)

Determines whether a segment touches a ray, within a tolerance.

public static bool CollidesWith(GeoLine3 line, GeoRay3 ray, Tolerance tolerance)

Parameters

line GeoLine3

The segment.

ray GeoRay3

The ray.

tolerance Tolerance

The tolerance.

Returns

bool

true when they meet, whether at a point or along a length; otherwise, false.

CollidesWith(GeoRay3, GeoLine3)

Determines whether a ray touches a segment.

public static bool CollidesWith(GeoRay3 ray, GeoLine3 line)

Parameters

ray GeoRay3
line GeoLine3

Returns

bool

CollidesWith(GeoRay3, GeoLine3, Tolerance)

Determines whether a ray touches a segment, within a tolerance.

public static bool CollidesWith(GeoRay3 ray, GeoLine3 line, Tolerance tolerance)

Parameters

ray GeoRay3

The ray.

line GeoLine3

The segment.

tolerance Tolerance

The tolerance.

Returns

bool

true when they meet, whether at a point or along a length; otherwise, false.