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.

4.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";

/** Generic 3-dimensional kd-tree to perform spatial searches. */
export interface Api {
  /** KDTree(size) -> new kd-tree initialized to hold up to ``size`` items. */
  readonly KDTree: KDTreeClass;
}

/**
 * KDTree(size) -> new kd-tree initialized to hold up to ``size`` items.
 *
 * .. note::
 *
 *    :meth:`KDTree.balance` must have been called before using any of the ``find`` methods.
 *
 * mathutils.kdtree.KDTree
 */
export interface KDTree {
  /**
   * Insert a point into the KDTree.
   * @param co Point 3d position.
   * @param index The index of the point (must be non-negative).
   */
  insert(co: H.In<readonly number[]>, index: H.In<number>): H.Ref<void>;
  /**
   * Insert a point into the KDTree.
   * @param co Point 3d position.
   * @param index The index of the point (must be non-negative).
   */
  insert(kw: {
    /** Point 3d position. */
    co: H.In<readonly number[]>;
    /** The index of the point (must be non-negative). */
    index: H.In<number>;
  }): H.Ref<void>;
  /**
   * Balance the tree.
   *
   * .. note::
   *
   *    This builds the entire tree, avoid calling after each insertion.
   */
  balance(...args: any[]): H.Ref<void>;
  /**
   * Find nearest point to ``co``.
   * @returns Returns (position, index, distance),
   * or (None, None, None) when no match is found.
   * @param co 3D coordinate.
   */
  find(co: H.In<readonly number[]>, kw?: {
    /** function which takes an index and returns True for indices to include in the search. */
    filter?: any;
  }): H.Ref<[M.Vector, number, number] | [null, null, null]>;
  /**
   * Find nearest point to ``co``.
   * @returns Returns (position, index, distance),
   * or (None, None, None) when no match is found.
   * @param co 3D coordinate.
   */
  find(kw: {
    /** 3D coordinate. */
    co: H.In<readonly number[]>;
    /** function which takes an index and returns True for indices to include in the search. */
    filter?: any;
  }): H.Ref<[M.Vector, number, number] | [null, null, null]>;
  /**
   * Find nearest ``n`` points to ``co``.
   * @returns Returns a list of tuples (position, index, distance).
   * @param co 3D coordinate.
   * @param n Number of points to find.
   */
  find_n(co: H.In<readonly number[]>, n: H.In<number>): H.Ref<[M.Vector, number, number][]>;
  /**
   * Find nearest ``n`` points to ``co``.
   * @returns Returns a list of tuples (position, index, distance).
   * @param co 3D coordinate.
   * @param n Number of points to find.
   */
  find_n(kw: {
    /** 3D coordinate. */
    co: H.In<readonly number[]>;
    /** Number of points to find. */
    n: H.In<number>;
  }): H.Ref<[M.Vector, number, number][]>;
  /**
   * Find all points within ``radius`` of ``co``.
   * @returns Returns a list of tuples (position, index, distance).
   * @param co 3D coordinate.
   * @param radius Maximum distance to search for points.
   */
  find_range(co: H.In<readonly number[]>, radius: H.In<number>): H.Ref<[M.Vector, number, number][]>;
  /**
   * Find all points within ``radius`` of ``co``.
   * @returns Returns a list of tuples (position, index, distance).
   * @param co 3D coordinate.
   * @param radius Maximum distance to search for points.
   */
  find_range(kw: {
    /** 3D coordinate. */
    co: H.In<readonly number[]>;
    /** Maximum distance to search for points. */
    radius: H.In<number>;
  }): H.Ref<[M.Vector, number, number][]>;
}
/** The class mathutils.kdtree.KDTree: called, a new one. */
export interface KDTreeClass {
  /**
   * KDTree(size) -> new kd-tree initialized to hold up to ``size`` items.
   *
   * .. note::
   *
   *    :meth:`KDTree.balance` must have been called before using any of the ``find`` methods.
   * @param size Maximum number of items.
   */
  (size: H.In<number>): H.Own<KDTree>;
  /**
   * KDTree(size) -> new kd-tree initialized to hold up to ``size`` items.
   *
   * .. note::
   *
   *    :meth:`KDTree.balance` must have been called before using any of the ``find`` methods.
   * @param size Maximum number of items.
   */
  (kw: {
    /** Maximum number of items. */
    size: H.In<number>;
  }): H.Own<KDTree>;
}