Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

15.3 KB
Raw Blame
// Generated by tools/gen.sh from Blender's own API (tools/dump.py). Don't edit: regenerate.
import type * as H from "../../types";
import type * as M from "../../mathutils";
import type * as R from "../rna";
import type * as E from "../enums";
import type * as P from "../py";

/** The Blender geometry module. */
export interface Api {
  /**
   * Returns the area of the 2D or 3D triangle defined.
   * @returns The area of the triangle.
   * @param v1 Point1
   * @param v2 Point2
   * @param v3 Point3
   */
  area_tri(v1: H.In<M.VectorLike>, v2: H.In<M.VectorLike>, v3: H.In<M.VectorLike>): H.Ref<number>;
  /**
   * Return a transformed point, the transformation is defined by 2 triangles.
   * @returns The transformed point
   * @param point The point to transform.
   * @param tri_a1 source triangle vertex.
   * @param tri_a2 source triangle vertex.
   * @param tri_a3 source triangle vertex.
   * @param tri_b1 target triangle vertex.
   * @param tri_b2 target triangle vertex.
   * @param tri_b3 target triangle vertex.
   */
  barycentric_transform(point: H.In<M.VectorLike>, tri_a1: H.In<M.VectorLike>, tri_a2: H.In<M.VectorLike>, tri_a3: H.In<M.VectorLike>, tri_b1: H.In<M.VectorLike>, tri_b2: H.In<M.VectorLike>, tri_b3: H.In<M.VectorLike>): H.Remote<M.Vector>;
  /**
   * Returns an angle that best fits the points to an axis aligned rectangle
   * @returns The rotation angle in radians for the best axis-aligned bounding box fit.
   * @param points Sequence of 2D points.
   */
  box_fit_2d(points: H.In<readonly (readonly number[])[]>): H.Ref<number>;
  /**
   * Returns a tuple with the width and height of the packed bounding box.
   * @returns The width and height of the packed bounding box.
   * @param boxes list of boxes, each box is a list where the first 4 items are [X, Y, width, height, ...] other items are ignored. The X & Y values in this list are modified to set the packed positions.
   */
  box_pack_2d(boxes: H.In<readonly (readonly number[])[]>): H.Ref<[number, number]>;
  /**
   * Takes 4 vectors: one is the point and the next 3 define the triangle.
   * @returns The closest point of the triangle.
   * @param pt Point
   * @param tri_p1 First point of the triangle
   * @param tri_p2 Second point of the triangle
   * @param tri_p3 Third point of the triangle
   */
  closest_point_on_tri(pt: H.In<M.VectorLike>, tri_p1: H.In<M.VectorLike>, tri_p2: H.In<M.VectorLike>, tri_p3: H.In<M.VectorLike>): H.Remote<M.Vector>;
  /**
   * Returns the indices of the points forming the convex hull, in counter-clockwise order.
   * @returns Indices of convex hull vertices in counter-clockwise order.
   * @param points Sequence of 2D points.
   */
  convex_hull_2d(points: H.In<readonly (readonly number[])[]>): H.Ref<number[]>;
  /**
   * Computes the Constrained Delaunay Triangulation of a set of vertices,
   * with edges and faces that must appear in the triangulation.
   * Some triangles may be eaten away, or combined with other triangles,
   * according to output type.
   * The returned verts may be in a different order from input verts, may be moved
   * slightly, and may be merged with other nearby verts.
   * The three returned orig lists give, for each of verts, edges, and faces, the list of
   * input element indices corresponding to the positionally same output element.
   * For edges, the orig indices start with the input edges and then continue
   * with the edges implied by each of the faces (n of them for an n-gon).
   * If the need_ids argument is supplied, and False, then the code skips the preparation
   * of the orig arrays, which may save some time.
   * @returns Output tuple, (vert_coords, edges, faces, orig_verts, orig_edges, orig_faces)
   * @param vert_coords Vertex coordinates (2d)
   * @param edges Edges, as pairs of indices in ``vert_coords``
   * @param faces Faces, each sublist is a face, as indices in ``vert_coords`` (CCW oriented).
   * @param output_type What output looks like. 0 => triangles with convex hull. 1 => triangles inside constraints. 2 => the input constraints, intersected. 3 => like 2 but detect holes and omit them from output. 4 => like 2 but with extra edges to make valid BMesh faces. 5 => like 4 but detect holes and omit them from output.
   * @param epsilon For nearness tests; should not be zero
   * @param need_ids are the orig output arrays needed?
   */
  delaunay_2d_cdt(vert_coords: H.In<readonly M.VectorLike[]>, edges: H.In<readonly (readonly [number, number])[]>, faces: H.In<readonly (readonly number[])[]>, output_type: H.In<number>, epsilon: H.In<number>, need_ids?: H.In<boolean>): H.Ref<[M.Vector[], [number, number][], number[][], number[][], number[][], number[][]]>;
  /**
   * Returns the signed distance between a point and a plane (negative when below the normal).
   * @returns The signed distance.
   * @param pt Point
   * @param plane_co A point on the plane
   * @param plane_no The direction the plane is facing
   */
  distance_point_to_plane(pt: H.In<M.VectorLike>, plane_co: H.In<M.VectorLike>, plane_no: H.In<M.VectorLike>): H.Ref<number>;
  /**
   * Interpolate a bezier spline segment.
   * @returns The interpolated points.
   * @param knot1 First bezier spline point.
   * @param handle1 First bezier spline handle.
   * @param handle2 Second bezier spline handle.
   * @param knot2 Second bezier spline point.
   * @param resolution Number of points to return.
   */
  interpolate_bezier(knot1: H.In<M.VectorLike>, handle1: H.In<M.VectorLike>, handle2: H.In<M.VectorLike>, knot2: H.In<M.VectorLike>, resolution: H.In<number>): H.Ref<M.Vector[]>;
  /**
   * Returns a tuple with the points on each line respectively closest to the other.
   * @returns The intersection on each line or None when the lines are parallel.
   * @param v1 First point of the first line
   * @param v2 Second point of the first line
   * @param v3 First point of the second line
   * @param v4 Second point of the second line
   */
  intersect_line_line(v1: H.In<M.VectorLike>, v2: H.In<M.VectorLike>, v3: H.In<M.VectorLike>, v4: H.In<M.VectorLike>): H.Ref<[M.Vector, M.Vector] | null>;
  /**
   * 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.
   * @returns The point of intersection or None when not found
   * @param lineA_p1 First point of the first segment
   * @param lineA_p2 Second point of the first segment
   * @param lineB_p1 First point of the second segment
   * @param lineB_p2 Second point of the second segment
   */
  intersect_line_line_2d(lineA_p1: H.In<M.VectorLike>, lineA_p2: H.In<M.VectorLike>, lineB_p1: H.In<M.VectorLike>, lineB_p2: H.In<M.VectorLike>): H.Remote<M.Vector>;
  /**
   * Calculate the intersection between a line (as 2 vectors) and a plane.
   * Returns a vector for the intersection or None.
   * @returns The point of intersection or None when not found
   * @param line_a First point of the line
   * @param line_b Second point of the line
   * @param plane_co A point on the plane
   * @param plane_no The direction the plane is facing
   * @param no_flip Currently ignored.
   */
  intersect_line_plane(line_a: H.In<M.VectorLike>, line_b: H.In<M.VectorLike>, plane_co: H.In<M.VectorLike>, plane_no: H.In<M.VectorLike>, no_flip?: H.In<boolean>): H.Remote<M.Vector>;
  /**
   * Takes a line (as 2 points) and a sphere (as a point and a radius) and
   * returns the intersection
   * @returns The intersection points as a pair of vectors (each is None when not found).
   * @param line_a First point of the line
   * @param line_b Second point of the line
   * @param sphere_co The center of the sphere
   * @param sphere_radius Radius of the sphere
   * @param clip When False, don't restrict the intersection to the line segment.
   */
  intersect_line_sphere(line_a: H.In<M.VectorLike>, line_b: H.In<M.VectorLike>, sphere_co: H.In<M.VectorLike>, sphere_radius: H.In<number>, clip?: H.In<boolean>): H.Ref<[M.Vector, M.Vector]>;
  /**
   * Takes a line (as 2 points) and a circle (as a point and a radius) and
   * returns the intersection
   * @returns The intersection points as a pair of vectors (each is None when not found).
   * @param line_a First point of the line
   * @param line_b Second point of the line
   * @param sphere_co The center of the circle
   * @param sphere_radius Radius of the circle
   * @param clip When False, don't restrict the intersection to the line segment.
   */
  intersect_line_sphere_2d(line_a: H.In<M.VectorLike>, line_b: H.In<M.VectorLike>, sphere_co: H.In<M.VectorLike>, sphere_radius: H.In<number>, clip?: H.In<boolean>): H.Ref<[M.Vector, M.Vector]>;
  /**
   * Return the intersection between two planes
   * @returns The line of the intersection represented as a point and a vector or None if the intersection can't be calculated
   * @param plane_a_co Point on the first plane
   * @param plane_a_no Normal of the first plane
   * @param plane_b_co Point on the second plane
   * @param plane_b_no Normal of the second plane
   */
  intersect_plane_plane(plane_a_co: H.In<M.VectorLike>, plane_a_no: H.In<M.VectorLike>, plane_b_co: H.In<M.VectorLike>, plane_b_no: H.In<M.VectorLike>): H.Ref<[M.Vector, M.Vector] | [null, null]>;
  /**
   * Takes a point and a line and returns the closest point on the line and its parametric distance from the first point of the line. A value of 0.0 is the first point, 1.0 is the second, values outside [0, 1] are extrapolated.
   * @returns The closest point on the line and its parametric distance from the first point.
   * @param pt Point
   * @param line_p1 First point of the line
   * @param line_p2 Second point of the line
   */
  intersect_point_line(pt: H.In<M.VectorLike>, line_p1: H.In<M.VectorLike>, line_p2: H.In<M.VectorLike>): H.Ref<[M.Vector, number]>;
  /**
   * Takes a point and a segment and returns the closest point on the segment and the distance to the segment.
   * @returns The closest point on the segment and the distance to the segment.
   * @param pt Point
   * @param seg_p1 First point of the segment
   * @param seg_p2 Second point of the segment
   */
  intersect_point_line_segment(pt: H.In<M.VectorLike>, seg_p1: H.In<M.VectorLike>, seg_p2: H.In<M.VectorLike>): H.Ref<[M.Vector, number]>;
  /**
   * 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 a non-zero value if the point is within the quad, otherwise 0.
   * Works only with convex quads without singular edges.
   * @returns 1 if inside with CCW winding, -1 if inside with CW winding, otherwise 0.
   * @param pt Point
   * @param quad_p1 First point of the quad
   * @param quad_p2 Second point of the quad
   * @param quad_p3 Third point of the quad
   * @param quad_p4 Fourth point of the quad
   */
  intersect_point_quad_2d(pt: H.In<M.VectorLike>, quad_p1: H.In<M.VectorLike>, quad_p2: H.In<M.VectorLike>, quad_p3: H.In<M.VectorLike>, quad_p4: H.In<M.VectorLike>): H.Ref<number>;
  /**
   * Takes 4 vectors: one is the point and the next 3 define the triangle. Projects the point onto the triangle plane and checks if it is within the triangle.
   * @returns Point on the triangle's plane or None if it's outside the triangle
   * @param pt Point
   * @param tri_p1 First point of the triangle
   * @param tri_p2 Second point of the triangle
   * @param tri_p3 Third point of the triangle
   */
  intersect_point_tri(pt: H.In<M.VectorLike>, tri_p1: H.In<M.VectorLike>, tri_p2: H.In<M.VectorLike>, tri_p3: H.In<M.VectorLike>): H.Remote<M.Vector>;
  /**
   * Takes 4 vectors (using only the x and y coordinates): one is the point and the next 3 define the triangle. Returns a non-zero value if the point is within the triangle, otherwise 0.
   * @returns 1 if inside with CCW winding, -1 if inside with CW winding, otherwise 0.
   * @param pt Point
   * @param tri_p1 First point of the triangle
   * @param tri_p2 Second point of the triangle
   * @param tri_p3 Third point of the triangle
   */
  intersect_point_tri_2d(pt: H.In<M.VectorLike>, tri_p1: H.In<M.VectorLike>, tri_p2: H.In<M.VectorLike>, tri_p3: H.In<M.VectorLike>): H.Ref<number>;
  /**
   * Returns the intersection between a ray and a triangle, if possible, returns None otherwise.
   * @returns The point of intersection or None if no intersection is found
   * @param v1 Point1
   * @param v2 Point2
   * @param v3 Point3
   * @param ray Direction of the ray
   * @param orig Origin
   * @param clip When False, don't restrict the intersection to the area of the triangle, use the infinite plane defined by the triangle.
   */
  intersect_ray_tri(v1: H.In<M.VectorLike>, v2: H.In<M.VectorLike>, v3: H.In<M.VectorLike>, ray: H.In<M.VectorLike>, orig: H.In<M.VectorLike>, clip?: H.In<boolean>): H.Remote<M.Vector>;
  /**
   * Returns the 2 intersection points of two circles.
   * @returns The 2 intersection points or None when there is no intersection.
   * @param p_a Center of the first circle
   * @param radius_a Radius of the first circle
   * @param p_b Center of the second circle
   * @param radius_b Radius of the second circle
   */
  intersect_sphere_sphere_2d(p_a: H.In<M.VectorLike>, radius_a: H.In<number>, p_b: H.In<M.VectorLike>, radius_b: H.In<number>): H.Ref<[M.Vector, M.Vector] | [null, null]>;
  /**
   * Check if two 2D triangles intersect.
   * @returns True if the triangles intersect.
   * @param tri_a1 First vertex of the first triangle.
   * @param tri_a2 Second vertex of the first triangle.
   * @param tri_a3 Third vertex of the first triangle.
   * @param tri_b1 First vertex of the second triangle.
   * @param tri_b2 Second vertex of the second triangle.
   * @param tri_b3 Third vertex of the second triangle.
   */
  intersect_tri_tri_2d(tri_a1: H.In<M.VectorLike>, tri_a2: H.In<M.VectorLike>, tri_a3: H.In<M.VectorLike>, tri_b1: H.In<M.VectorLike>, tri_b2: H.In<M.VectorLike>, tri_b3: H.In<M.VectorLike>): H.Ref<boolean>;
  /**
   * Returns the normal of a 3D polygon.
   * @returns The normal vector.
   * @param vectors 3 or more vectors to calculate normals.
   */
  normal(...args: any[]): H.Remote<M.Vector>;
  /**
   * Returns a list of points inside all planes given and a list of index values for the planes used.
   * @returns Two lists, one containing the 3D coordinates inside the planes, another containing the plane indices used.
   * @param planes List of planes (4D vectors).
   * @param epsilon_coplanar Epsilon value for interpreting plane pairs as co-planar.
   * @param epsilon_isect Epsilon value for intersection.
   */
  points_in_planes(planes: H.In<readonly M.VectorLike[]>, epsilon_coplanar?: H.In<number>, epsilon_isect?: H.In<number>): H.Ref<[M.Vector[], number[]]>;
  /**
   * Takes a list of polylines (each point a pair or triplet of numbers) and returns the point indices for a polyline filled with triangles. Does not handle degenerate geometry (such as zero-length lines due to consecutive identical points).
   * @returns A list of triangles.
   * @param polylines Polygons where each polygon is a sequence of 2D or 3D points.
   */
  tessellate_polygon(polylines: H.In<readonly (readonly (readonly number[])[])[]>): H.Ref<[number, number, number][]>;
  /**
   * Return the absolute (unsigned) volume formed by a tetrahedron (points can be in any order).
   * @returns The volume of the tetrahedron.
   * @param v1 Point1
   * @param v2 Point2
   * @param v3 Point3
   * @param v4 Point4
   */
  volume_tetrahedron(v1: H.In<M.VectorLike>, v2: H.In<M.VectorLike>, v3: H.In<M.VectorLike>, v4: H.In<M.VectorLike>): H.Ref<number>;
}