IntersectionGeometryPlane Method (GeometryBase, Plane, Double, 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,
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,
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 where possible, for every geometry type and across the objects of an instance definition. - 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.
- 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 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, open curves can be reversed, very short curves can be dropped, and joined
curves are PolyCurve. A cancelled call does not join.
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