Calculates the intersection of a line and a sphere.
rhinoscriptsyntax.LineSphereIntersection (line, sphere_center, sphere_radius)
rhinoscript.line.LineSphereIntersection (line, sphere_center, sphere_radius)
line |
Required. Line. |
sphere_center |
Required. Point3d. The center point of the sphere. |
sphere_radius |
Required. Number. The radius of the sphere. |
List |
A list of intersection points, either one or two, if successful. |
None |
If not successful, or on error. |
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)