Python Package#

The ovspatialquery package calls the C library through ctypes. Each method that wraps a C function names it. The C reference states that function’s full contract, and a failed call raises ApiError carrying the C status. Importing the package does not load the native library. Library.open() loads it.

Library and instance#

class ovspatialquery.Library(
path: Path,
native: Any,
exports: dict[str, Any],
version: tuple[int, int, int],
dll_directory: Any | None,
)#

One qualified native artifact and its retained platform loader state.

classmethod open(
path: Path | str | None = None,
*,
require_explicit: bool = False,
require_ovstage: bool = False,
) → Library#

Calls ovspatialquery_get_version().

property closed: bool#
property has_ovstage: bool#
property has_explicit: bool#
require_explicit() → dict[str, Any]#
require_ovstage() → dict[str, Any]#
instance(config: Any = None) → Any#
close() → None#
exception ovspatialquery.LibraryLoadError#

The selected native artifact cannot satisfy the public interface.

class ovspatialquery.Instance(
library: Any,
handle: int,
keepalive: Iterable[Any] = (),
)#

Owns every object created through it. Closing it, or leaving its block, closes what is still open: operations (waiting for pending ones), plans and reporters (waiting for slots retired with close_after_cuda), views, populations, then geometry definitions, each newest first, and then destroys the instance. On a normal exit a failure raises. When the block raises, each failure is added to that exception as a note instead. Either way, an instance that is not destroyed is kept, with what it still owns, until a later close succeeds or the process exits.

classmethod create(
library: Any,
config: InstanceConfig = InstanceConfig(),
) → Instance#

Creates an independent instance with the exact capacities in config.

Calls ovspatialquery_create_instance().

property handle: int#
memory_usage(device: Any) → int#

Returns current instance-controlled bytes charged to one device budget.

Calls ovspatialquery_get_instance_memory_usage().

supports(
capability: Capability,
device: Device = Device(),
) → bool#

Whether this instance can use capability on device; it creates no object. The first question about a CUDA device for a capability the library knows tries to load the CUDA driver and start this library’s CUDA backend on it, even when the answer is False. A capability a newer package names and the loaded library does not know is False.

Calls ovspatialquery_query_capability().

create_raycast_plan(
config: RaycastPlanConfig,
) → RaycastPlan#

Creates a reusable raycast plan and reserves its fixed result slots.

create_sphere_sweep_plan(
config: SphereSweepPlanConfig,
) → SphereSweepPlan#

Creates a reusable sphere-sweep plan and reserves its fixed result slots.

create_box_sweep_plan(
config: BoxSweepPlanConfig,
) → BoxSweepPlan#

Creates a reusable box-sweep plan and reserves its fixed result slots.

create_overlap_plan(
config: OverlapPlanConfig,
) → OverlapPlan#

Creates a reusable overlap plan and reserves its fixed result slots.

create_pair_reporter(
config: PairReporterConfig,
) → PairReporter#

Creates an empty-baseline, forward-only AABB-pair reporter. Experimental: pair discovery may change in any minor release.

explicit() → Any#
query_pairs(
first: Target,
second: Target,
*,
capacity: int,
first_ordinal: OrdinalSelection = OrdinalSelection.head(),
second_ordinal: OrdinalSelection = OrdinalSelection.head(),
first_query_bits: int = 0,
second_query_bits: int = 0,
contact_tolerance: float = 0.0,
) → PairSnapshotResult#

Computes a stateless AABB-pair set between two selected immutable versions. Experimental: pair discovery may change in any minor release.

Calls ovspatialquery_query_pairs_sync().

ovstage(
ovstage_module: Any,
stage: Any,
) → Any#
close() → None#
exception ovspatialquery.ApiError(
operation: str,
status: ApiStatus,
detail: str = '',
)#
class ovspatialquery.InstanceConfig(
operation_capacity: 'int' = 8,
max_cpu_concurrency: 'int' = 2,
host_byte_budget: 'int' = 67108864,
device_budgets: 'tuple[DeviceBudget, ...]' = (),
)#
operation_capacity: int = 8#
max_cpu_concurrency: int = 2#
host_byte_budget: int = 67108864#
device_budgets: tuple[DeviceBudget, ...] = ()#
class ovspatialquery.DeviceBudget(device: 'Device', byte_budget: 'int')#
device: Device#
byte_budget: int#
class ovspatialquery.Device(device_type: 'int' = 1, device_id: 'int' = 0)#
device_type: int = 1#
device_id: int = 0#
classmethod cpu() → Device#
classmethod cuda(index: int = 0) → Device#

Populations, views and targets#

class ovspatialquery.PopulationConfig(
retained_ordinal_capacity: 'int' = 2,
pending_publication_capacity: 'int' = 1,
)#
retained_ordinal_capacity: int = 2#
pending_publication_capacity: int = 1#
class ovspatialquery.TargetRef(kind: 'raw.TargetKind', handle: 'int')#
kind: TargetKind#
handle: int#
select(
ordinal: OrdinalSelection | None = None,
) → QueryTarget#
class ovspatialquery.OrdinalSelection(
kind: 'raw.OrdinalSelectionKind',
source_ordinal: 'int' = 0,
)#
kind: OrdinalSelectionKind#
source_ordinal: int = 0#
classmethod head() → OrdinalSelection#
classmethod retained_exact(
source_ordinal: int,
) → OrdinalSelection#
classmethod admitted_exact(
source_ordinal: int,
) → OrdinalSelection#

A completed retained ordinal or a device-prepared publication still being prepared; CUDA plan launches only. Experimental: may change in any minor release.

class ovspatialquery.instance.Population(instance: Instance, handle: int)#
property handle: int#
property target: Target#
info() → PopulationInfo#

Reads current population state.

Calls ovspatialquery_get_population_info().

close() → None#

Destroys a population.

Calls ovspatialquery_destroy_population().

class ovspatialquery.instance.View(
instance: Instance,
handle: int,
keepalive: Iterable[Any] = (),
)#
property handle: int#
property target: Target#
close() → None#

Destroys a stable view.

Calls ovspatialquery_destroy_view().

class ovspatialquery.instance.Target(
instance: Instance,
reference: TargetRef,
)#
raycast_closest(
query: RaycastQuery,
) → RaycastResult#

Runs one raycast on the caller thread and returns the closest hit, if any.

Calls ovspatialquery_raycast_closest_sync().

raycast_any(
query: RaycastQuery,
) → RaycastResult#

Runs one raycast on the caller thread and returns any admitted hit, if any. It makes no closest-hit or stable-choice promise.

Calls ovspatialquery_raycast_any_sync().

raycast_multiple(
query: RaycastQuery,
capacity: SupportsIndex,
mesh_hits: MeshHits = raw.MeshHits.ALL,
) → MultipleResult#

Stores up to capacity hits; truncated says more existed.

A triangle mesh contributes one hit per triangle the ray crosses; mesh_hits=MeshHits.NEAREST keeps only each object’s nearest contact.

Calls ovspatialquery_raycast_multiple_sync().

overlap_multiple(
query: OverlapQuery,
capacity: SupportsIndex,
) → MultipleResult#

Stores up to capacity hits; truncated says more existed.

Calls ovspatialquery_overlap_multiple_sync().

overlap_any(
query: OverlapQuery,
) → OverlapResult#

Runs one overlap and returns any overlapping object, if one exists.

Calls ovspatialquery_overlap_any_sync().

sweep_sphere_closest(
query: SphereSweepQuery,
) → SphereSweepResult#

Runs one moving-sphere query and returns its closest hit, if any.

Calls ovspatialquery_sweep_sphere_closest_sync().

sweep_sphere_any(
query: SphereSweepQuery,
) → SphereSweepResult#

Returns a hit of any object the sphere reaches, if any; no closest promise.

Calls ovspatialquery_sweep_sphere_any_sync().

sweep_sphere_multiple(
query: SphereSweepQuery,
capacity: SupportsIndex,
) → MultipleResult#

Stores up to capacity hits, one per object reached; truncated says more existed.

Calls ovspatialquery_sweep_sphere_multiple_sync().

sweep_box_closest(
query: BoxSweepQuery,
) → BoxSweepResult#

Runs one fixed-orientation box sweep and returns its closest hit, if any.

Calls ovspatialquery_sweep_box_closest_sync().

sweep_box_any(
query: BoxSweepQuery,
) → BoxSweepResult#

Returns a hit of any object the box reaches, if any; no closest promise.

Calls ovspatialquery_sweep_box_any_sync().

sweep_box_multiple(
query: BoxSweepQuery,
capacity: SupportsIndex,
) → MultipleResult#

Stores up to capacity hits, one per object reached; truncated says more existed.

Calls ovspatialquery_sweep_box_multiple_sync().

class ovspatialquery.instance.Operation(
instance: Instance,
op_id: int,
*,
keepalive: Iterable[Any] = (),
name: str = 'operation',
cuda: bool = False,
owner: _SlotOwner | None = None,
)#

One enqueued operation. As a context manager, exit waits for it and closes it; a CUDA operation must be retired with close_after_cuda before the block ends, unless its plan keeps its results in host memory (BatchResultField.HOST_MAPPED).

property op_id: int#
wait(
timeout: int = raw.TIMEOUT_INFINITE,
) → OpState#

Waits until the operation is terminal or timeout expires and returns its state. timeout is an int number of nanoseconds; zero polls. When it expires first, returns OpState.PENDING. A timeout is not cancellation: the operation and all input-lifetime obligations remain live.

Calls ovspatialquery_wait_op().

status() → tuple[OpState, ApiStatus, float]#

Polls the operation state and approximate progress without consuming it.

Calls ovspatialquery_query_op_status().

finish(timeout: int = raw.TIMEOUT_INFINITE) → None#

Waits for work whose only output is completion, such as a registration or a publication, and closes the operation. If it failed, raises ApiError with its terminal status after closing it. If timeout expires first, raises ApiError with TIMEOUT and leaves the operation open.

Calls ovspatialquery_wait_op().

fetch_population_update() → PublicationResult#

Fetches the repeatable result of one successful population publication.

Calls ovspatialquery_fetch_population_update().

fetch_dropped_triangles() → dict[int, int]#

Fetches, for one successful ovstage publication, how many triangles without area each Mesh prim it read dropped, as object ID to count; Meshes that dropped none are absent.

Calls ovspatialquery_fetch_ovstage_dropped_triangles().

fetch_pair_reporter() → PairReporterResult#

Fetches repeatable entered/exited views and the typed advance outcome.

Calls ovspatialquery_fetch_pair_reporter().

fetch_raycast_batch() → RaycastBatchResult#

Fetches the repeatable terminal result views of one raycast-plan launch.

Calls ovspatialquery_fetch_raycast_batch().

fetch_sphere_sweep_batch() → SphereSweepBatchResult#

Fetches the repeatable terminal result views of one sphere-sweep launch.

Calls ovspatialquery_fetch_sphere_sweep_batch().

fetch_box_sweep_batch() → BoxSweepBatchResult#

Fetches repeatable terminal box-sweep contact columns.

Calls ovspatialquery_fetch_box_sweep_batch().

fetch_overlap_batch() → OverlapBatchResult#

Fetches the repeatable terminal result views of one overlap-plan launch.

Calls ovspatialquery_fetch_overlap_batch().

close() → None#

Destroys a terminal-observed CPU operation, a terminal-observed launch of a HOST_MAPPED CUDA plan whose columns no device work still reads, or one with no returned CUDA views. Raises BufferError while a DLPack export of its result columns is alive.

Calls ovspatialquery_destroy_op().

close_after_cuda(consumer_done: int) → None#

Retires a terminal-observed CUDA operation after its consumers, given one event that covers all of them. Raises BufferError while a DLPack export of its result columns is alive.

Calls ovspatialquery_destroy_op_after_cuda().

class ovspatialquery.types.PopulationInfo(
ready: 'bool',
head_ordinal: 'int | None',
object_count: 'int',
retained_ordinal_count: 'int',
update_pending: 'bool',
)#
ready: bool#
head_ordinal: int | None#
object_count: int#
retained_ordinal_count: int#
update_pending: bool#
class ovspatialquery.types.PublicationResult(
published_ordinal: int,
object_count: int,
excluded_object_count: int,
excluded_objects: array,
exclusion_reasons: array,
)#

Publication counts and owning copies of the complete sorted exclusion list.

excluded_objects is an array.array of uint64 object IDs and exclusion_reasons one of int32 reason codes, the source adapter’s enum values. Both remain readable after the operation closes and export the buffer protocol, so numpy.asarray views them without copying.

published_ordinal: int#
object_count: int#
excluded_object_count: int#
excluded_objects: array#
exclusion_reasons: array#

Explicit arrays#

Every column is any object with __dlpack__, such as a NumPy, PyTorch or CuPy array, passed as a keyword argument named as in the C tables.

class ovspatialquery.ExplicitAdapter(instance: Instance)#

Registers exact definitions from CPU DLPack columns named as in the definition tables of ovspatialquery_explicit.h. Without copy, the returned operation borrows each column until it is closed, and the caller must not write to it before then.

register_spheres(
*,
definition_values: Any,
radii: Any,
copy: bool = False,
) → Operation#

Captures and prepares an immutable batch of sphere definitions.

Calls ovspatialquery_enqueue_sphere_registration().

register_boxes(
*,
definition_values: Any,
half_extents: Any,
copy: bool = False,
) → Operation#

Captures and prepares an immutable batch of box definitions.

Calls ovspatialquery_enqueue_box_registration().

register_capsules(
*,
definition_values: Any,
radii: Any,
half_segments: Any,
copy: bool = False,
) → Operation#

Captures and prepares an immutable batch of capsule definitions.

Calls ovspatialquery_enqueue_capsule_registration().

register_convexes(
*,
definition_values: Any,
vertex_offsets: Any,
vertex_counts: Any,
vertices: Any,
face_offsets: Any = None,
face_counts: Any = None,
face_vertex_offsets: Any = None,
face_vertex_counts: Any = None,
face_vertex_indices: Any = None,
enclosure_tolerance: float = 0.0,
hull_vertex_limit: int = 0,
copy: bool = False,
) → Operation#

Captures and prepares immutable convex definitions. The five face columns describe source topology and come all together or not at all.

Both options apply to every definition in the call. hull_vertex_limit zero registers each definition’s own hull; 8 to 64 registers the hull PhysX cooks for a convexHull collider under that limit, whose corners need not be points and which may leave points outside. That hull is cooked from the vertices as given and placed afterwards by each instance’s pose and uniform_scales, as the simulation places a collider: register a stage’s collider from its local points in stage units and place it with the prim’s rotation, and its translation and uniform scale times the stage’s meters per unit, because vertices with the placement already applied can give another hull. enclosure_tolerance is how far outside the own hull, as a fraction of the largest half extent of the points’ box, a point may lie and still count as enclosed: zero is 2^-20, other values lie from 2^-20 to 2^-16.

Calls ovspatialquery_enqueue_convex_registration().

register_triangle_meshes(
*,
definition_values: Any,
vertex_offsets: Any,
vertex_counts: Any,
triangle_offsets: Any,
triangle_counts: Any,
vertices: Any,
triangle_indices: Any,
double_sided: Any = None,
source_face_material_ids: Any = None,
source_face_indices: Any = None,
source_face_corner_indices: Any = None,
copy: bool = False,
) → Operation#

Captures and prepares an immutable batch of triangle-mesh definitions. source_face_material_ids gives each triangle’s material; zero lets it report its instance’s material. source_face_indices and source_face_corner_indices, which come together, give each triangle the source face and the corners within it that its hits report; the triangles of one face then carry one material.

Calls ovspatialquery_enqueue_triangle_mesh_registration().

create_population(
config: PopulationConfig = PopulationConfig(),
) → ExplicitPopulation#

Creates a NOT_READY population with no head. Its first complete set may publish any nonnegative ordinal, including zero.

Calls ovspatialquery_create_explicit_population().

dropped_triangle_count(definition_value: int) → int#

How many triangles registration dropped from a registered triangle-mesh definition because they have no area (collinear or repeated corners); zero when none.

Calls ovspatialquery_get_dropped_triangle_count().

destroy_definition(
definition: GeometryDefinitionRef,
) → None#

Destroys one explicit geometry definition.

Calls ovspatialquery_destroy_geometry_definition().

class ovspatialquery.ExplicitPopulation(
adapter: ExplicitAdapter,
handle: int,
)#

Publishes instance rows from DLPack columns named as in ovspatialquery_explicit_instance_table_t, all on one device. CPU columns are captured on the host. CUDA columns require cuda_stream, which is forwarded to each column’s __dlpack__ and orders the library’s reads after the writes queued on it; an optional cuda_wait_event, recorded once the columns are written, also orders writes from other streams. The library prepares the version as preparation says; ON_DEVICE and ON_DEVICE_HOST_READABLE are experimental and may change in any minor release. Without copy, the returned operation borrows each column until it is closed, and the caller must not write to it before then. With copy, the library queues its copy of CUDA columns on cuda_stream before returning, so a write from another stream must wait for an event the caller records there afterwards.

enqueue_set(
target_ordinal: int,
*,
object_values: Any,
geometry_types: Any,
geometry_values: Any,
translations: Any,
rotations_xyzw: Any,
uniform_scales: Any = None,
participation_bits: Any = None,
material_ids: Any = None,
preparation: Preparation = Preparation.ON_HOST,
slot_capacity: int = 0,
cuda_stream: Any = None,
cuda_wait_event: Any = None,
copy: bool = False,
) → Operation#

slot_capacity is meaningful for device-prepared sets only: the distinct objects the population may hold over its life; zero means these rows.

Calls ovspatialquery_enqueue_explicit_population_set().

enqueue_update(
base_ordinal: int,
target_ordinal: int,
*,
kind: ExplicitUpdateKind = ExplicitUpdateKind.COMPLETE_ROWS,
object_values: Any,
translations: Any,
rotations_xyzw: Any,
geometry_types: Any = None,
geometry_values: Any = None,
uniform_scales: Any = None,
participation_bits: Any = None,
material_ids: Any = None,
removed_object_values: Any = None,
preparation: Preparation = Preparation.ON_HOST,
cuda_stream: Any = None,
cuda_wait_event: Any = None,
copy: bool = False,
) → Operation#

Captures changed and removed rows against the exact current head, or against the newest admitted device-prepared update. COMPLETE_ROWS rows carry both geometry columns; POSES rows carry neither, nor participation_bits, which POSES_AND_BITS rows require. material_ids belongs to COMPLETE_ROWS rows; poses rows keep each object’s material. None removes nothing.

Calls ovspatialquery_enqueue_explicit_population_update().

create_view(
object_ids: Any,
) → View#

Selects the objects named by a CPU uint64 column, which is copied during creation.

Calls ovspatialquery_create_explicit_view().

class ovspatialquery.GeometryDefinitionRef(geometry_type: 'GeometryType', value: 'int')#
geometry_type: GeometryType#
value: int#

ovstage source#

class ovspatialquery.OvstageAdapter(
instance: Instance,
ovstage_module: Any,
stage: Any,
)#
supports(
capability: Capability,
device: Device = Device(),
) → bool#

Instance.supports for populations of this stage: PREPARE_ON_DEVICE also needs the stage’s placement extension.

Calls ovspatialquery_query_ovstage_capability().

create_population(
filter: Any,
config: PopulationConfig = PopulationConfig(),
*,
include_paths: Iterable[int | str] = (),
exclude_paths: Iterable[int | str] = (),
) → OvstagePopulation#

Creates a NOT_READY population with no head and deep-copies the filter and the scope. The population holds the prims the filter selects within the scope: the nearest listed ancestor of a prim decides, an exclude wins at equal depth, and an empty include list stands for “/”. Each path is a prim path string or its int path value.

Calls ovspatialquery_create_ovstage_population().

class ovspatialquery.ovstage.OvstagePopulation(
adapter: OvstageAdapter,
handle: int,
)#
enqueue_set(
target_ordinal: int,
*,
preparation: Preparation = Preparation.ON_HOST,
device: Device | None = None,
cuda_stream: Any = None,
cuda_wait_event: Any = None,
) → Operation#

Captures one sealed source snapshot before successful admission returns. With preparation ON_DEVICE or ON_DEVICE_HOST_READABLE the version is prepared on the CUDA device: poses are read on the device on cuda_stream, behind cuda_wait_event when given. Device preparation is experimental and may change in any minor release.

Calls ovspatialquery_enqueue_ovstage_population_set(), ovspatialquery_enqueue_ovstage_population_set_with_execution().

enqueue_update(
base_ordinal: int,
target_ordinal: int,
*,
preparation: Preparation = Preparation.ON_HOST,
device: Device | None = None,
cuda_stream: Any = None,
cuda_wait_event: Any = None,
) → Operation#

Reacquires one complete target snapshot with the same synchronous capture as enqueue_set, prepared where preparation says.

Calls ovspatialquery_enqueue_ovstage_population_update(), ovspatialquery_enqueue_ovstage_population_update_with_execution().

create_view(
filter: Any,
*,
include_paths: Iterable[int | str] = (),
exclude_paths: Iterable[int | str] = (),
) → View#

Creates a filter view, narrowed by a path scope like create_population’s. It becomes ready on the next successful parent publication and then shares all parent versions and acceleration data.

Calls ovspatialquery_create_ovstage_view().

set_participation_map(
default_bits: int,
bits_by_path: Mapping[int | str, int],
) → None#

Give each listed prim path its bits and every other object default_bits. A key is a prim path string or its path token (an object ID’s value); bits are ints below 2**128.

Calls ovspatialquery_set_ovstage_participation_map().

clear_participation_map() → None#

Calls ovspatialquery_set_ovstage_participation_map().

exception ovspatialquery.ovstage.OvstageUnavailable#

The installed companion or source object cannot be qualified.

Synchronous queries#

class ovspatialquery.RaycastQuery(
origin: 'tuple[float,
float,
float]',
unit_direction: 'tuple[float,
float,
float]',
max_distance: 'float',
min_distance: 'float' = 0.0,
ordinal: 'OrdinalSelection' = OrdinalSelection(kind=<OrdinalSelectionKind.HEAD: 0>,
source_ordinal=0),
precision: 'QueryPrecision' = <QueryPrecision.EXACT: 1>,
query_bits: 'int' = 0,
contact_tolerance: 'float' = 0.0,
query_flags: 'QueryFlag' = <QueryFlag: 0>,
both_sides: 'bool' = False,
)#
origin: tuple[float, float, float]#
unit_direction: tuple[float, float, float]#
max_distance: float#
min_distance: float = 0.0#
ordinal: OrdinalSelection = OrdinalSelection(kind=<OrdinalSelectionKind.HEAD: 0>, source_ordinal=0)#
precision: QueryPrecision = 1#
query_bits: int = 0#
contact_tolerance: float = 0.0#
query_flags: QueryFlag = 0#
both_sides: bool = False#
class ovspatialquery.SphereSweepQuery(
center: 'tuple[float,
float,
float]',
radius: 'float',
unit_direction: 'tuple[float,
float,
float]',
max_distance: 'float',
min_distance: 'float' = 0.0,
ordinal: 'OrdinalSelection' = OrdinalSelection(kind=<OrdinalSelectionKind.HEAD: 0>,
source_ordinal=0),
precision: 'QueryPrecision' = <QueryPrecision.EXACT: 1>,
query_bits: 'int' = 0,
contact_tolerance: 'float' = 0.0,
query_flags: 'QueryFlag' = <QueryFlag: 0>,
both_sides: 'bool' = False,
)#
center: tuple[float, float, float]#
radius: float#
unit_direction: tuple[float, float, float]#
max_distance: float#
min_distance: float = 0.0#
ordinal: OrdinalSelection = OrdinalSelection(kind=<OrdinalSelectionKind.HEAD: 0>, source_ordinal=0)#
precision: QueryPrecision = 1#
query_bits: int = 0#
contact_tolerance: float = 0.0#
query_flags: QueryFlag = 0#
both_sides: bool = False#
class ovspatialquery.BoxSweepQuery(
center: 'tuple[float,
float,
float]',
half_extents: 'tuple[float,
float,
float]',
rotation_xyzw: 'tuple[float,
float,
float,
float]',
unit_direction: 'tuple[float,
float,
float]',
max_distance: 'float',
min_distance: 'float' = 0.0,
ordinal: 'OrdinalSelection' = OrdinalSelection(kind=<OrdinalSelectionKind.HEAD: 0>,
source_ordinal=0),
precision: 'QueryPrecision' = <QueryPrecision.EXACT: 1>,
query_bits: 'int' = 0,
contact_tolerance: 'float' = 0.0,
query_flags: 'QueryFlag' = <QueryFlag: 0>,
both_sides: 'bool' = False,
)#
center: tuple[float, float, float]#
half_extents: tuple[float, float, float]#
rotation_xyzw: tuple[float, float, float, float]#
unit_direction: tuple[float, float, float]#
max_distance: float#
min_distance: float = 0.0#
ordinal: OrdinalSelection = OrdinalSelection(kind=<OrdinalSelectionKind.HEAD: 0>, source_ordinal=0)#
precision: QueryPrecision = 1#
query_bits: int = 0#
contact_tolerance: float = 0.0#
query_flags: QueryFlag = 0#
both_sides: bool = False#
class ovspatialquery.OverlapQuery(
shape: 'Sphere | OrientedBox | Aabb',
ordinal: 'OrdinalSelection' = OrdinalSelection(kind=<OrdinalSelectionKind.HEAD: 0>,
source_ordinal=0),
precision: 'QueryPrecision' = <QueryPrecision.EXACT: 1>,
query_bits: 'int' = 0,
contact_tolerance: 'float' = 0.0,
)#
shape: Sphere | OrientedBox | Aabb#
ordinal: OrdinalSelection = OrdinalSelection(kind=<OrdinalSelectionKind.HEAD: 0>, source_ordinal=0)#
precision: QueryPrecision = 1#
query_bits: int = 0#
contact_tolerance: float = 0.0#
class ovspatialquery.Sphere(center: 'tuple[float, float, float]', radius: 'float')#
center: tuple[float, float, float]#
radius: float#
class ovspatialquery.OrientedBox(
center: 'tuple[float, float, float]',
rotation_xyzw: 'tuple[float, float, float, float]',
half_extents: 'tuple[float, float, float]',
)#
center: tuple[float, float, float]#
rotation_xyzw: tuple[float, float, float, float]#
half_extents: tuple[float, float, float]#
class ovspatialquery.Aabb(
minimum: 'tuple[float, float, float]',
maximum: 'tuple[float, float, float]',
)#
minimum: tuple[float, float, float]#
maximum: tuple[float, float, float]#
class ovspatialquery.types.RaycastResult(source_ordinal: 'int', hit: 'SceneHit | None')#
source_ordinal: int#
hit: SceneHit | None#
class ovspatialquery.types.SphereSweepResult(
source_ordinal: int,
hit: SceneHit | None,
)#

The one hit a closest or any sweep returns, if any.

source_ordinal: int#
hit: SceneHit | None#
class ovspatialquery.types.BoxSweepResult(source_ordinal: 'int', hit: 'SceneHit | None')#
class ovspatialquery.types.OverlapResult(source_ordinal: 'int', hit: 'SceneHit | None')#
source_ordinal: int#
hit: SceneHit | None#
class ovspatialquery.MultipleResult(
source_ordinal: int,
hits: tuple[SceneHit, ...],
truncated: bool,
)#

Every hit one multiple-hit query stored, in unspecified order.

source_ordinal: int#
hits: tuple[SceneHit, ...]#
truncated: bool#
class ovspatialquery.types.SceneHit(
object_id: int,
geometry_type: GeometryType,
geometry_value: int,
truth: HitTruth,
position: tuple[float, float, float] | None = None,
normal: tuple[float, float, float] | None = None,
distance: float | None = None,
source_face_index: int | None = None,
source_face_corner_indices: tuple[int, int, int] | None = None,
barycentrics: tuple[float, float, float] | None = None,
query_position: tuple[float, float, float] | None = None,
material_id: int = 0,
)#

One hit. position is the contact point on the object’s bounds or surface; a sweep also sets query_position, the moving shape’s center at that contact.

object_id: int#
geometry_type: GeometryType#
geometry_value: int#
truth: HitTruth#
position: tuple[float, float, float] | None = None#
normal: tuple[float, float, float] | None = None#
distance: float | None = None#
source_face_index: int | None = None#
source_face_corner_indices: tuple[int, int, int] | None = None#
barycentrics: tuple[float, float, float] | None = None#
query_position: tuple[float, float, float] | None = None#
material_id: int = 0#

The material the population assigns this hit’s surface; zero means none.

Batch plans#

class ovspatialquery.RaycastPlanConfig(
target: 'TargetRef',
hit_mode: 'HitMode',
maximum_query_count: 'int',
maximum_hits_per_query: 'int',
hit_capacity_per_slot: 'int',
precision: 'QueryPrecision' = <QueryPrecision.BOUNDS_CANDIDATE: 0>,
device: 'Device' = Device(device_type=1,
device_id=0),
result_slot_count: 'int' = 1,
result_fields: 'BatchResultField' = <BatchResultField: 0>,
contact_tolerance: 'float' = 0.0,
mesh_hits: 'MeshHits' = <MeshHits.ALL: 0>,
)#
target: TargetRef#
hit_mode: HitMode#
maximum_query_count: int#
maximum_hits_per_query: int#
hit_capacity_per_slot: int#
precision: QueryPrecision = 0#
device: Device = Device(device_type=1, device_id=0)#
result_slot_count: int = 1#
result_fields: BatchResultField = 0#
contact_tolerance: float = 0.0#
mesh_hits: MeshHits = 0#
class ovspatialquery.SphereSweepPlanConfig(
target: 'TargetRef',
radius: 'float',
maximum_query_count: 'int',
precision: 'QueryPrecision' = <QueryPrecision.BOUNDS_CANDIDATE: 0>,
device: 'Device' = Device(device_type=1,
device_id=0),
result_slot_count: 'int' = 1,
result_fields: 'BatchResultField' = <BatchResultField: 0>,
contact_tolerance: 'float' = 0.0,
hit_mode: 'HitMode' = <HitMode.CLOSEST: 0>,
maximum_hits_per_query: 'int' = 1,
hit_capacity_per_slot: 'int | None' = None,
)#
target: TargetRef#
radius: float#
maximum_query_count: int#
precision: QueryPrecision = 0#
device: Device = Device(device_type=1, device_id=0)#
result_slot_count: int = 1#
result_fields: BatchResultField = 0#
contact_tolerance: float = 0.0#
hit_mode: HitMode = 0#
maximum_hits_per_query: int = 1#
hit_capacity_per_slot: int | None = None#
class ovspatialquery.BoxSweepPlanConfig(
target: 'TargetRef',
half_extents: 'tuple[float,
float,
float]',
maximum_query_count: 'int',
precision: 'QueryPrecision' = <QueryPrecision.BOUNDS_CANDIDATE: 0>,
device: 'Device' = Device(device_type=1,
device_id=0),
result_slot_count: 'int' = 1,
result_fields: 'BatchResultField' = <BatchResultField: 0>,
contact_tolerance: 'float' = 0.0,
hit_mode: 'HitMode' = <HitMode.CLOSEST: 0>,
maximum_hits_per_query: 'int' = 1,
hit_capacity_per_slot: 'int | None' = None,
)#
target: TargetRef#
half_extents: tuple[float, float, float]#
maximum_query_count: int#
precision: QueryPrecision = 0#
device: Device = Device(device_type=1, device_id=0)#
result_slot_count: int = 1#
result_fields: BatchResultField = 0#
contact_tolerance: float = 0.0#
hit_mode: HitMode = 0#
maximum_hits_per_query: int = 1#
hit_capacity_per_slot: int | None = None#
class ovspatialquery.OverlapPlanConfig(
target: 'TargetRef',
shape: 'OverlapBatchShape',
hit_mode: 'HitMode',
maximum_query_count: 'int',
maximum_hits_per_query: 'int',
hit_capacity_per_slot: 'int',
precision: 'QueryPrecision' = <QueryPrecision.BOUNDS_CANDIDATE: 0>,
device: 'Device' = Device(device_type=1,
device_id=0),
result_slot_count: 'int' = 1,
result_fields: 'BatchResultField' = <BatchResultField: 0>,
contact_tolerance: 'float' = 0.0,
)#
target: TargetRef#
shape: OverlapBatchShape#
hit_mode: HitMode#
maximum_query_count: int#
maximum_hits_per_query: int#
hit_capacity_per_slot: int#
precision: QueryPrecision = 0#
device: Device = Device(device_type=1, device_id=0)#
result_slot_count: int = 1#
result_fields: BatchResultField = 0#
contact_tolerance: float = 0.0#
class ovspatialquery.OverlapBatchShape(
kind: OverlapShapeKind,
radius: float = 0.0,
half_extents: tuple[float, ...] = (0.0, 0.0, 0.0),
)#

Pose-free shape and default size every row of an overlap plan uses.

kind: OverlapShapeKind#
radius: float = 0.0#
half_extents: tuple[float, ...] = (0.0, 0.0, 0.0)#
classmethod sphere(
radius: float,
) → OverlapBatchShape#
classmethod box(
half_extents: Iterable[float],
) → OverlapBatchShape#
classmethod aabb(
half_extents: Iterable[float],
) → OverlapBatchShape#
class ovspatialquery.instance.RaycastPlan(
instance: Instance,
handle: int,
device: Device,
*,
host_mapped: bool = False,
)#

Calls ovspatialquery_create_raycast_plan(), ovspatialquery_enqueue_raycast_plan().

create_export = 'ovspatialquery_create_raycast_plan'#
enqueue_export = 'ovspatialquery_enqueue_raycast_plan'#
batch_type#

alias of RaycastBatch

columns: tuple[_Column, ...] = (_Column(name='origins', dtypes=((2, 64),), width=3, rows='Q'), _Column(name='unit_directions', dtypes=((2, 32),), width=3, rows='Q'), _Column(name='max_distances', dtypes=((2, 64),), width=None, rows='Q'), _Column(name='min_distances', dtypes=((2, 64),), width=None, rows='Q'), _Column(name='query_bits', dtypes=((1, 64),), width=2, rows='Q'), _Column(name='maximum_hits', dtypes=((1, 64),), width=None, rows='Q'))#
reservation_type#

alias of RaycastBatchReservation

reservation_projection#

alias of RaycastBatchReservation

enqueue(
*,
origins: Any,
unit_directions: Any,
max_distances: Any,
min_distances: Any = None,
query_bits: Any = None,
maximum_hits: Any = None,
query_flags: QueryFlag = QueryFlag(0),
both_sides: bool = False,
ordinal: OrdinalSelection = OrdinalSelection.head(),
cuda_stream: Any = None,
cuda_wait_event: Any = None,
copy: bool = False,
) → tuple[Operation, RaycastBatchReservation]#

Enqueues one launch of DLPack columns. Without copy, the operation borrows each column until it is closed, and the caller must not write to it before then.

query_flags applies to every row of the launch; both_sides=True adds QueryFlag.MESH_BOTH_SIDES. Rows that need different options go in separate launches.

close() → None#

Destroys an idle plan. BUSY means an operation still owns a result slot; a slot retired with close_after_cuda is waited for, up to 10 seconds.

classmethod create(
instance: Instance,
config: Any,
) → Any#
destroy_export = 'ovspatialquery_destroy_batch_plan'#
class ovspatialquery.instance.SphereSweepPlan(
instance: Instance,
handle: int,
device: Device,
*,
host_mapped: bool = False,
)#

Calls ovspatialquery_create_sphere_sweep_plan(), ovspatialquery_enqueue_sphere_sweep_plan().

create_export = 'ovspatialquery_create_sphere_sweep_plan'#
enqueue_export = 'ovspatialquery_enqueue_sphere_sweep_plan'#
batch_type#

alias of SphereSweepBatch

columns: tuple[_Column, ...] = (_Column(name='centers', dtypes=((2, 64),), width=3, rows='Q'), _Column(name='unit_directions', dtypes=((2, 32),), width=3, rows='Q'), _Column(name='max_distances', dtypes=((2, 64),), width=None, rows='Q'), _Column(name='radii', dtypes=((2, 64),), width=None, rows='Q'), _Column(name='min_distances', dtypes=((2, 64),), width=None, rows='Q'), _Column(name='query_bits', dtypes=((1, 64),), width=2, rows='Q'))#
reservation_type#

alias of SphereSweepBatchReservation

reservation_projection#

alias of SphereSweepBatchReservation

enqueue(
*,
centers: Any,
unit_directions: Any,
max_distances: Any,
radii: Any = None,
min_distances: Any = None,
query_bits: Any = None,
query_flags: QueryFlag = QueryFlag(0),
both_sides: bool = False,
ordinal: OrdinalSelection = OrdinalSelection.head(),
cuda_stream: Any = None,
cuda_wait_event: Any = None,
copy: bool = False,
) → tuple[Operation, SphereSweepBatchReservation]#

Enqueues one launch of DLPack columns; lifetimes, query_flags and both_sides follow RaycastPlan.enqueue.

close() → None#

Destroys an idle plan. BUSY means an operation still owns a result slot; a slot retired with close_after_cuda is waited for, up to 10 seconds.

classmethod create(
instance: Instance,
config: Any,
) → Any#
destroy_export = 'ovspatialquery_destroy_batch_plan'#
class ovspatialquery.instance.BoxSweepPlan(
instance: Instance,
handle: int,
device: Device,
*,
host_mapped: bool = False,
)#

Calls ovspatialquery_create_box_sweep_plan(), ovspatialquery_enqueue_box_sweep_plan().

create_export = 'ovspatialquery_create_box_sweep_plan'#
enqueue_export = 'ovspatialquery_enqueue_box_sweep_plan'#
batch_type#

alias of BoxSweepBatch

columns: tuple[_Column, ...] = (_Column(name='centers', dtypes=((2, 64),), width=3, rows='Q'), _Column(name='rotations_xyzw', dtypes=((2, 32),), width=4, rows='Q'), _Column(name='unit_directions', dtypes=((2, 32),), width=3, rows='Q'), _Column(name='max_distances', dtypes=((2, 64),), width=None, rows='Q'), _Column(name='half_extents', dtypes=((2, 64),), width=3, rows='Q'), _Column(name='min_distances', dtypes=((2, 64),), width=None, rows='Q'), _Column(name='query_bits', dtypes=((1, 64),), width=2, rows='Q'))#
reservation_type#

alias of SphereSweepBatchReservation

reservation_projection#

alias of BoxSweepBatchReservation

enqueue(
*,
centers: Any,
rotations_xyzw: Any,
unit_directions: Any,
max_distances: Any,
half_extents: Any = None,
min_distances: Any = None,
query_bits: Any = None,
query_flags: QueryFlag = QueryFlag(0),
both_sides: bool = False,
ordinal: OrdinalSelection = OrdinalSelection.head(),
cuda_stream: Any = None,
cuda_wait_event: Any = None,
copy: bool = False,
) → tuple[Operation, BoxSweepBatchReservation]#

Enqueues one launch of DLPack columns; lifetimes, query_flags and both_sides follow RaycastPlan.enqueue.

close() → None#

Destroys an idle plan. BUSY means an operation still owns a result slot; a slot retired with close_after_cuda is waited for, up to 10 seconds.

classmethod create(
instance: Instance,
config: Any,
) → Any#
destroy_export = 'ovspatialquery_destroy_batch_plan'#
class ovspatialquery.instance.OverlapPlan(
instance: Instance,
handle: int,
device: Device,
*,
host_mapped: bool = False,
)#

Calls ovspatialquery_create_overlap_plan(), ovspatialquery_enqueue_overlap_plan().

create_export = 'ovspatialquery_create_overlap_plan'#
enqueue_export = 'ovspatialquery_enqueue_overlap_plan'#
batch_type#

alias of OverlapBatch

columns: tuple[_Column, ...] = (_Column(name='translations', dtypes=((2, 64),), width=3, rows='Q'), _Column(name='rotations_xyzw', dtypes=((2, 32), (2, 64)), width=4, rows='Q'), _Column(name='half_extents', dtypes=((2, 64),), width=3, rows='Q'), _Column(name='radii', dtypes=((2, 64),), width=None, rows='Q'), _Column(name='maximum_hits', dtypes=((1, 64),), width=None, rows='Q'), _Column(name='query_bits', dtypes=((1, 64),), width=2, rows='Q'))#
reservation_type#

alias of OverlapBatchReservation

reservation_projection#

alias of OverlapBatchReservation

enqueue(
*,
translations: Any,
rotations_xyzw: Any = None,
half_extents: Any = None,
radii: Any = None,
maximum_hits: Any = None,
query_bits: Any = None,
ordinal: OrdinalSelection = OrdinalSelection.head(),
cuda_stream: Any = None,
cuda_wait_event: Any = None,
copy: bool = False,
) → tuple[Operation, OverlapBatchReservation]#

Enqueues one launch of DLPack columns; lifetimes follow RaycastPlan.enqueue.

close() → None#

Destroys an idle plan. BUSY means an operation still owns a result slot; a slot retired with close_after_cuda is waited for, up to 10 seconds.

classmethod create(
instance: Instance,
config: Any,
) → Any#
destroy_export = 'ovspatialquery_destroy_batch_plan'#
class ovspatialquery.types.RaycastBatchReservation(
common: 'BatchResultCommon',
hit_ranges: 'BatchHitRanges',
object_ids: 'TensorView',
geometry: 'GeometryIdentityColumns | None',
candidate: 'RaycastCandidateColumns | None',
exact: 'RaycastExactColumns | None',
material_ids: 'TensorView | None' = None,
)#
common: BatchResultCommon#
hit_ranges: BatchHitRanges#
object_ids: TensorView#
geometry: GeometryIdentityColumns | None#
candidate: RaycastCandidateColumns | None#
exact: RaycastExactColumns | None#
material_ids: TensorView | None = None#
class ovspatialquery.types.RaycastBatchResult(
common: 'BatchResultCommon',
hit_ranges: 'BatchHitRanges',
object_ids: 'TensorView',
geometry: 'GeometryIdentityColumns | None',
candidate: 'RaycastCandidateColumns | None',
exact: 'RaycastExactColumns | None',
material_ids: 'TensorView | None' = None,
)#
common: BatchResultCommon#
hit_ranges: BatchHitRanges#
object_ids: TensorView#
geometry: GeometryIdentityColumns | None#
candidate: RaycastCandidateColumns | None#
exact: RaycastExactColumns | None#
material_ids: TensorView | None = None#
class ovspatialquery.types.SphereSweepBatchReservation(
common: 'BatchResultCommon',
hit_ranges: 'BatchHitRanges',
object_ids: 'TensorView',
geometry: 'GeometryIdentityColumns | None',
candidate: 'SphereSweepCandidateColumns | None',
exact: 'SphereSweepExactColumns | None',
material_ids: 'TensorView | None' = None,
)#
common: BatchResultCommon#
hit_ranges: BatchHitRanges#
object_ids: TensorView#
geometry: GeometryIdentityColumns | None#
candidate: SphereSweepCandidateColumns | None#
exact: SphereSweepExactColumns | None#
material_ids: TensorView | None = None#
class ovspatialquery.types.SphereSweepBatchResult(
common: 'BatchResultCommon',
hit_ranges: 'BatchHitRanges',
object_ids: 'TensorView',
geometry: 'GeometryIdentityColumns | None',
candidate: 'SphereSweepCandidateColumns | None',
exact: 'SphereSweepExactColumns | None',
material_ids: 'TensorView | None' = None,
)#
common: BatchResultCommon#
hit_ranges: BatchHitRanges#
object_ids: TensorView#
geometry: GeometryIdentityColumns | None#
candidate: SphereSweepCandidateColumns | None#
exact: SphereSweepExactColumns | None#
material_ids: TensorView | None = None#
class ovspatialquery.types.BoxSweepBatchReservation(
common: 'BatchResultCommon',
hit_ranges: 'BatchHitRanges',
object_ids: 'TensorView',
geometry: 'GeometryIdentityColumns | None',
candidate: 'SphereSweepCandidateColumns | None',
exact: 'SphereSweepExactColumns | None',
material_ids: 'TensorView | None' = None,
)#
class ovspatialquery.types.BoxSweepBatchResult(
common: 'BatchResultCommon',
hit_ranges: 'BatchHitRanges',
object_ids: 'TensorView',
geometry: 'GeometryIdentityColumns | None',
candidate: 'SphereSweepCandidateColumns | None',
exact: 'SphereSweepExactColumns | None',
material_ids: 'TensorView | None' = None,
)#
class ovspatialquery.types.OverlapBatchReservation(
common: 'BatchResultCommon',
hit_ranges: 'BatchHitRanges',
object_ids: 'TensorView',
geometry: 'GeometryIdentityColumns | None',
material_ids: 'TensorView | None' = None,
)#
common: BatchResultCommon#
hit_ranges: BatchHitRanges#
object_ids: TensorView#
geometry: GeometryIdentityColumns | None#
material_ids: TensorView | None = None#
class ovspatialquery.types.OverlapBatchResult(
common: 'BatchResultCommon',
hit_ranges: 'BatchHitRanges',
object_ids: 'TensorView',
geometry: 'GeometryIdentityColumns | None',
material_ids: 'TensorView | None' = None,
)#
common: BatchResultCommon#
hit_ranges: BatchHitRanges#
object_ids: TensorView#
geometry: GeometryIdentityColumns | None#
material_ids: TensorView | None = None#
class ovspatialquery.types.BatchResultCommon(
result_slot: 'int',
query_count: 'int',
hit_capacity: 'int',
truth: 'HitTruth',
source_ordinal: 'int',
execution_device: 'Device',
result_ready: 'int',
)#
result_slot: int#
query_count: int#
hit_capacity: int#
truth: HitTruth#
source_ordinal: int#
execution_device: Device#
result_ready: int#
class ovspatialquery.types.BatchHitRanges(
query_status: 'TensorView',
stored_hit_count: 'TensorView',
hit_offsets: 'TensorView',
hit_counts: 'TensorView',
truncated: 'TensorView',
)#
query_status: TensorView#
stored_hit_count: TensorView#
hit_offsets: TensorView#
hit_counts: TensorView#
truncated: TensorView#
class ovspatialquery.types.GeometryIdentityColumns(types: 'TensorView', values: 'TensorView')#
types: TensorView#
values: TensorView#
classmethod optional_from_raw(
value: GeometryIdentityColumns,
*,
_owner: _ResultExports | None = None,
) → GeometryIdentityColumns | None#
class ovspatialquery.types.ExactFeatureColumns(
kinds: 'TensorView',
source_face_indices: 'TensorView',
source_corner_indices: 'TensorView',
barycentrics: 'TensorView',
)#
kinds: TensorView#
source_face_indices: TensorView#
source_corner_indices: TensorView#
barycentrics: TensorView#
classmethod optional_from_raw(
value: ExactFeatureColumns,
*,
_owner: _ResultExports | None = None,
) → ExactFeatureColumns | None#
triangle_payload_for(
kind: GeometryFeatureKind,
) → tuple[TensorView, TensorView, TensorView] | None#
class ovspatialquery.types.RaycastCandidateColumns(
bounds_positions: 'TensorView | None',
bounds_normals: 'TensorView | None',
distances: 'TensorView | None',
)#
bounds_positions: TensorView | None#
bounds_normals: TensorView | None#
distances: TensorView | None#
class ovspatialquery.types.RaycastExactColumns(
positions: 'TensorView | None',
normals: 'TensorView | None',
distances: 'TensorView | None',
features: 'ExactFeatureColumns | None',
)#
positions: TensorView | None#
normals: TensorView | None#
distances: TensorView | None#
features: ExactFeatureColumns | None#
class ovspatialquery.types.SphereSweepCandidateColumns(
bounds_positions: 'TensorView | None',
bounds_normals: 'TensorView | None',
query_positions: 'TensorView | None',
distances: 'TensorView | None',
)#
bounds_positions: TensorView | None#
bounds_normals: TensorView | None#
query_positions: TensorView | None#
distances: TensorView | None#
class ovspatialquery.types.SphereSweepExactColumns(
positions: 'TensorView | None',
normals: 'TensorView | None',
query_positions: 'TensorView | None',
distances: 'TensorView | None',
features: 'ExactFeatureColumns | None',
)#
positions: TensorView | None#
normals: TensorView | None#
query_positions: TensorView | None#
distances: TensorView | None#
features: ExactFeatureColumns | None#
class ovspatialquery.types.TensorView(
data: int,
device: Device,
ndim: int,
dtype: DataType,
shape: tuple[int, ...],
strides: tuple[int, ...] | None,
byte_offset: int,
_owner: _ResultExports | None = None,
)#

One result column. Views an Operation returns are DLPack producers: pass one to numpy.from_dlpack, torch.from_dlpack or cupy.from_dlpack to read it without copying. The consumer borrows operation-owned, read-only storage: Operation.close and close_after_cuda raise BufferError while an export is alive, and an export after the operation is destroyed raises too. Copy what must outlive the operation; a CPU or HOST_MAPPED result’s to_numpy() copies every column at once.

data: int#
device: Device#
ndim: int#
dtype: DataType#
shape: tuple[int, ...]#
strides: tuple[int, ...] | None#
byte_offset: int#
classmethod optional_from_raw(
value: DLTensor,
*,
_owner: _ResultExports | None = None,
) → TensorView | None#
class ovspatialquery.types.DataType(code: 'int', bits: 'int', lanes: 'int')#
code: int#
bits: int#
lanes: int#

Pairs#

class ovspatialquery.PairReporterConfig(
first: 'TargetRef',
second: 'TargetRef',
active_pair_capacity: 'int',
delta_pair_capacity: 'int',
first_query_bits: 'int' = 0,
second_query_bits: 'int' = 0,
result_slot_count: 'int' = 1,
contact_tolerance: 'float' = 0.0,
result_device: 'Device' = Device(device_type=1, device_id=0),
)#
first: TargetRef#
second: TargetRef#
active_pair_capacity: int#
delta_pair_capacity: int#
first_query_bits: int = 0#
second_query_bits: int = 0#
result_slot_count: int = 1#
contact_tolerance: float = 0.0#
result_device: Device = Device(device_type=1, device_id=0)#
class ovspatialquery.instance.PairReporter(
instance: Instance,
handle: int,
result_device: Device = Device(),
)#

Forward-only AABB-pair reporter. Experimental: may change in any minor release.

destroy_export = 'ovspatialquery_destroy_pair_reporter'#
classmethod create(
instance: Instance,
config: PairReporterConfig,
) → PairReporter#

Creates an empty-baseline, forward-only AABB-pair reporter.

Calls ovspatialquery_create_pair_reporter().

advance(
first: OrdinalSelection = OrdinalSelection.head(),
second: OrdinalSelection = OrdinalSelection.head(),
) → tuple[Operation, PairReporterReservation]#

Admits one forward advance of the reporter.

Calls ovspatialquery_enqueue_pair_reporter_advance().

close() → None#

Destroys an idle reporter. BUSY means an advance operation is still live; a slot retired with close_after_cuda is waited for, up to 10 seconds.

class ovspatialquery.types.PairSnapshotResult(
first_source_ordinal: 'int',
second_source_ordinal: 'int',
rows: 'tuple[tuple[int, int], ...]',
truncated: 'bool',
)#
first_source_ordinal: int#
second_source_ordinal: int#
rows: tuple[tuple[int, int], ...]#
truncated: bool#
class ovspatialquery.types.PairReporterReservation(
result_slot: 'int',
result_device: 'Device',
delta_pair_capacity: 'int',
result_ready: 'int',
entered_pairs: 'TensorView | None',
exited_pairs: 'TensorView | None',
counts: 'TensorView | None',
)#
result_slot: int#
result_device: Device#
delta_pair_capacity: int#
result_ready: int#
entered_pairs: TensorView | None#
exited_pairs: TensorView | None#
counts: TensorView | None#
class ovspatialquery.types.PairReporterResult(
result_slot: 'int',
outcome: 'PairReporterOutcome',
first_source_ordinal: 'int',
second_source_ordinal: 'int',
accepted_active_pair_count: 'int',
result_ready: 'int',
entered_pairs: 'TensorView',
exited_pairs: 'TensorView',
)#
result_slot: int#
outcome: PairReporterOutcome#
first_source_ordinal: int#
second_source_ordinal: int#
accepted_active_pair_count: int#
result_ready: int#
entered_pairs: TensorView#
exited_pairs: TensorView#

C enumerations#

The enumerations a caller passes or reads are top-level names of the package. They carry the C enumerator names without their common prefix; the C reference documents each one.

class ovspatialquery.ApiStatus(*values)#

C enumeration: ovspatialquery_api_status_t.

SUCCESS = 0#
ERROR = 1#
TIMEOUT = 2#
INVALID_ARGUMENT = 3#
INVALID_HANDLE = 4#
INVALID_STATE = 5#
NOT_SUPPORTED = 6#
NOT_READY = 7#
BUSY = 8#
STALE_ORDINAL = 9#
ORDINAL_MISMATCH = 10#
ORDINAL_NOT_RETAINED = 11#
BACKWARD_ORDINAL = 12#
OPERATION_CAPACITY = 13#
RESULT_CAPACITY = 14#
HOST_BUDGET = 15#
DEVICE_BUDGET = 16#
OPERATION_FAILED = 17#
OUT_OF_MEMORY = 18#
INTERNAL = 19#
DEVICE_LOST = 20#
class ovspatialquery.OpState(*values)#

C enumeration: ovspatialquery_op_state_t.

PENDING = 0#
COMPLETED = 1#
FAILURE = 2#
class ovspatialquery.GeometryType(*values)#

C enumeration: ovspatialquery_geometry_type_t.

INVALID = 0#
SPHERE = 2#
BOX = 3#
CAPSULE = 4#
CONVEX = 5#
TRIANGLE_MESH = 6#
class ovspatialquery.QueryPrecision(*values)#

C enumeration: ovspatialquery_query_precision_t.

BOUNDS_CANDIDATE = 0#
EXACT = 1#
EXACT_SINGLE = 2#
class ovspatialquery.HitTruth(*values)#

C enumeration: ovspatialquery_hit_truth_t.

BOUNDS_CANDIDATE = 0#
EXACT_SURFACE = 1#
class ovspatialquery.GeometryFeatureKind(*values)#

C enumeration: ovspatialquery_geometry_feature_kind_t.

NONE = 0#
TRIANGLE = 1#
class ovspatialquery.OverlapShapeKind(*values)#

C enumeration: ovspatialquery_overlap_shape_kind_t.

SPHERE = 0#
BOX = 1#
AABB = 2#
class ovspatialquery.HitMode(*values)#

C enumeration: ovspatialquery_hit_mode_t.

CLOSEST = 0#
ANY = 1#
MULTIPLE = 2#
class ovspatialquery.BatchRowStatus(*values)#

C enumeration: ovspatialquery_batch_row_status_t.

SUCCESS = 0#
INVALID_ARGUMENT = 1#
NOT_SUPPORTED = 2#
FAILED = 3#
class ovspatialquery.BatchResultField(*values)#

C enumeration: ovspatialquery_batch_result_field_t.

POSITION = 1#
NORMAL = 2#
DISTANCE = 4#
SOURCE_FEATURE = 8#
GEOMETRY_IDENTITY = 16#
QUERY_POSITION = 32#
MATERIAL = 64#
HOST_MAPPED = 128#
class ovspatialquery.PairReporterOutcome(*values)#

C enumeration: ovspatialquery_pair_reporter_outcome_t.

ADVANCED = 0#
ACTIVE_CAPACITY = 1#
DELTA_CAPACITY = 2#
FAILED = 3#
class ovspatialquery.OvstageExclusionReason(*values)#

C enumeration: ovspatialquery_ovstage_exclusion_reason_t.

NO_SPATIAL_SOURCE = 1#
UNSUPPORTED_TYPE = 2#
UNSUPPORTED_SHAPE = 3#
MALFORMED_GEOMETRY = 4#
RESHAPE_PENDING = 5#
class ovspatialquery.Preparation(*values)#

C enumeration: ovspatialquery_preparation_t.

ON_HOST = 0#
ON_DEVICE = 1#
ON_DEVICE_HOST_READABLE = 2#
class ovspatialquery.ExplicitUpdateKind(*values)#

C enumeration: ovspatialquery_explicit_update_kind_t.

COMPLETE_ROWS = 0#
POSES = 1#
POSES_AND_BITS = 2#

ovspatialquery.raw mirrors every C declaration as ctypes structures and enumerations, for callers that call the C exports themselves.

ovspatialquery.raw.TIMEOUT_INFINITE: Final#

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

class ovspatialquery.raw.InputOwnership(*values)#

C enumeration: ovspatialquery_input_ownership_t.

BORROWED_UNTIL_TERMINAL = 0#
COPIED_ON_SUBMISSION = 1#
class ovspatialquery.raw.TargetKind(*values)#

C enumeration: ovspatialquery_target_kind_t.

POPULATION = 0#
VIEW = 1#
class ovspatialquery.raw.OrdinalSelectionKind(*values)#

C enumeration: ovspatialquery_ordinal_selection_kind_t.

HEAD = 0#
RETAINED_EXACT = 1#
ADMITTED_EXACT = 2#