Table of Contents

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

line GeoLine3
box GeoObb3

Returns

GeoPoint3[]

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

line GeoLine3

The line segment.

box GeoObb3

The box.

tolerance Tolerance

The tolerance.

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

plane GeoPlane3
solid GeoSolid3

Returns

GeoPoint3[]

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

plane GeoPlane3

The cutting plane.

solid GeoSolid3

The solid.

tolerance Tolerance

The tolerance.

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

line GeoLine3
solid GeoSolid3

Returns

GeoPoint3[]

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

line GeoLine3

The segment.

solid GeoSolid3

The body.

tolerance Tolerance

The tolerance.

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

line GeoLine3
box GeoAabb3

Returns

GeoPoint3[]

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

line GeoLine3
box GeoAabb3
tolerance Tolerance

Returns

GeoPoint3[]

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

ray GeoRay3
box GeoObb3

Returns

GeoPoint3[]

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

ray GeoRay3
box GeoObb3
tolerance Tolerance

Returns

GeoPoint3[]

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

ray GeoRay3
box GeoAabb3

Returns

GeoPoint3[]

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

ray GeoRay3
box GeoAabb3
tolerance Tolerance

Returns

GeoPoint3[]

GetIntersections(GeoPolyline3, GeoPlane3)

Gets every point where a straight chain crosses a plane.

public static GeoPoint3[] GetIntersections(GeoPolyline3 polyline, GeoPlane3 plane)

Parameters

polyline GeoPolyline3
plane GeoPlane3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

plane GeoPlane3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
line GeoLine3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

line GeoLine3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
ray GeoRay3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

ray GeoRay3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
arc GeoArc3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

arc GeoArc3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
circle GeoCircle3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

circle GeoCircle3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
triangle GeoTriangle3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

triangle GeoTriangle3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
polygon GeoPolygon3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

polygon GeoPolygon3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
face GeoFace3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

face GeoFace3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
box GeoObb3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

box GeoObb3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
box GeoAabb3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

box GeoAabb3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
solid GeoSolid3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The chain.

solid GeoSolid3

The shape to cross with.

tolerance Tolerance

The 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

polyline GeoPolyline3
other GeoPolyline3

Returns

GeoPoint3[]

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

polyline GeoPolyline3

The first chain.

other GeoPolyline3

The second chain.

tolerance Tolerance

The 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

ray GeoRay3
solid GeoSolid3

Returns

GeoPoint3[]

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

ray GeoRay3

The ray.

solid GeoSolid3

The solid.

tolerance Tolerance

The tolerance.

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

line1 GeoLine3
line2 GeoLine3

Returns

GeoPoint3[]

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

line1 GeoLine3

The first segment.

line2 GeoLine3

The second segment.

tolerance Tolerance

The 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

line GeoLine3
ray GeoRay3

Returns

GeoPoint3[]

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

line GeoLine3

The segment.

ray GeoRay3

The ray.

tolerance Tolerance

The tolerance.

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

ray GeoRay3
line GeoLine3

Returns

GeoPoint3[]

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

ray GeoRay3

The ray.

line GeoLine3

The segment.

tolerance Tolerance

The tolerance.

Returns

GeoPoint3[]

The one place they cross, or nothing.