计算一条直线和一个球体的交点。
rhinoscriptsyntax.LineSphereIntersection (line, sphere_center, sphere_radius)
rhinoscript.line.LineSphereIntersection (line, sphere_center, sphere_radius)
line |
必须参数。直线。 |
sphere_center |
必须参数。Point3d 点。球体中心点。 |
sphere_radius |
必须参数。数字。球体的半径。 |
列表 |
不管有一个还是两个交点,都返回列表。 |
None |
如果执行不成功或出错,返回空值。 |
import rhinoscriptsyntax as rs
radius = 10
line = (-10,0,0), (10,0,10)
points = rs.LineSphereIntersection(line, (0,0,0), radius)
if points:
for point in points: rs.AddPoint(point)