IntersectionGeometryPlane Method (GeometryBase, Plane, Double, Boolean, Boolean, Boolean, RhinoDoc, Transform, PlaneIntersectionCache, CancellationToken, Curve, Point3d) |
Intersects geometry with an (infinite) plane.
Namespace:
Rhino.Geometry.Intersect
Assembly:
RhinoCommon (in RhinoCommon.dll)
Since: 9.0
Syntaxpublic static bool GeometryPlane(
GeometryBase geometry,
Plane plane,
double tolerance,
bool joinCurves,
bool pointCloudAsPoints,
bool includeHiddenObjects,
RhinoDoc doc,
Transform xform,
PlaneIntersectionCache cache,
CancellationToken cancel,
out Curve[] intersectionCurves,
out Point3d[] intersectionPoints
)
Public Shared Function GeometryPlane (
geometry As GeometryBase,
plane As Plane,
tolerance As Double,
joinCurves As Boolean,
pointCloudAsPoints As Boolean,
includeHiddenObjects As Boolean,
doc As RhinoDoc,
xform As Transform,
cache As PlaneIntersectionCache,
cancel As CancellationToken,
<OutAttribute> ByRef intersectionCurves As Curve(),
<OutAttribute> ByRef intersectionPoints As Point3d()
) As Boolean
Parameters
- geometry
- Type: Rhino.GeometryGeometryBase
GeometryBase object to intersect. - plane
- Type: Rhino.GeometryPlane
Plane to intersect with. - tolerance
- Type: SystemDouble
Tolerance to use for intersections. - joinCurves
- Type: SystemBoolean
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
- Type: SystemBoolean
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
- Type: SystemBoolean
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
- Type: RhinoRhinoDoc
The document that has the instance definition when geometry is, or contains, an InstanceReferenceGeometry. Can be null for other geometry. - xform
- Type: Rhino.GeometryTransform
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
- Type: Rhino.Geometry.IntersectPlaneIntersectionCache
Data computed from the geometry alone, kept between calls, or null. Reuse one cache for many planes through the same geometry.
- cancel
- Type: System.ThreadingCancellationToken
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.
- intersectionCurves
- Type: Rhino.GeometryCurve
The intersection curves will be returned here. - intersectionPoints
- Type: Rhino.GeometryPoint3d
The intersection points will be returned here.
Return Value
Type:
Boolean
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.
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.
See Also