Intersection

public static class Intersection
Provides static methods for the computation of intersections, projections, sections and similar.

Properties

MeshIntersectionsTolerancesCoefficient

#Since v7.0

Offers a requested adjustment coefficient for mesh-mesh intersections tolerances. The value can be used to multiply the document absolute tolerance.

This is only a UI value; it is up to developer to honor (or not) this request, depending on application needs.

public static double MeshIntersectionsTolerancesCoefficient { get; }
Remarks: Generally, document tolerances are around 0.001 for objects sized about 100 units. However, good mesh triangles for these objects are often a few orders of magnitude smaller than these values. This coefficient is provided to scale absolute document tolerances to values more suitable for good mesh intersections.

Methods

ArcArc

#Since v7.12
Intersects two arcs using exact calculations.
public static ArcArcIntersection ArcArc(
arcA,
First arc to intersect.
arcB,
Second arc to intersect.
out Point3d
intersectionPoint1,
First intersection point.
out Point3d
intersectionPoint2
Second intersection point.
)
The intersection type.

BrepBrep

#Since v8.12
Intersects two Breps.
public static bool BrepBrep(
brepA,
First Brep for intersection.
brepB,
Second Brep for intersection.
tolerance,
Intersection tolerance.
joinCurves,
If true, join the resulting curves where possible.
out Curve[]
intersectionCurves,
The intersection curves will be returned here.
out Point3d[]
intersectionPoints
The intersection points will be returned here.
)
true if the operation was success, false otherwise. Check the output arrays to determine how the input intersects.

BrepBrep

#Since v5.0
Intersects two Breps.
public static bool BrepBrep(
brepA,
First Brep for intersection.
brepB,
Second Brep for intersection.
tolerance,
Intersection tolerance.
out Curve[]
intersectionCurves,
The intersection curves will be returned here.
out Point3d[]
intersectionPoints
The intersection points will be returned here.
)
true if the operation was success, false otherwise. Check the output arrays to determine how the input intersects.

BrepPlane

#Since v8.27
Intersects a Brep with an (infinite) plane.
public static bool BrepPlane(
brep,
Brep to intersect.
plane,
Plane to intersect with.
tolerance,
Tolerance to use for intersections.
joinCurves,
If true, join the resulting curves where possible.
out Curve[]
intersectionCurves,
The intersection curves will be returned here.
out Point3d[]
intersectionPoints
The intersection points will be returned here.
)
true on success, false on failure.

BrepPlane

#Since v5.0
Intersects a Brep with an (infinite) plane.
public static bool BrepPlane(
brep,
Brep to intersect.
plane,
Plane to intersect with.
tolerance,
Tolerance to use for intersections.
out Curve[]
intersectionCurves,
The intersection curves will be returned here.
out Point3d[]
intersectionPoints
The intersection points will be returned here.
)
true on success, false on failure.

BrepSurface

#Since v8.12
Intersects a Brep and a Surface.
public static bool BrepSurface(
brep,
A brep to be intersected.
surface,
A surface to be intersected.
tolerance,
A tolerance value.
joinCurves,
If true, join the resulting curves where possible.
out Curve[]
intersectionCurves,
The intersection curves array argument. This out reference is assigned during the call.
out Point3d[]
intersectionPoints
The intersection points array argument. This out reference is assigned during the call.
)
true if the operation was success, false otherwise. Check the output arrays to determine how the input intersects.

BrepSurface

#Since v5.0
Intersects a Brep and a Surface.
public static bool BrepSurface(
brep,
A brep to be intersected.
surface,
A surface to be intersected.
tolerance,
A tolerance value.
out Curve[]
intersectionCurves,
The intersection curves array argument. This out reference is assigned during the call.
out Point3d[]
intersectionPoints
The intersection points array argument. This out reference is assigned during the call.
)
true if the operation was success, false otherwise. Check the output arrays to determine how the input intersects.

CircleCircle

#Since v7.12
Intersects two circles using exact calculations.
public static CircleCircleIntersection CircleCircle(
circleA,
First circle to intersect.
circleB,
Second circle to intersect.
out Point3d
intersectionPoint1,
First intersection point.
out Point3d
intersectionPoint2
Second intersection point.
)
The intersection type.

CurveBrep

#Since v6.0
Intersect a curve with a Brep. This function returns the intersection parameters on the curve.
public static bool CurveBrep(
curve,
Curve.
brep,
Brep.
tolerance,
Absolute tolerance for intersections.
angleTolerance,
Angle tolerance in radians.
out double[]
t
Curve parameters at intersections.
)
True on success, false on failure.

CurveBrep

#Since v6.0
Intersects a curve with a Brep. This function returns the 3D points of intersection, curve parameters at the intersection locations, and 3D overlap curves. If an error occurs while processing overlap curves, this function will return false, but it will still provide partial results.
public static bool CurveBrep(
curve,
Curve for intersection.
brep,
Brep for intersection.
tolerance,
Fitting and near miss tolerance.
out Curve[]
overlapCurves,
The overlap curves will be returned here.
out Point3d[]
intersectionPoints,
The intersection points will be returned here.
out double[]
curveParameters
The intersection curve parameters will be returned here.
)
true on success, false on failure.

CurveBrep

#ExampleSince v5.0
Intersects a curve with a Brep. This function returns the 3D points of intersection and 3D overlap curves. If an error occurs while processing overlap curves, this function will return false, but it will still provide partial results.
public static bool CurveBrep(
curve,
Curve for intersection.
brep,
Brep for intersection.
tolerance,
Fitting and near miss tolerance.
out Curve[]
overlapCurves,
The overlap curves will be returned here.
out Point3d[]
intersectionPoints
The intersection points will be returned here.
)
true on success, false on failure.

CurveBrepFace

#Since v5.0
Intersects a curve with a Brep face.
public static bool CurveBrepFace(
curve,
A curve.
face,
A brep face.
tolerance,
Fitting and near miss tolerance.
out Curve[]
overlapCurves,
A overlap curves array argument. This out reference is assigned during the call.
out Point3d[]
intersectionPoints
A points array argument. This out reference is assigned during the call.
)
true on success, false on failure.

CurveCurve

#ExampleSince v5.0
Finds the intersections between two curves.
public static CurveIntersections CurveCurve(
curveA,
First curve for intersection.
curveB,
Second curve for intersection.
tolerance,
Intersection tolerance. If the curves approach each other to within tolerance, an intersection is assumed.
overlapTolerance
The tolerance with which the curves are tested.
)
A collection of intersection events.

CurveCurveValidate

#Since v7.0
Finds the intersections between two curves.
public static CurveIntersections CurveCurveValidate(
curveA,
First curve for intersection.
curveB,
Second curve for intersection.
tolerance,
Intersection tolerance. If the curves approach each other to within tolerance, an intersection is assumed.
overlapTolerance,
The tolerance with which the curves are tested.
out int[]
invalidIndices,
The indices in the resulting CurveIntersections collection that are invalid.
out TextLog
textLog
A text log that contains tails about the invalid intersection events.
)
A collection of intersection events.

CurveLine

#Since v6.0
Intersects a curve and an infinite line.
public static CurveIntersections CurveLine(
curve,
Curve for intersection.
line,
Infinite line to intersect.
tolerance,
Intersection tolerance. If the curves approach each other to within tolerance, an intersection is assumed.
overlapTolerance
The tolerance with which the curves are tested.
)
A collection of intersection events.

CurvePlane

#Since v5.0
Intersects a curve with an (infinite) plane.
public static CurveIntersections CurvePlane(
curve,
Curve to intersect.
plane,
Plane to intersect with.
tolerance
Tolerance to use during intersection.
)
A list of intersection events or null if no intersections were recorded.

CurveSelf

#Since v5.0
Finds the places where a curve intersects itself.
public static CurveIntersections CurveSelf(
curve,
Curve for self-intersections.
tolerance
Intersection tolerance. If the curve approaches itself to within tolerance, an intersection is assumed.
)
A collection of intersection events.

CurveSurface

#Since v5.0
Intersects a sub-curve and a surface.
public static CurveIntersections CurveSurface(
curve,
Curve for intersection.
curveDomain,
Domain of sub-curve to take into consideration for Intersections.
surface,
Surface for intersection.
tolerance,
Intersection tolerance. If the curve approaches the surface to within tolerance, an intersection is assumed.
overlapTolerance
The tolerance with which the curves are tested.
)
A collection of intersection events.

CurveSurface

#ExampleSince v5.0
Intersects a curve and a surface.
public static CurveIntersections CurveSurface(
curve,
Curve for intersection.
surface,
Surface for intersection.
tolerance,
Intersection tolerance. If the curve approaches the surface to within tolerance, an intersection is assumed.
overlapTolerance
The tolerance with which the curves are tested.
)
A collection of intersection events.

CurveSurfaceValidate

#Since v7.0
Intersects a sub-curve and a surface.
public static CurveIntersections CurveSurfaceValidate(
curve,
Curve for intersection.
curveDomain,
Domain of sub-curve to take into consideration for Intersections.
surface,
Surface for intersection.
tolerance,
Intersection tolerance. If the curve approaches the surface to within tolerance, an intersection is assumed.
overlapTolerance,
The tolerance with which the curves are tested.
out int[]
invalidIndices,
The indices in the resulting CurveIntersections collection that are invalid.
out TextLog
textLog
A text log that contains tails about the invalid intersection events.
)
A collection of intersection events.

CurveSurfaceValidate

#Since v7.0
Intersects a curve and a surface.
public static CurveIntersections CurveSurfaceValidate(
curve,
Curve for intersection.
surface,
Surface for intersection.
tolerance,
Intersection tolerance. If the curve approaches the surface to within tolerance, an intersection is assumed.
overlapTolerance,
The tolerance with which the curves are tested.
out int[]
invalidIndices,
The indices in the resulting CurveIntersections collection that are invalid.
out TextLog
textLog
A text log that contains tails about the invalid intersection events.
)
A collection of intersection events.

GeometryPlane

#Since v9.0
Intersects geometry with an (infinite) plane.
public static bool GeometryPlane(
geometry,
GeometryBase object to intersect.
plane,
Plane to intersect with.
tolerance,
Tolerance to use for intersections.
joinCurves,
If true, join the resulting curves of each object where possible, for every geometry type. Curves of different objects, such as the objects of an instance definition, are never joined.
pointCloudAsPoints,
If true, every point of a PointCloud within tolerance of the plane is returned in intersectionPoints. If false, they are returned as one polyline in intersectionCurves, as the Contour command does.
includeHiddenObjects,
If false, the objects of an instance definition that are hidden or on a layer that is off are skipped, as the Contour command does. Nested instance references are entered whether they are visible or not, and their objects are tested one by one.
doc,
The document that has the instance definition when geometry is, or contains, an InstanceReferenceGeometry. Can be null for other geometry.
xform,
Maps geometry to the space of the plane and the results, as InstanceReferenceGeometry.Xform does. Avoids transforming a copy of the geometry. Must not be singular.
cache,
Data computed from the geometry alone, kept between calls, or null. Reuse one cache for many planes through the same geometry.
cancel,
Checked between the objects of an instance definition, in point clouds and in mesh intersections. A single Brep intersection cannot be cancelled once it has started.
out Curve[]
intersectionCurves,
The intersection curves will be returned here.
out Point3d[]
intersectionPoints
The intersection points will be returned here.
)
Remarks: The curves and points are projected onto the plane. Curves that are not valid after the projection are not returned. For xform and for an InstanceReferenceGeometry, curves are fitted in the space of the geometry with tolerance divided by the largest scale factor of the transform, so they are within tolerance in world coordinates, also for non-uniform scale. Points are tested with their distance to the plane in world coordinates. With non-uniform scale, overlaps of curves with the plane are detected with the stricter curve tolerance, so a curve closer than tolerance to the plane can be missed as an overlap. When joinCurves is true, the open curves of each object are joined: they can be reversed, very short curves can be dropped, and joined curves are PolyCurve. Objects after a cancellation are not joined. For point clouds, the points within tolerance of the plane are returned in intersectionPoints when pointCloudAsPoints is true, all of them. Otherwise they are returned as one polyline in intersectionCurves, or in intersectionPoints when there is only one, and points closer together than tolerance are merged.
true if the intersection was computed, including when the plane misses the geometry. For an InstanceReferenceGeometry, true if it was computed for any object in the instance definition. false if the plane is not valid, tolerance is negative or not a number, the geometry type is not supported, the intersection failed or was cancelled, or xform or the transform of an InstanceReferenceGeometry is singular. Curves and points found before a failure or cancellation are still returned.

GeometryPlane

#Since v9.0
Intersects geometry with an (infinite) plane.
public static bool GeometryPlane(
geometry,
GeometryBase object to intersect.
plane,
Plane to intersect with.
tolerance,
Tolerance to use for intersections.
joinCurves,
If true, join the resulting curves of each object where possible, for every geometry type. Curves of different objects, such as the objects of an instance definition, are never joined.
doc,
The document that has the instance definition when geometry is an InstanceReferenceGeometry. Can be null for other geometry.
out Curve[]
intersectionCurves,
The intersection curves will be returned here.
out Point3d[]
intersectionPoints
The intersection points will be returned here.
)
Remarks: The curves and points are projected onto the plane. Curves that are not valid after the projection are not returned. For an InstanceReferenceGeometry, curves are fitted inside the instance definition with tolerance divided by the largest scale factor of the transform, so they are within tolerance in world coordinates, also for non-uniform scale. Points are tested with their distance to the plane in world coordinates. With non-uniform scale, overlaps of curves with the plane are detected with the stricter curve tolerance, so a curve closer than tolerance to the plane can be missed as an overlap. When joinCurves is true, the open curves of each object are joined: they can be reversed, very short curves can be dropped, and joined curves are PolyCurve. For point clouds, the points within tolerance of the plane are returned as one polyline in intersectionCurves, or in intersectionPoints when there is only one. Points closer together than tolerance are merged. The objects of an instance definition that are not visible are skipped, as the Contour command does.
true if the intersection was computed, including when the plane misses the geometry. For an InstanceReferenceGeometry, true if it was computed for any object in the instance definition. false if the plane is not valid, tolerance is negative or not a number, the geometry type is not supported or the intersection failed. Curves and points found before a failure are still returned.

LineBox

#Since v5.0
Intersects an infinite line and an axis aligned bounding box.
public static bool LineBox(
line,
Line for intersection.
box,
BoundingBox to intersect.
tolerance,
If tolerance > 0.0, then the intersection is performed against a box that has each side moved out by tolerance.
lineParameters
The chord from line.PointAt(lineParameters.T0) to line.PointAt(lineParameters.T1) is the intersection.
)
true if the line intersects the box, false if no intersection occurs.

LineBox

#Since v5.0
Intersects an infinite line with a box volume.
public static bool LineBox(
line,
Line for intersection.
box,
Box to intersect.
tolerance,
If tolerance > 0.0, then the intersection is performed against a box that has each side moved out by tolerance.
lineParameters
The chord from line.PointAt(lineParameters.T0) to line.PointAt(lineParameters.T1) is the intersection.
)
true if the line intersects the box, false if no intersection occurs.

LineCircle

#ExampleSince v5.0
Intersects a line with a circle using exact calculations.
public static LineCircleIntersection LineCircle(
line,
Line for intersection.
circle,
Circle for intersection.
out double
t1,
Parameter on line for first intersection.
out Point3d
point1,
Point on circle closest to first intersection.
out double
t2,
Parameter on line for second intersection.
out Point3d
point2
Point on circle closest to second intersection.
)
If LineCircleIntersection.Single is returned, only t1 and point1 will have valid values. If LineCircleIntersection.Multiple is returned, t2 and point2 will also be filled out.

LineCylinder

#Since v5.0
Intersects a line with a cylinder using exact calculations.
public static LineCylinderIntersection LineCylinder(
line,
Line for intersection.
cylinder,
Cylinder for intersection.
out Point3d
intersectionPoint1,
First intersection point.
out Point3d
intersectionPoint2
Second intersection point.
)
If None is returned, the first point is the point on the line closest to the cylinder and the second point is the point on the cylinder closest to the line.

If LineCylinderIntersection.Single is returned, the first point is the point on the line and the second point is the same point on the cylinder.

LineLine

#Since v5.0
Intersects two lines.
public static bool LineLine(
lineA,
First line for intersection.
lineB,
Second line for intersection.
out double
a,
Parameter on lineA that is closest to LineB. The shortest distance between the lines is the chord from lineA.PointAt(a) to lineB.PointAt(b)
out double
b,
Parameter on lineB that is closest to LineA. The shortest distance between the lines is the chord from lineA.PointAt(a) to lineB.PointAt(b)
tolerance,
If tolerance > 0.0, then an intersection is reported only if the distance between the points is <= tolerance. If tolerance <= 0.0, then the closest point between the lines is reported.
finiteSegments
If true, the input lines are treated as finite segments. If false, the input lines are treated as infinite lines.
)
Remarks: If the lines are exactly parallel, meaning the system of equations used to find a and b has no numerical solution, then false is returned. If the lines are nearly parallel, which is often numerically true even if you think the lines look exactly parallel, then the closest points are found and true is returned. So, if you care about weeding out "parallel" lines, then you need to do something like the following:
bool rc = Intersect.LineLine(lineA, lineB, out a, out b, tolerance, segments);
if (rc)
{
  double angle_tol = RhinoMath.ToRadians(1.0); // or whatever
  double parallel_tol = Math.Cos(angle_tol);
  if ( Math.Abs(lineA.UnitTangent * lineB.UnitTangent) >= parallel_tol )
  {
    ... do whatever you think is appropriate
  }
}
Dim rc As Boolean = Intersect.LineLine(lineA, lineB, a, b, tolerance, segments)
If (rc) Then
  Dim angle_tol As Double = RhinoMath.ToRadians(1.0) 'or whatever
  Dim parallel_tolerance As Double = Math.Cos(angle_tol)
  If (Math.Abs(lineA.UnitTangent * lineB.UnitTangent) >= parallel_tolerance) Then
    ... do whatever you think is appropriate
  End If
End If
true if a closest point can be calculated and the result passes the tolerance parameter test; otherwise false.

LineLine

#ExampleSince v5.0
Find the unique closest-points pair between two infinite lines, if it exists.
public static bool LineLine(
lineA,
First line.
lineB,
Second line.
out double
a,
Parameter on lineA that is closest to lineB.
out double
b
Parameter on lineB that is closest to lineA. The shortest distance between the lines is the chord from lineA.PointAt(a) to lineB.PointAt(b)
)
true if points are found and false if the lines are numerically parallel. Numerically parallel means the 2x2 matrix:

+AoA -AoB

-AoB +BoB

is numerically singular, where A = (lineA.To - lineA.From) and B = (lineB.To-lineB.From).

LinePlane

#Since v5.0
Intersects a line and a plane. This function only returns true if the intersection result is a single point (i.e. if the line is coincident with the plane then no intersection is assumed).
public static bool LinePlane(
line,
Line for intersection.
plane,
Plane to intersect.
out double
lineParameter
Parameter on line where intersection occurs. If the parameter is not within the {0, 1} Interval then the finite segment does not intersect the plane.
)
true on success, false on failure.

LineSphere

#Since v5.0
Intersects a line with a sphere using exact calculations.
public static LineSphereIntersection LineSphere(
line,
Line for intersection.
sphere,
Sphere for intersection.
out Point3d
intersectionPoint1,
First intersection point.
out Point3d
intersectionPoint2
Second intersection point.
)
If LineSphereIntersection.None is returned, the first point is the point on the line closest to the sphere and the second point is the point on the sphere closest to the line. If LineSphereIntersection.Single is returned, the first point is the point on the line and the second point is the same point on the sphere.

MeshLine

#Since v5.0
Finds the intersections of a mesh and a line. The points are not necessarily sorted.
public static Point3d[] MeshLine(
Mesh
mesh,
A mesh to intersect
line,
The line to intersect with the mesh
out int[]
faceIds
The indices of the intersecting faces. This out reference is assigned during the call. Empty if nothing is found.
)
An array of points: one for each face that was passed by the faceIds out reference. Empty if no items are found.

MeshLine

#Since v7.3
Finds the intersections of a mesh and a line.
public static Point3d[] MeshLine(
Mesh
mesh,
A mesh to intersect
line
The line to intersect with the mesh
)
An array of points: one for each face that was passed by the faceIds out reference. Empty if no items are found.

MeshLineSorted

#Since v5.0
Finds the intersections of a mesh and a line. Points are sorted along the line.
public static Point3d[] MeshLineSorted(
Mesh
mesh,
A mesh to intersect
line,
The line to intersect with the mesh
out int[]
faceIds
The indices of the intersecting faces. This out reference is assigned during the call. Empty if nothing is found.
)
An array of points: one for each face that was passed by the faceIds out reference. Empty if no items are found.

MeshMesh

#Since v7.0
Intersects meshes. Overlaps and perforations are provided in the output list.

Tolerance can be specified.

We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient.

public static bool MeshMesh(
meshes,
The mesh input list. This cannot be null. Null entries are tolerated.
tolerance,
A tolerance value. If negative, the positive value will be used. WARNING! Good tolerance values are in the magnitude of 10^-7, or RhinoMath.SqrtEpsilon*10.
out Polyline[]
intersections,
Returns the intersections.
overlapsPolylines,
If true, overlaps are computed and returned.
out Polyline[]
overlapsPolylinesResult,
If requested, overlaps are returned here.
overlapsMesh,
If true, an overlaps mesh is computed and returned.
out Mesh
overlapsMeshResult,
If requested, overlaps are returned here.
textLog,
A text log, or null.
cancel,
A cancellation token to stop the computation at a given point.
progress
A progress reporter to inform the user about progress, or null. The reported value is indicative.
)
True, if the operation succeeded, otherwise false.

MeshMeshAccurate

#Since v5.0
Intersects two meshes. Overlaps and near misses are handled. This is an old method kept for compatibility.

Tolerance can be specified.

We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient.

public static Polyline[] MeshMeshAccurate(
Mesh
meshA,
First mesh for intersection.
Mesh
meshB,
Second mesh for intersection.
tolerance
A tolerance value. If negative, the positive value will be used. WARNING! Good tolerance values are in the magnitude of 10^-7, or RhinoMath.SqrtEpsilon*10.
)
An array of intersection and overlaps polylines.

MeshMeshFast

#Since v5.0
Fast intersection of two meshes, returned as loose line segments rather than assembled polylines.

Vertices are read in double precision when the mesh has them. Faces that cross or touch within tolerance produce segments; coplanar overlaps are ignored. Use MeshMesh(IEnumerable<Mesh>, double, Polyline[], bool, Polyline[], bool, Mesh, TextLog, CancellationToken, IProgress<double>) when overlaps or joined curves are needed, and MeshMeshPredicate(IEnumerable<Mesh>, IEnumerable<Mesh>, double, bool, TextLog, CancellationToken) when only the yes/no answer is needed.

public static Line[] MeshMeshFast(
Mesh
meshA,
First mesh for intersection.
Mesh
meshB
Second mesh for intersection.
)
An array of intersection line segments, empty if no intersections were found.

MeshMeshPredicate

#Since v8.0
Determines which meshes intersect. No geometry is computed: each pair of meshes is tested only until its first crossing is found, with the fast intersector behind MeshMeshFast(Mesh, Mesh). Faces that cross or touch within tolerance count; coplanar overlap without a crossing does not.

The same as MeshMeshPredicate(IEnumerable<Mesh>, IEnumerable<Mesh>, double, bool, IntersectingMeshPair[], TextLog, CancellationToken) with fast = true.

public static bool MeshMeshPredicate(
meshes,
The mesh input list. This cannot be null. Null entries are tolerated.
tolerance,
A tolerance value. If negative, the positive value will be used. WARNING! Good tolerance values are in the magnitude of 10^-7, or RhinoMath.SqrtEpsilon*10.
out int[]
pairs,
An array containing pairs of meshes that intersect.
textLog
A text log, or null.
)
True, if meshes intersect, otherwise false. False is also returned on error, but textLog will start with Error: and contain the error.

MeshMeshPredicate

#Since v9.0
Determines which meshes intersect, and reports one intersecting face couple for each pair found. No geometry is computed: each pair of meshes is tested only until its first hit.
public static bool MeshMeshPredicate(
meshesA,
The first mesh list. This cannot be null. Null entries are skipped but keep their index.
meshesB,
A second mesh list, or null. When null, every pair within meshesA is tested once; otherwise every mesh of meshesA is tested against every mesh of meshesB. Null entries are skipped but keep their index.
tolerance,
A tolerance value. If negative, the positive value will be used. WARNING! Good tolerance values are in the magnitude of 10^-7, or RhinoMath.SqrtEpsilon*10.
fast,
True uses the fast intersector behind MeshMeshFast(Mesh, Mesh): faces that cross or touch within tolerance count, coplanar overlap without a crossing does not. False uses the accurate intersector, which also reports coplanar overlap and costs about as much as MeshMeshFast(Mesh, Mesh).
intersectingPairs,
The pairs of meshes that intersect, each with the first intersecting faces found. IntersectingMeshPair.MeshIndexA indexes meshesA and IntersectingMeshPair.MeshIndexB indexes meshesB, or both index meshesA with MeshIndexA less than MeshIndexB. Empty when nothing intersects.
textLog,
A text log, or null.
cancel
A cancellation token to stop the computation at a given point.
)
True if any pair intersects, otherwise false. False is also returned on error or cancellation.

MeshMeshPredicate

#Since v9.0
Determines whether any of the meshes intersect. No geometry is computed, and the search stops at the first pair of meshes that intersect: this is the quickest answer when the intersecting pairs are not needed.
public static bool MeshMeshPredicate(
meshesA,
The first mesh list. This cannot be null. Null entries are skipped.
meshesB,
A second mesh list, or null. When null, every pair within meshesA is tested once; otherwise every mesh of meshesA is tested against every mesh of meshesB. Null entries are skipped.
tolerance,
A tolerance value. If negative, the positive value will be used. WARNING! Good tolerance values are in the magnitude of 10^-7, or RhinoMath.SqrtEpsilon*10.
fast,
True uses the fast intersector behind MeshMeshFast(Mesh, Mesh): faces that cross or touch within tolerance count, coplanar overlap without a crossing does not. False uses the accurate intersector, which also reports coplanar overlap and costs about as much as MeshMeshFast(Mesh, Mesh).
textLog,
A text log, or null.
cancel
A cancellation token to stop the computation at a given point.
)
True if any pair intersects, otherwise false. False is also returned on error or cancellation.

MeshMeshTwoSets

#Since v9.0
Intersects two sets of meshes with each other. Overlaps and perforations are provided in the output list.

Only events between a mesh of the first set and a mesh of the second set are computed. Intersections among meshes of the same set, and self-intersections within a single mesh, are ignored.

Tolerance can be specified.

We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient.

public static bool MeshMeshTwoSets(
setA,
The first mesh input list. This cannot be null. Null entries are tolerated.
setB,
The second mesh input list. This cannot be null. Null entries are tolerated.
tolerance,
A tolerance value. If negative, the positive value will be used. WARNING! Good tolerance values are in the magnitude of 10^-7, or RhinoMath.SqrtEpsilon*10.
out Polyline[]
intersections,
Returns the intersections.
overlapsPolylines,
If true, overlaps are computed and returned.
out Polyline[]
overlapsPolylinesResult,
If requested, overlaps are returned here.
overlapsMesh,
If true, an overlaps mesh is computed and returned.
out Mesh
overlapsMeshResult,
If requested, overlaps are returned here.
textLog,
A text log, or null.
cancel,
A cancellation token to stop the computation at a given point.
progress
A progress reporter to inform the user about progress, or null. The reported value is indicative.
)
True, if the operation succeeded, otherwise false.

MeshPlane

#Since v5.0
Intersects a mesh with a collection of infinite planes.

RhinoMath.ZeroTolerance is used as fixed tolerance.

We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient instaed.

public static Polyline[] MeshPlane(
Mesh
mesh,
Mesh to intersect.
planes
Planes to intersect with.
)
An array of polylines describing the intersection loops, or null if no intersections could be found.

MeshPlane

#Since v9.0
Intersects a mesh with a collection of infinite planes.

Tolerance can be specified.

We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient.

public static Polyline[] MeshPlane(
Mesh
mesh,
Mesh to intersect.
cache,
Intersection cache for the mesh.
planes,
Planes to intersect with.
tolerance,
Intersection tolerance.
overlaps
If true, overlaps are computed and will be part of the output.
)
An array of polylines describing the intersection loops, or null if no intersections could be found.

MeshPlane

#Since v8.0
Intersects a mesh with a collection of infinite planes, providing both overlaps and perforations.

Tolerance can be specified.

We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient.

public static Polyline[] MeshPlane(
Mesh
mesh,
Mesh to intersect.
cache,
Intersection cache for the mesh.
planes,
Planes to intersect with.
tolerance
Intersection tolerance.
)
An array of polylines describing the intersection loops, or null if no intersections could be found.

MeshPlane

#Since v8.0
Intersects a mesh with an infinite plane.

Tolerance can be specified.

We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient.

public static Polyline[] MeshPlane(
Mesh
mesh,
Mesh to intersect.
cache,
Intersection cache for mesh.
plane,
Plane to intersect with.
tolerance,
Intersection tolerance.
overlaps
If true, overlaps are computed and will be part of the output.
)
An array of polylines describing the intersection loops, or null if no intersections could be found.

MeshPlane

#Since v8.0
Intersects a mesh with an infinite plane.

Tolerance can be specified.

We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient.

public static Polyline[] MeshPlane(
Mesh
mesh,
Mesh to intersect.
cache,
Intersection cache for mesh.
plane,
Plane to intersect with.
tolerance
Intersection tolerance.
)
An array of polylines describing the intersection loops, or null if no intersections could be found.

MeshPlane

#Since v5.0
Intersects a mesh with an infinite plane. RhinoMath.ZeroTolerance is used as fixed tolerance. We suggest to use the document tolerance multiplied by MeshIntersectionsTolerancesCoefficient instaed.
public static Polyline[] MeshPlane(
Mesh
mesh,
Mesh to intersect.
plane
Plane to intersect with.
)
An array of polylines describing the intersection loops, or null if no intersections could be found.

MeshPolyline

#Since v5.0
Finds the intersection of a mesh and a polyline. Starting from version 7, points are always sorted along the polyline.
public static Point3d[] MeshPolyline(
Mesh
mesh,
A mesh to intersect.
curve,
A polyline curves to intersect.
out int[]
faceIds
The indices of the intersecting faces. This out reference is assigned during the call.
)
An array of points: one for each face that was passed by the faceIds out reference.

MeshPolylineSorted

#Since v5.0
Finds the intersection of a mesh and a polyline. Points are guaranteed to be sorted along the polyline.
public static Point3d[] MeshPolylineSorted(
Mesh
mesh,
A mesh to intersect.
curve,
A polyline curves to intersect.
out int[]
faceIds
The indices of the intersecting faces. This out reference is assigned during the call.
)
An array of points: one for each face that was passed by the faceIds out reference.

MeshRay

#Since v5.0
Finds the first intersection of a ray with a mesh.
public static double MeshRay(
Mesh
mesh,
A mesh to intersect.
ray,
A ray to be casted.
out int[]
meshFaceIndices
faces on mesh that ray intersects.
)
Remarks: The ray may intersect more than one face in cases where the ray hits the edge between two faces or the vertex corner shared by multiple faces, or more than one face is coplanar or happens to be intersecting at the same location as the ray.
>= 0.0 parameter along ray if successful. < 0.0 if no intersection found.

MeshRay

#Since v5.0
Finds the first intersection of a ray with a mesh.
public static double MeshRay(
Mesh
mesh,
A mesh to intersect.
ray
A ray to be casted.
)
>= 0.0 parameter along ray if successful. < 0.0 if no intersection found.

MeshRays

#Since v9.0
Finds the first intersection of each one of a set of rays with a mesh.
public static double[] MeshRays(
Mesh
mesh,
A mesh to intersect.
rays,
The rays to cast.
multithreaded
True to cast the rays on several threads.
)
One value for each ray, in the order of the rays: the parameter along that ray of its first intersection with the mesh, or a value smaller than 0.0 where that ray does not meet the mesh. Null when the mesh or the set of rays is null.

MeshRays

#Since v9.0
Finds the first intersection of each one of a set of rays with a mesh.
public static double[] MeshRays(
Mesh
mesh,
A mesh to intersect.
rays
The rays to cast.
)
Remarks: The rays are cast on several threads, so this is much faster than one call of MeshRay(Mesh, Ray3d) per ray.
One value for each ray, in the order of the rays: the parameter along that ray of its first intersection with the mesh, or a value smaller than 0.0 where that ray does not meet the mesh. Null when the mesh or the set of rays is null.

PlaneBoundingBox

#Since v8.0
Intersects a plane and a bounding box.
public static bool PlaneBoundingBox(
plane,
The plane.
boundingBox,
The bounding box.
polyline
The output polyline if successful.
)
Remarks: Intersects the four bounding box infinite lines in the direction of the max coordinate with the plane. Point and single line intersections are ignored.
True if successful, false otherwise.

PlaneCircle

#Since v5.0
Intersects a plane with a circle using exact calculations.
public static PlaneCircleIntersection PlaneCircle(
plane,
Plane to intersect.
circle,
Circe to intersect.
out double
firstCircleParameter,
First intersection parameter on circle if successful or RhinoMath.UnsetValue if not.
out double
secondCircleParameter
Second intersection parameter on circle if successful or RhinoMath.UnsetValue if not.
)
The type of intersection that occurred.

PlanePlane

#Since v5.0
Intersects two planes and return the intersection line. If the planes are parallel or coincident, no intersection is assumed.
public static bool PlanePlane(
planeA,
First plane for intersection.
planeB,
Second plane for intersection.
out Line
intersectionLine
If this function returns true, the intersectionLine parameter will return the line where the planes intersect.
)
true on success, false on failure.

PlanePlanePlane

#Since v5.0
Intersects three planes to find the single point they all share.
public static bool PlanePlanePlane(
planeA,
First plane for intersection.
planeB,
Second plane for intersection.
planeC,
Third plane for intersection.
out Point3d
intersectionPoint
Point where all three planes converge.
)
true on success, false on failure. If at least two out of the three planes are parallel or coincident, failure is assumed.

PlaneSphere

#Since v5.0
Intersects a plane with a sphere using exact calculations.
public static PlaneSphereIntersection PlaneSphere(
plane,
Plane to intersect.
sphere,
Sphere to intersect.
out Circle
intersectionCircle
Intersection result.
)
If PlaneSphereIntersection.None is returned, the intersectionCircle has a radius of zero and the center point is the point on the plane closest to the sphere.

ProjectPointsToBreps

#ExampleSince v5.0
Projects points onto breps.
public static Point3d[] ProjectPointsToBreps(
breps,
The breps projection targets.
points,
The points to project.
direction,
The direction to project.
tolerance
The tolerance used for intersections.
)
Array of projected points, or null in case of any error or invalid input.

ProjectPointsToBrepsEx

#Since v5.10
Projects points onto breps.
public static Point3d[] ProjectPointsToBrepsEx(
breps,
The breps projection targets.
points,
The points to project.
direction,
The direction to project.
tolerance,
The tolerance used for intersections.
out int[]
indices
Return points[i] is a projection of points[indices[i]]
)
Array of projected points, or null in case of any error or invalid input.

ProjectPointsToMeshes

#Since v5.0
Projects points onto meshes.
public static Point3d[] ProjectPointsToMeshes(
meshes,
the meshes to project on to.
points,
the points to project.
direction,
the direction to project.
tolerance
Projection tolerances used for culling close points and for line-mesh intersection.
)
Array of projected points, or null in case of any error or invalid input.

ProjectPointsToMeshesEx

#ExampleSince v5.10
Projects points onto meshes.
public static Point3d[] ProjectPointsToMeshesEx(
meshes,
the meshes to project on to.
points,
the points to project.
direction,
the direction to project.
tolerance,
Projection tolerances used for culling close points and for line-mesh intersection.
out int[]
indices
Return points[i] is a projection of points[indices[i]]
)
Array of projected points, or null in case of any error or invalid input.

RayShoot

#Since v5.0
Computes point intersections that occur when shooting a ray to a collection of surfaces and Breps.
public static Point3d[] RayShoot(
ray,
A ray used in intersection.
geometry,
Only Surface and Brep objects are currently supported. Trims are ignored on Breps.
maxReflections
The maximum number of reflections. This value should be any value between 1 and 1000, inclusive.
)
An array of points: one for each surface or Brep face that was hit, or an empty array on failure.
ArgumentNullExceptiongeometry is null.
ArgumentOutOfRangeExceptionmaxReflections is strictly outside the [1-1000] range.

RayShoot

#Since v9.0
Computes point intersections that occur when shooting a ray to a collection of surfaces and Breps.
public static RayShootEvent[] RayShoot(
geometry,
The collection of surfaces and Breps to intersect.
ray,
A ray used in intersection.
maxReflections,
The maximum number of reflections. This value should be any value between 1 and 1000, inclusive.
honorTrims
When true, hits that land outside a Brep face's trimming loops are skipped and the ray continues. When false, Breps are treated as their untrimmed surfaces, which is what Rhino 8 and earlier did.
)
An array of RayShootEvent structs if successful, or an empty array on failure.
ArgumentNullExceptiongeometry is null.
ArgumentOutOfRangeExceptionmaxReflections is strictly outside the [1-1000] range.

RayShoot

#Since v7.0
Computes point intersections that occur when shooting a ray to a collection of surfaces and Breps.
public static RayShootEvent[] RayShoot(
geometry,
The collection of surfaces and Breps to intersect. Trims are ignored on Breps.
ray,
>A ray used in intersection.
maxReflections
The maximum number of reflections. This value should be any value between 1 and 1000, inclusive.
)
An array of RayShootEvent structs if successful, or an empty array on failure.
ArgumentNullExceptiongeometry is null.
ArgumentOutOfRangeExceptionmaxReflections is strictly outside the [1-1000] range.

SphereSphere

#Since v5.0
Intersects two spheres using exact calculations.
public static SphereSphereIntersection SphereSphere(
sphereA,
First sphere to intersect.
sphereB,
Second sphere to intersect.
out Circle
intersectionCircle
If intersection is a point, then that point will be the center, radius 0.
)
The intersection type.

SurfaceSurface

#Since v5.0
Intersects two Surfaces.
public static bool SurfaceSurface(
surfaceA,
First Surface for intersection.
surfaceB,
Second Surface for intersection.
tolerance,
Intersection tolerance.
out Curve[]
intersectionCurves,
The intersection curves will be returned here.
out Point3d[]
intersectionPoints
The intersection points will be returned here.
)
true on success, false on failure.