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
triangleGeoTriangle3solidGeoSolid3
Returns
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
triangleGeoTriangle3The triangle.
solidGeoSolid3The solid, read by its material.
toleranceToleranceThe 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
triangleGeoTriangle3boxGeoObb3
Returns
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
triangleGeoTriangle3boxGeoObb3toleranceTolerance
Returns
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
triangleGeoTriangle3boxGeoAabb3
Returns
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
triangleGeoTriangle3boxGeoAabb3toleranceTolerance
Returns
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
polygonGeoPolygon3boxGeoAabb3
Returns
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
polygonGeoPolygon3boxGeoAabb3toleranceTolerance
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
CollidesWith(GeoObb3, GeoObb3)
Checks whether two oriented boxes overlap, using the default tolerance.
public static bool CollidesWith(GeoObb3 box1, GeoObb3 box2)
Parameters
Returns
CollidesWith(GeoObb3, GeoObb3, Tolerance)
Checks whether two oriented boxes overlap, within a tolerance.
public static bool CollidesWith(GeoObb3 box1, GeoObb3 box2, Tolerance tolerance)
Parameters
box1GeoObb3The first box.
box2GeoObb3The second box.
toleranceToleranceThe 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
Returns
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
Returns
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
triangle1GeoTriangle3triangle2GeoTriangle3
Returns
CollidesWith(GeoTriangle3, GeoTriangle3, Tolerance)
Checks whether two triangles overlap, within a tolerance.
public static bool CollidesWith(GeoTriangle3 triangle1, GeoTriangle3 triangle2, Tolerance tolerance)
Parameters
triangle1GeoTriangle3triangle2GeoTriangle3toleranceTolerance
Returns
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
Returns
CollidesWith(GeoSolid3, GeoSolid3, Tolerance)
Checks whether two solids overlap, within a tolerance.
public static bool CollidesWith(GeoSolid3 solid1, GeoSolid3 solid2, Tolerance tolerance)
Parameters
solid1GeoSolid3The first solid.
solid2GeoSolid3The second solid.
toleranceToleranceThe 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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
polylineGeoPolyline3solidGeoSolid3
Returns
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
polylineGeoPolyline3solidGeoSolid3toleranceTolerance
Returns
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
polygonGeoPolygon3solidGeoSolid3
Returns
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
polygonGeoPolygon3solidGeoSolid3toleranceTolerance
Returns
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
polygonGeoPolygon3boxGeoObb3
Returns
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
polygonGeoPolygon3boxGeoObb3toleranceTolerance
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
lineGeoLine3triangleGeoTriangle3
Returns
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
lineGeoLine3triangleGeoTriangle3toleranceTolerance
Returns
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
lineGeoLine3polygonGeoPolygon3
Returns
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
lineGeoLine3polygonGeoPolygon3toleranceTolerance
Returns
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
Returns
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
Returns
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
rayGeoRay3triangleGeoTriangle3
Returns
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
rayGeoRay3triangleGeoTriangle3toleranceTolerance
Returns
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
rayGeoRay3polygonGeoPolygon3
Returns
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
rayGeoRay3polygonGeoPolygon3toleranceTolerance
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
CollidesWith(GeoAabb3, GeoSolid3)
Determines whether an axis-aligned box touches or overlaps a solid.
public static bool CollidesWith(GeoAabb3 box, GeoSolid3 solid)
Parameters
Returns
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
Returns
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
polylineGeoPolyline3planeGeoPlane3
Returns
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
polylineGeoPolyline3The chain.
planeGeoPlane3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3lineGeoLine3
Returns
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
polylineGeoPolyline3The chain.
lineGeoLine3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3rayGeoRay3
Returns
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
polylineGeoPolyline3The chain.
rayGeoRay3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3arcGeoArc3
Returns
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
polylineGeoPolyline3The chain.
arcGeoArc3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3circleGeoCircle3
Returns
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
polylineGeoPolyline3The chain.
circleGeoCircle3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3triangleGeoTriangle3
Returns
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
polylineGeoPolyline3The chain.
triangleGeoTriangle3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3polygonGeoPolygon3
Returns
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
polylineGeoPolyline3The chain.
polygonGeoPolygon3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3faceGeoFace3
Returns
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
polylineGeoPolyline3The chain.
faceGeoFace3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3boxGeoObb3
Returns
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
polylineGeoPolyline3The chain.
boxGeoObb3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3boxGeoAabb3
Returns
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
polylineGeoPolyline3The chain.
boxGeoAabb3The shape to test against.
toleranceToleranceThe 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
polylineGeoPolyline3otherGeoPolyline3
Returns
CollidesWith(GeoPolyline3, GeoPolyline3, Tolerance)
Determines whether two straight chains touch, within a tolerance.
public static bool CollidesWith(GeoPolyline3 polyline, GeoPolyline3 other, Tolerance tolerance)
Parameters
polylineGeoPolyline3The first chain.
otherGeoPolyline3The second chain.
toleranceToleranceThe 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
Returns
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
Returns
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
triangleGeoTriangle3polygonGeoPolygon3
Returns
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
triangleGeoTriangle3The triangle.
polygonGeoPolygon3The polygon.
toleranceToleranceThe 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
triangleGeoTriangle3faceGeoFace3
Returns
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
triangleGeoTriangle3The triangle.
faceGeoFace3The face, read by its material.
toleranceToleranceThe 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
polygon1GeoPolygon3polygon2GeoPolygon3
Returns
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
polygon1GeoPolygon3The first polygon.
polygon2GeoPolygon3The second polygon.
toleranceToleranceThe 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
faceGeoFace3polygonGeoPolygon3
Returns
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
faceGeoFace3The face, read by its material.
polygonGeoPolygon3The polygon.
toleranceToleranceThe 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
Returns
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
face1GeoFace3The first face, read by its material.
face2GeoFace3The second face, read by its material.
toleranceToleranceThe 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
planeGeoPlane3triangleGeoTriangle3
Returns
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
planeGeoPlane3The plane.
triangleGeoTriangle3The triangle.
toleranceToleranceThe 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
planeGeoPlane3polygonGeoPolygon3
Returns
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
planeGeoPlane3The plane.
polygonGeoPolygon3The polygon.
toleranceToleranceThe 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
Returns
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
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
Returns
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
planeGeoPlane3The plane.
solidGeoSolid3The solid, read by its material.
toleranceToleranceThe 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
Returns
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
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
Returns
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
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
Returns
CollidesWith(GeoLine3, GeoLine3, Tolerance)
Determines whether two segments touch, within a tolerance.
public static bool CollidesWith(GeoLine3 line1, GeoLine3 line2, Tolerance tolerance)
Parameters
line1GeoLine3The first segment.
line2GeoLine3The second segment.
toleranceToleranceThe 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
Returns
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
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
Returns
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
Returns
- bool
true when they meet, whether at a point or along a length; otherwise, false.