"""


Geometry Utilities (mathutils.geometry)
***************************************

The Blender geometry module

:func:`area_tri`

:func:`barycentric_transform`

:func:`box_fit_2d`

:func:`box_pack_2d`

:func:`convex_hull_2d`

:func:`distance_point_to_plane`

:func:`interpolate_bezier`

:func:`intersect_line_line`

:func:`intersect_line_line_2d`

:func:`intersect_line_plane`

:func:`intersect_line_sphere`

:func:`intersect_line_sphere_2d`

:func:`intersect_plane_plane`

:func:`intersect_point_line`

:func:`intersect_point_quad_2d`

:func:`intersect_point_tri`

:func:`intersect_point_tri_2d`

:func:`intersect_ray_tri`

:func:`intersect_sphere_sphere_2d`

:func:`normal`

:func:`points_in_planes`

:func:`tessellate_polygon`

:func:`volume_tetrahedron`

"""

import typing

import mathutils

def area_tri(v1: mathutils.Vector, v2: mathutils.Vector, v3: mathutils.Vector) -> float:

  """

  Returns the area size of the 2D or 3D triangle defined.

  """

  ...

def barycentric_transform(point: mathutils.Vector, tri_a1: mathutils.Vector, tri_a2: mathutils.Vector, tri_a3: mathutils.Vector, tri_b1: mathutils.Vector, tri_b2: mathutils.Vector, tri_b3: mathutils.Vector) -> typing.Any:

  """

  Return a transformed point, the transformation is defined by 2 triangles.

  """

  ...

def box_fit_2d(points: typing.List[typing.Any]) -> float:

  """

  Returns an angle that best fits the points to an axis aligned rectangle

  """

  ...

def box_pack_2d(boxes: typing.List[typing.Any]) -> typing.Tuple[typing.Any, ...]:

  """

  Returns the normal of the 3D tri or quad.

  """

  ...

def convex_hull_2d(points: typing.List[typing.Any]) -> typing.List[int]:

  """

  Returns a list of indices into the list given

  """

  ...

def distance_point_to_plane(pt: mathutils.Vector, plane_co: mathutils.Vector, plane_no: mathutils.Vector) -> float:

  """

  Returns the signed distance between a point and a plane    (negative when below the normal).

  """

  ...

def interpolate_bezier(knot1: mathutils.Vector, handle1: mathutils.Vector, handle2: mathutils.Vector, knot2: mathutils.Vector, resolution: int) -> typing.List[mathutils.Vector]:

  """

  Interpolate a bezier spline segment.

  """

  ...

def intersect_line_line(v1: mathutils.Vector, v2: mathutils.Vector, v3: mathutils.Vector, v4: mathutils.Vector) -> typing.Tuple[typing.Any, ...]:

  """

  Returns a tuple with the points on each line respectively closest to the other.

  """

  ...

def intersect_line_line_2d(lineA_p1: mathutils.Vector, lineA_p2: mathutils.Vector, lineB_p1: mathutils.Vector, lineB_p2: mathutils.Vector) -> mathutils.Vector:

  """

  Takes 2 segments (defined by 4 vectors) and returns a vector for their point of intersection or None.

  Warning: Despite its name, this function works on segments, and not on lines.

  """

  ...

def intersect_line_plane(line_a: mathutils.Vector, line_b: mathutils.Vector, plane_co: mathutils.Vector, plane_no: mathutils.Vector, no_flip: typing.Any = False) -> mathutils.Vector:

  """

  Calculate the intersection between a line (as 2 vectors) and a plane.
Returns a vector for the intersection or None.

  """

  ...

def intersect_line_sphere(line_a: mathutils.Vector, line_b: mathutils.Vector, sphere_co: mathutils.Vector, sphere_radius: typing.Any, clip: typing.Any = True) -> typing.Any:

  """

  Takes a line (as 2 points) and a sphere (as a point and a radius) and
returns the intersection

  """

  ...

def intersect_line_sphere_2d(line_a: mathutils.Vector, line_b: mathutils.Vector, sphere_co: mathutils.Vector, sphere_radius: typing.Any, clip: typing.Any = True) -> typing.Any:

  """

  Takes a line (as 2 points) and a sphere (as a point and a radius) and
returns the intersection

  """

  ...

def intersect_plane_plane(plane_a_co: mathutils.Vector, plane_a_no: mathutils.Vector, plane_b_co: mathutils.Vector, plane_b_no: mathutils.Vector) -> typing.Tuple[typing.Any, ...]:

  """

  Return the intersection between two planes

  """

  ...

def intersect_point_line(pt: mathutils.Vector, line_p1: mathutils.Vector, line_p2: typing.Any) -> typing.Any:

  """

  Takes a point and a line and returns a tuple with the closest point on the line and its distance from the first point of the line as a percentage of the length of the line.

  """

  ...

def intersect_point_quad_2d(pt: mathutils.Vector, quad_p1: mathutils.Vector, quad_p2: mathutils.Vector, quad_p3: mathutils.Vector, quad_p4: mathutils.Vector) -> int:

  """

  Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad,
only the x and y are used from the vectors. Returns 1 if the point is within the quad, otherwise 0.
Works only with convex quads without singular edges.

  """

  ...

def intersect_point_tri(pt: mathutils.Vector, tri_p1: mathutils.Vector, tri_p2: mathutils.Vector, tri_p3: mathutils.Vector) -> mathutils.Vector:

  """

  Takes 4 vectors: one is the point and the next 3 define the triangle.

  """

  ...

def intersect_point_tri_2d(pt: mathutils.Vector, tri_p1: mathutils.Vector, tri_p2: mathutils.Vector, tri_p3: mathutils.Vector) -> int:

  """

  Takes 4 vectors (using only the x and y coordinates): one is the point and the next 3 define the triangle. Returns 1 if the point is within the triangle, otherwise 0.

  """

  ...

def intersect_ray_tri(v1: mathutils.Vector, v2: mathutils.Vector, v3: mathutils.Vector, ray: mathutils.Vector, orig: mathutils.Vector, clip: bool = True) -> mathutils.Vector:

  """

  Returns the intersection between a ray and a triangle, if possible, returns None otherwise.

  """

  ...

def intersect_sphere_sphere_2d(p_a: mathutils.Vector, radius_a: float, p_b: mathutils.Vector, radius_b: float) -> typing.Tuple[typing.Any, ...]:

  """

  Returns 2 points on between intersecting circles.

  """

  ...

def normal(vectors: typing.Sequence[typing.Any]) -> mathutils.Vector:

  """

  Returns the normal of a 3D polygon.

  """

  ...

def points_in_planes(planes: typing.List[mathutils.Vector]) -> typing.Any:

  """

  Returns a list of points inside all planes given and a list of index values for the planes used.

  """

  ...

def tessellate_polygon(veclist_list: typing.Any) -> typing.List[typing.Any]:

  """

  Takes a list of polylines (each point a vector) and returns the point indices for a polyline filled with triangles.

  """

  ...

def volume_tetrahedron(v1: mathutils.Vector, v2: mathutils.Vector, v3: mathutils.Vector, v4: mathutils.Vector) -> float:

  """

  Return the volume formed by a tetrahedron (points can be in any order).

  """

  ...
