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.

5.4 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";

/** BVH tree structures for proximity searches and ray casts on geometry. */
export interface Api {
  readonly BVHTree: BVHTreeClass;
}

/** mathutils.bvhtree.BVHTree */
export interface BVHTree {
  /**
   * Cast a ray onto the geometry.
   * @returns Returns a tuple: (position, normal, index, distance),
   * Values will all be None if no hit is found.
   * @param origin Start location of the ray.
   * @param direction Direction of the ray (normalized internally).
   * @param distance Maximum distance threshold.
   */
  ray_cast(origin: H.In<M.VectorLike>, direction: H.In<M.VectorLike>, distance?: H.In<number>): H.Ref<[M.Vector, M.Vector, number | null, number | null]>;
  /**
   * Find the nearest element (typically face index) to a point.
   * @returns Returns a tuple: (position, normal, index, distance),
   * Values will all be None if no hit is found.
   * @param origin Find nearest element to this point.
   * @param distance Maximum distance threshold.
   */
  find_nearest(origin: H.In<M.VectorLike>, distance?: H.In<number>): H.Ref<[M.Vector, M.Vector, number | null, number | null]>;
  /**
   * Find the nearest elements (typically face index) to a point in the distance range.
   * @returns Returns a list of tuples (position, normal, index, distance)
   * @param origin Find nearest elements to this point.
   * @param distance Maximum distance threshold.
   */
  find_nearest_range(origin: H.In<M.VectorLike>, distance?: H.In<number>): H.Ref<[M.Vector, M.Vector, number, number][]>;
  /**
   * Find overlapping indices between 2 trees.
   * @returns Returns a list of unique index pairs, the first index referencing this tree, the second referencing the **other_tree**.
   * @param other_tree Other tree to perform overlap test on.
   */
  overlap(other_tree: P.mathutils_bvhtree.BVHTree): H.Ref<[number, number][]>;
}
/** The class mathutils.bvhtree.BVHTree: called, a new one. */
export interface BVHTreeClass {
  (...args: any[]): H.Own<BVHTree>;
  /**
   * BVH tree constructed from geometry passed in as arguments.
   * @returns BVHTree from polygon data.
   * @param vertices float triplets each representing ``(x, y, z)`` coordinates.
   * @param polygons Sequence of polygons, each containing indices to the vertices argument.
   */
  FromPolygons(vertices: H.In<readonly (readonly number[])[]>, polygons: H.In<readonly (readonly number[])[]>, kw?: {
    /** Use when all **polygons** are triangles for more efficient conversion. */
    all_triangles?: H.In<boolean>;
    /** Increase the threshold for detecting overlap and raycast hits. */
    epsilon?: H.In<number>;
  }): H.Ptr<P.mathutils_bvhtree.BVHTree>;
  /**
   * BVH tree constructed from geometry passed in as arguments.
   * @returns BVHTree from polygon data.
   * @param vertices float triplets each representing ``(x, y, z)`` coordinates.
   * @param polygons Sequence of polygons, each containing indices to the vertices argument.
   */
  FromPolygons(kw: {
    /** float triplets each representing ``(x, y, z)`` coordinates. */
    vertices: H.In<readonly (readonly number[])[]>;
    /** Sequence of polygons, each containing indices to the vertices argument. */
    polygons: H.In<readonly (readonly number[])[]>;
    /** Use when all **polygons** are triangles for more efficient conversion. */
    all_triangles?: H.In<boolean>;
    /** Increase the threshold for detecting overlap and raycast hits. */
    epsilon?: H.In<number>;
  }): H.Ptr<P.mathutils_bvhtree.BVHTree>;
  /**
   * BVH tree based on :class:`BMesh` data.
   * @returns BVHTree from BMesh data.
   * @param bmesh BMesh data.
   */
  FromBMesh(bmesh: P.bmesh_types.BMesh, kw?: {
    /** Increase the threshold for detecting overlap and raycast hits. */
    epsilon?: H.In<number>;
  }): H.Ptr<P.mathutils_bvhtree.BVHTree>;
  /**
   * BVH tree based on :class:`BMesh` data.
   * @returns BVHTree from BMesh data.
   * @param bmesh BMesh data.
   */
  FromBMesh(kw: {
    /** BMesh data. */
    bmesh: P.bmesh_types.BMesh;
    /** Increase the threshold for detecting overlap and raycast hits. */
    epsilon?: H.In<number>;
  }): H.Ptr<P.mathutils_bvhtree.BVHTree>;
  /**
   * BVH tree based on :class:`Object` data.
   * @returns BVHTree from Object data.
   * @param object Mesh object.
   * @param depsgraph Depsgraph to use for evaluating the mesh.
   */
  FromObject(object: R.Object, depsgraph: R.Depsgraph, kw?: {
    /** Use mesh with deformations. */
    deform?: H.In<boolean>;
    /** Use modifiers cage. */
    cage?: H.In<boolean>;
    /** Increase the threshold for detecting overlap and raycast hits. */
    epsilon?: H.In<number>;
  }): H.Ptr<P.mathutils_bvhtree.BVHTree>;
  /**
   * BVH tree based on :class:`Object` data.
   * @returns BVHTree from Object data.
   * @param object Mesh object.
   * @param depsgraph Depsgraph to use for evaluating the mesh.
   */
  FromObject(kw: {
    /** Mesh object. */
    object: R.Object;
    /** Depsgraph to use for evaluating the mesh. */
    depsgraph: R.Depsgraph;
    /** Use mesh with deformations. */
    deform?: H.In<boolean>;
    /** Use modifiers cage. */
    cage?: H.In<boolean>;
    /** Increase the threshold for detecting overlap and raycast hits. */
    epsilon?: H.In<number>;
  }): H.Ptr<P.mathutils_bvhtree.BVHTree>;
}