lineLineIntersect

common.lineLineIntersect()
lineLineIntersect(p1: Point3, p2: Point3, p3: Point3, p4: Point3): (None | Point3)

Finds the closest point on the first line to the second line in 3D space.

This function computes the point on line p1-p2 that is closest to line p3-p4. For intersecting lines, this returns the intersection point. For skew lines (non-intersecting, non-parallel lines in 3D), it returns the point on the first line that minimizes the distance to the second line.

Parameters

p1: Point3

First point defining the first line

p2: Point3

Second point defining the first line

p3: Point3

First point defining the second line

p4: Point3

Second point defining the second line

Returns: (None | Point3)

The closest point on line p1-p2 to line p3-p4, or null if either line is degenerate or lines are parallel