Calculates the intersection of a line and a cylinder.
rhinoscriptsyntax.LineCylinderIntersection (line, cylinder_plane, cylinder_height, cylinder_radius)
rhinoscript.line.LineCylinderIntersection (line, cylinder_plane, cylinder_height, cylinder_radius)
line |
Required. List of 6 numbers, 2 Point3d, or Line. Two 3-D points identifying the starting and ending points of the line. |
cylinder_plane |
Required. Plane. The base plane of the cylinder. |
cylinder_height |
Required. Number. The height of the cylinder. |
cylinder_radius |
Required. Number. The radius of the cylinder. |
List |
A list of intersection points, either one or two, if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
plane = rs.WorldXYPlane()
line = (-10,0,0), (10,0,10)
points = rs.LineCylinderIntersection(line, plane, cylinder_height=10, cylinder_radius=5)
if points:
for point in points: rs.AddPoint(point)