
    Ti                     .    d dl ZddlmZ ddlmZ ddZdS )    N   )util)tol_pathc                    t          j        | d          \  } }t          j        |d          \  }}|t          j        |                              d          z  }t	          j        t	          j        t	          j        |d                              t          j	        k     rdS | \  }}|\  }}||z
  }|7t	          j
        ||          }|t          j                            |          z  }t	          j
        ||          }	|	t          j                            |	          z  }	t          j                            |          }
|
t          j	        k    r5t          t	          j        |||
z                      t          j	        k    rdS t	          j        |	 |          t	          j        |	|          z  }|||z  z   }d|dd|z
           fS )	a  
    Find the intersection between two lines.
    Uses terminology from:
    http://geomalgorithms.com/a05-_intersect-1.html

    line 1:    P(s) = p_0 + sU
    line 2:    Q(t) = q_0 + tV

    Parameters
    ---------
    origins : (2, d) float
      Points on lines (d in [2,3])
    directions : (2, d) float
      Direction vectors
    plane_normal : (3, ) float
      If not passed computed from cross

    Returns
    ---------
    intersects : bool
      Whether the lines intersect.
        In 2D, false if the lines are parallel
        In 3D, false if lines are not coplanar
    intersection : (d,) float or None
      Point of intersection
    T)	return_2D)   r   )axis)FNN   )r   stack_3Drow_normreshapenpsumabsdifftolzerocrosslinalgnormdot)origins
directionsplane_normalis_2Dq_0p_0vuwv_perpw_norms_Iintersections                T/DATA/AppData/hermes/venv/lib/python3.11/site-packages/trimesh/path/intersections.py	line_liner'      s   8 ]7d;;;NGUjDAAAJ $-
++33G<<<J 
vbfRWZa0001122SX=={ HCDAqc	A x1~~	|444 Xa&&F
binnV$$$F
 Y^^AFSa&j!A!ABBSXMM{ &&!

rvfa00
0Cq=LmUm,,,    )N)numpyr    r   	constantsr   r   r'    r(   r&   <module>r-      sY              ' ' ' ' ' 'B- B- B- B- B- B-r(   