Calculates the intersection of two non-parallel lines. Note, the two lines do not have to intersect for an intersection to be found.
But, two lines in three dimensions generally do not intersect at a point. They may be parallel (no intersections) or they may be coincident (infinite intersections). But, most often only their projection onto a plane intersects. When they do not exactly intersect at a point they can be connected by a line segment, the shortest line segment is unique and is often considered to be their intersection in 3-D.
rhinoscriptsyntax.LineLineIntersection (lineA, lineB, planar=True)
rhinoscript.line.LineLineIntersection (lineA, lineB, planar=True)
lineA |
Required. List of 6 numbers, two Point3d, or Line. |
lineB |
Required. List of 6 numbers, two Point3d, or Line |
List |
A list containing a point on the first line and a point on the second line if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
lineA = (1,1,0), (5,0,0)
lineB = (1,3,0), (5,5,0)
point = rs.LineLineIntersection(lineA, lineB)
if point:
rs.AddPoint(point[0])
rs.AddPoint(point[1])