PlaneSphereIntersection

计算一个平面和一个球体的相交。   

语法

rhinoscriptsyntax.PlaneSphereIntersection(plane, sphere_plane, sphere_radius)

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

参数

plane

必须参数。要求交的平面。

sphere_plane

必须参数。球体的赤道平面。平面的原点将作为球体的中心点。

sphere_radius

必须参数。数字。球体的半径。

返回值

列表

执行成功,返回相交计算结果组成的列表。计算结果如下:

元素

类型

描述

0

数字

相交类型,0 = 点, 1 = 圆。

1

Point3d 点对象或平面。

如果为点相交,返回代表相交位置的 Point3d 点对象。

如果相交得到圆,此为圆所在的平面。平面的原点将作为圆的中心点。

2 (相交得到圆时才有)

数字

如果相交得到圆,返回圆的半径。

None

如果执行不成功或出错,返回空值。

示例

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])

同见

IntersectPlanes

LinePlaneIntersection

PlanePlaneIntersection