PlaneSphereIntersection

Calculates the intersection of a plane and a sphere.   

Syntax

rhinoscriptsyntax.PlaneSphereIntersection(plane, sphere_plane, sphere_radius)

rhinoscript.plane.PlaneSphereIntersection(plane, sphere_plane, sphere_radius)

Parameters

plane

Required.  The plane to intersect.

sphere_plane

Required.  An equatorial plane of the sphere.  The origin of the plane will be the center point of the sphere.

sphere_radius

Required.  Number.  The radius of the sphere.

Returns

list

A list of intersection results, if successful. The results are as follows:

Element

Type

Description

0

Number

The type of intersection, where 0 = point and 1 = circle.

1

Point3d or Plane

If a point intersection, the a Point3d identifying the 3-D intersection location.

If a circle intersection, then the circle's plane. The origin of the plane will be the center point of the circle.

2 (circle intersection only)

Number

If a circle intersection, then the radius of the circle.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

plane = rs.WorldXYPlane()

radius = 10

results = rs.PlaneSphereIntersection(plane, plane, radius)

if results:

    if results[0]==0:

        rs.AddPoint(results[1])

    else:

        rs.AddCircle(results[1], results[2])

Also See

IntersectPlanes

LinePlaneIntersection

PlanePlaneIntersection