Method GetIntersections
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
GetIntersections(GeoLine3, GeoObb3)
Finds where a line segment enters and leaves an oriented box, using the default tolerance.
public static GeoPoint3[] GetIntersections(GeoLine3 line, GeoObb3 box)
Parameters
Returns
GetIntersections(GeoLine3, GeoObb3, Tolerance)
Finds where a line segment enters and leaves an oriented box, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoLine3 line, GeoObb3 box, Tolerance tolerance)
Parameters
Returns
- GeoPoint3[]
The crossing points in order along the segment: none when it misses the box, one when it starts or ends inside, two when it passes through.
Remarks
This is the slab method. Taking the segment into the local frame of the box turns it into three
pairs of parallel planes, and the part of the segment inside the box is the overlap of the three
intervals those pairs cut out of it. The overlap is empty exactly when some axis separates them,
which is the same reasoning the separating axis test in Collision3 rests on.
GetIntersections(GeoPlane3, GeoSolid3)
Finds where a plane cuts the edges of a solid, using the default tolerance.
public static GeoPoint3[] GetIntersections(GeoPlane3 plane, GeoSolid3 solid)
Parameters
Returns
GetIntersections(GeoPlane3, GeoSolid3, Tolerance)
Finds where a plane cuts the edges of a solid, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPlane3 plane, GeoSolid3 solid, Tolerance tolerance)
Parameters
Returns
- GeoPoint3[]
The crossing points, with duplicates from shared edges removed.
Remarks
These are the corners of the section the plane cuts, but not the section itself: they come back
as a bag of points with no ordering, because ordering them into a loop needs the face adjacency
that this method does not look at. Splition3 is where that belongs.
GetIntersections(GeoLine3, GeoSolid3)
Finds every point where a line segment crosses the surface of a solid, using the default tolerance.
public static GeoPoint3[] GetIntersections(GeoLine3 line, GeoSolid3 solid)
Parameters
Returns
GetIntersections(GeoLine3, GeoSolid3, Tolerance)
Finds every point where a line segment crosses the surface of a solid, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoLine3 line, GeoSolid3 solid, Tolerance tolerance)
Parameters
Returns
- GeoPoint3[]
The crossing points, in order along the segment.
Remarks
The walls of the openings count as surface, since they too separate material from void. Two crossings closer together than the tolerance are reported once, so a segment grazing an edge does not come back as having entered and left.
GetIntersections(GeoLine3, GeoAabb3)
Finds where a line segment enters and leaves an axis-aligned box, using the default tolerance.
public static GeoPoint3[] GetIntersections(GeoLine3 line, GeoAabb3 box)
Parameters
Returns
GetIntersections(GeoLine3, GeoAabb3, Tolerance)
Finds where a line segment enters and leaves an axis-aligned box, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoLine3 line, GeoAabb3 box, Tolerance tolerance)
Parameters
Returns
GetIntersections(GeoRay3, GeoObb3)
Finds where a ray enters and leaves an oriented box, using the default tolerance.
public static GeoPoint3[] GetIntersections(GeoRay3 ray, GeoObb3 box)
Parameters
Returns
GetIntersections(GeoRay3, GeoObb3, Tolerance)
Finds where a ray enters and leaves an oriented box, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoRay3 ray, GeoObb3 box, Tolerance tolerance)
Parameters
Returns
Remarks
A ray runs to infinity, so it is sampled as a segment long enough to reach past the far side of the box. Nothing beyond that point can be a crossing: past it the ray is only moving away.
GetIntersections(GeoRay3, GeoAabb3)
Finds where a ray enters and leaves an axis-aligned box, using the default tolerance.
public static GeoPoint3[] GetIntersections(GeoRay3 ray, GeoAabb3 box)
Parameters
Returns
GetIntersections(GeoRay3, GeoAabb3, Tolerance)
Finds where a ray enters and leaves an axis-aligned box, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoRay3 ray, GeoAabb3 box, Tolerance tolerance)
Parameters
Returns
GetIntersections(GeoPolyline3, GeoPlane3)
Gets every point where a straight chain crosses a plane.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoPlane3 plane)
Parameters
polylineGeoPolyline3planeGeoPlane3
Returns
GetIntersections(GeoPolyline3, GeoPlane3, Tolerance)
Gets every point where a straight chain crosses a plane, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoPlane3 plane, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
planeGeoPlane3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoLine3)
Gets every point where a straight chain crosses a segment.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoLine3 line)
Parameters
polylineGeoPolyline3lineGeoLine3
Returns
GetIntersections(GeoPolyline3, GeoLine3, Tolerance)
Gets every point where a straight chain crosses a segment, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoLine3 line, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
lineGeoLine3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoRay3)
Gets every point where a straight chain crosses a ray.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoRay3 ray)
Parameters
polylineGeoPolyline3rayGeoRay3
Returns
GetIntersections(GeoPolyline3, GeoRay3, Tolerance)
Gets every point where a straight chain crosses a ray, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoRay3 ray, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
rayGeoRay3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoArc3)
Gets every point where a straight chain crosses an arc.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoArc3 arc)
Parameters
polylineGeoPolyline3arcGeoArc3
Returns
GetIntersections(GeoPolyline3, GeoArc3, Tolerance)
Gets every point where a straight chain crosses an arc, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoArc3 arc, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
arcGeoArc3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoCircle3)
Gets every point where a straight chain crosses a circle.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoCircle3 circle)
Parameters
polylineGeoPolyline3circleGeoCircle3
Returns
GetIntersections(GeoPolyline3, GeoCircle3, Tolerance)
Gets every point where a straight chain crosses a circle, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoCircle3 circle, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
circleGeoCircle3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoTriangle3)
Gets every point where a straight chain crosses a triangle.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoTriangle3 triangle)
Parameters
polylineGeoPolyline3triangleGeoTriangle3
Returns
GetIntersections(GeoPolyline3, GeoTriangle3, Tolerance)
Gets every point where a straight chain crosses a triangle, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoTriangle3 triangle, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
triangleGeoTriangle3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoPolygon3)
Gets every point where a straight chain crosses a polygon.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoPolygon3 polygon)
Parameters
polylineGeoPolyline3polygonGeoPolygon3
Returns
GetIntersections(GeoPolyline3, GeoPolygon3, Tolerance)
Gets every point where a straight chain crosses a polygon, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoPolygon3 polygon, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
polygonGeoPolygon3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoFace3)
Gets every point where a straight chain crosses a face.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoFace3 face)
Parameters
polylineGeoPolyline3faceGeoFace3
Returns
GetIntersections(GeoPolyline3, GeoFace3, Tolerance)
Gets every point where a straight chain crosses a face, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoFace3 face, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
faceGeoFace3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoObb3)
Gets every point where a straight chain crosses a box.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoObb3 box)
Parameters
polylineGeoPolyline3boxGeoObb3
Returns
GetIntersections(GeoPolyline3, GeoObb3, Tolerance)
Gets every point where a straight chain crosses a box, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoObb3 box, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
boxGeoObb3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoAabb3)
Gets every point where a straight chain crosses a square box.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoAabb3 box)
Parameters
polylineGeoPolyline3boxGeoAabb3
Returns
GetIntersections(GeoPolyline3, GeoAabb3, Tolerance)
Gets every point where a straight chain crosses a square box, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoAabb3 box, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
boxGeoAabb3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoSolid3)
Gets every point where a straight chain crosses a body.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoSolid3 solid)
Parameters
polylineGeoPolyline3solidGeoSolid3
Returns
GetIntersections(GeoPolyline3, GeoSolid3, Tolerance)
Gets every point where a straight chain crosses a body, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoSolid3 solid, Tolerance tolerance)
Parameters
polylineGeoPolyline3The chain.
solidGeoSolid3The shape to cross with.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
GetIntersections(GeoPolyline3, GeoPolyline3)
Gets every point where two straight chains cross.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoPolyline3 other)
Parameters
polylineGeoPolyline3otherGeoPolyline3
Returns
GetIntersections(GeoPolyline3, GeoPolyline3, Tolerance)
Gets every point where two straight chains cross, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoPolyline3 other, Tolerance tolerance)
Parameters
polylineGeoPolyline3The first chain.
otherGeoPolyline3The second chain.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
Every place they meet, each named once; two segments lying along each other name none.
Remarks
Every pair of segments is asked, so the work grows with the two counts multiplied. Each segment carries a box round itself and a pair whose boxes cannot reach each other is dropped before any arithmetic, and the second chain's boxes are worked out once rather than once per segment.
Exceptions
- ArgumentNullException
Thrown when either chain is null.
GetIntersections(GeoRay3, GeoSolid3)
Gets the points where a ray passes through the surface of a solid.
public static GeoPoint3[] GetIntersections(GeoRay3 ray, GeoSolid3 solid)
Parameters
Returns
GetIntersections(GeoRay3, GeoSolid3, Tolerance)
Gets the points where a ray passes through the surface of a solid, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoRay3 ray, GeoSolid3 solid, Tolerance tolerance)
Parameters
Returns
- GeoPoint3[]
The crossings in the order the ray meets them, with repeats left out.
Remarks
The surface is walked as triangles, so a crossing that falls on the seam between two of them arrives twice and is reported once. A ray starting inside the body has an odd number of crossings, and one starting outside an even number, give or take a face it merely grazes.
GetIntersections(GeoLine3, GeoLine3)
Gets where two segments cross, as a list.
public static GeoPoint3[] GetIntersections(GeoLine3 line1, GeoLine3 line2)
Parameters
Returns
GetIntersections(GeoLine3, GeoLine3, Tolerance)
Gets where two segments cross, as a list, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoLine3 line1, GeoLine3 line2, Tolerance tolerance)
Parameters
line1GeoLine3The first segment.
line2GeoLine3The second segment.
toleranceToleranceThe tolerance.
Returns
- GeoPoint3[]
The one place they cross, or nothing: two segments that miss each other, that are skew, or that lie along each other all name no place.
GetIntersections(GeoLine3, GeoRay3)
Gets where a segment crosses a ray.
public static GeoPoint3[] GetIntersections(GeoLine3 line, GeoRay3 ray)
Parameters
Returns
GetIntersections(GeoLine3, GeoRay3, Tolerance)
Gets where a segment crosses a ray, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoLine3 line, GeoRay3 ray, Tolerance tolerance)
Parameters
Returns
- GeoPoint3[]
The one place they cross, or nothing.
Remarks
Two lines in space usually miss each other altogether, so the question is answered by the shortest line between the two: they cross where that line has no length, and the reach of each piece is already built into it. A segment lying along the ray meets it along a length and names no place.
A ray is a value type and cannot be refused for being absent, so a ray with no direction is read as its own origin and nothing more: the question becomes whether the segment holds that point.
GetIntersections(GeoRay3, GeoLine3)
Gets where a ray crosses a segment.
public static GeoPoint3[] GetIntersections(GeoRay3 ray, GeoLine3 line)
Parameters
Returns
GetIntersections(GeoRay3, GeoLine3, Tolerance)
Gets where a ray crosses a segment, within a tolerance.
public static GeoPoint3[] GetIntersections(GeoRay3 ray, GeoLine3 line, Tolerance tolerance)
Parameters
Returns
- GeoPoint3[]
The one place they cross, or nothing.