Intersection
============

.. py:module:: rhino3dm

.. py:class:: Intersection

   .. py:staticmethod:: LineLine(lineA, lineB)

      Intersects two lines.

      :param Line lineA: First line for intersection.
      :param Line lineB: Second line for intersection.
      :param float tolerance: If tolerance > 0.0, then an intersection is reported only if the distance between the points is <= tolerance. \
         If tolerance <= 0.0, then the closest point between the lines is reported.
      :param bool finiteSegments: If true, the input lines are treated as finite segments. \
         If false, the input lines are treated as infinite lines.

      :return: tuple (bool, float, float)

         - True if a closest point can be calculated and the result passes the tolerance parameter test; otherwise false.
         - Parameter on lineA that is closest to LineB. \
           The shortest distance between the lines is the chord from lineA.PointAt(a) to lineB.PointAt(b) \
         - Parameter on lineB that is closest to LineA. \
           The shortest distance between the lines is the chord from lineA.PointAt(a) to lineB.PointAt(b) \

      :rtype: (bool, float, float)

   .. py:staticmethod:: LineLine(lineA, lineB, tolerance, finiteSegments)

      Intersects two lines.

      :param Line lineA: First line for intersection.
      :param Line lineB: Second line for intersection.
      :param float tolerance: If tolerance > 0.0, then an intersection is reported only if the distance between the points is <= tolerance. \
         If tolerance <= 0.0, then the closest point between the lines is reported.
      :param bool finiteSegments: If true, the input lines are treated as finite segments. \
         If false, the input lines are treated as infinite lines.

      :return: tuple (bool, float, float)

         - True if a closest point can be calculated and the result passes the tolerance parameter test; otherwise false.
         - Parameter on lineA that is closest to LineB. \
           The shortest distance between the lines is the chord from lineA.PointAt(a) to lineB.PointAt(b) \
         - Parameter on lineB that is closest to LineA. \
           The shortest distance between the lines is the chord from lineA.PointAt(a) to lineB.PointAt(b) \

      :rtype: (bool, float, float)

   .. py:staticmethod:: LinePlane(line, plane)

      Intersects a line and a plane. This function only returns True if the
      intersection result is a single point (i.e. if the line is coincident with
      the plane then no intersection is assumed).

      :param Line line: Line for intersection.
      :param rhino3dm.Plane plane: Plane to intersect.

      :return: tuple (bool, float)

         - True on success, False on failure.
         - Parameter on line where intersection occurs. \
           If the parameter is not within the {0, 1} Interval then the finite segment \
           does not intersect the plane. \

      :rtype: (bool, float)

   .. py:staticmethod:: PlanePlane(planeA, planeB)

      Intersects two planes and return the intersection line. If the planes are
      parallel or coincident, no intersection is assumed.

      :param rhino3dm.Plane planeA: First plane for intersection.
      :param rhino3dm.Plane planeB: Second plane for intersection.

      :return: tuple (bool, Line)

         - True on success, False on failure.
         - If this function returns true, \
           the intersectionLine parameter will return the line where the planes intersect. \

      :rtype: (bool, Line)

   .. py:staticmethod:: PlanePlanePlane(planeA, planeB, planeC)

      Intersects three planes to find the single point they all share.

      :param rhino3dm.Plane planeA: First plane for intersection.
      :param rhino3dm.Plane planeB: Second plane for intersection.
      :param rhino3dm.Plane planeC: Third plane for intersection.

      :return: tuple (bool, rhino3dm.Point3d)

         - True on success, False on failure. If at least two out of the three planes \
           are parallel or coincident, failure is assumed. \
         - Point where all three planes converge. \

      :rtype: (bool, rhino3dm.Point3d)

   .. py:staticmethod:: PlaneSphere(plane, sphere)

      Intersects a plane with a sphere using exact calculations.

      :param rhino3dm.Plane plane: Plane to intersect.
      :param rhino3dm.Sphere sphere: Sphere to intersect.

      :return: tuple (PlaneSphereIntersection, Circle)

         - If  is returned, the intersectionCircle has a radius of zero and the center point \
           is the point on the plane closest to the sphere. \
         - Intersection result. \

      :rtype: (PlaneSphereIntersection, Circle)

   .. py:staticmethod:: LineCircle(line, circle)

      Intersects a line with a circle using exact calculations.

      :param Line line: Line for intersection.
      :param Circle circle: Circle for intersection.

      :return: tuple (LineCircleIntersection, float, rhino3dm.Point3d, float, rhino3dm.Point3d)

         - If  is returned, only t1 and point1 will have valid values. \
           If  is returned, t2 and point2 will also be filled out. \
         - Parameter on line for first intersection. \
         - Point on circle closest to first intersection. \
         - Parameter on line for second intersection. \
         - Point on circle closest to second intersection. \

      :rtype: (LineCircleIntersection, float, rhino3dm.Point3d, float, rhino3dm.Point3d)

   .. py:staticmethod:: LineSphere(line, sphere)

      Intersects a line with a sphere using exact calculations.

      :param Line line: Line for intersection.
      :param rhino3dm.Sphere sphere: Sphere for intersection.

      :return: tuple (LineSphereIntersection, rhino3dm.Point3d, rhino3dm.Point3d)

         - If  is returned, the first point is the point on the line closest to the sphere and \
           the second point is the point on the sphere closest to the line. \
           If  is returned, the first point is the point on the line and the second point is the \
           same point on the sphere. \
         - First intersection point. \
         - Second intersection point. \

      :rtype: (LineSphereIntersection, rhino3dm.Point3d, rhino3dm.Point3d)

   .. py:staticmethod:: LineCylinder(line, cylinder)

      Intersects a line with a cylinder using exact calculations.

      :param Line line: Line for intersection.
      :param Cylinder cylinder: Cylinder for intersection.

      :return: tuple (LineCylinderIntersection, rhino3dm.Point3d, rhino3dm.Point3d)

         - If None is returned, the first point is the point on the line closest \
           to the cylinder and the second point is the point on the cylinder closest to \
           the line. \
           If  is returned, the first point \
           is the point on the line and the second point is the  same point on the \
           cylinder. \
         - First intersection point. \
         - Second intersection point. \

      :rtype: (LineCylinderIntersection, rhino3dm.Point3d, rhino3dm.Point3d)

   .. py:staticmethod:: SphereSphere(sphereA, sphereB)

      Intersects two spheres using exact calculations.

      :param rhino3dm.Sphere sphereA: First sphere to intersect.
      :param rhino3dm.Sphere sphereB: Second sphere to intersect.

      :return: tuple (SphereSphereIntersection, Circle)

         - The intersection type.
         - If intersection is a point, then that point will be the center, radius 0. \

      :rtype: (SphereSphereIntersection, Circle)

   .. py:staticmethod:: LineBox(line, box, tolerance)

      Intersects an infinite line and an axis aligned bounding box.

      :param rhino3dm.BoundingBox box: BoundingBox to intersect.
      :param Line line: Line for intersection.
      :param float tolerance: If tolerance > 0.0, then the intersection is performed against a box \
         that has each side moved out by tolerance.

      :return: tuple (bool, rhino3dm.Interval)

         - True if the line intersects the box, False if no intersection occurs.
         - The chord from line.PointAt(lineParameters.T0) to line.PointAt(lineParameters.T1) is the intersection. \

      :rtype: (bool, rhino3dm.Interval)
