triro 1.3.0
A Python Ray-Mesh Intersector in OptiX
Loading...
Searching...
No Matches
ops Namespace Reference

Functions

 get_module ()
 
 init_optix ()
 
 create_optix_context ()
 
 create_optix_module ()
 
 create_optix_pipelines ()
 
 build_sbts ()
 
Bool[torch.Tensor, "*b"] intersects_any (OptixAccelStructureWrapper accel_structure, Float32[torch.Tensor, "*b 3"] origins, Float32[torch.Tensor, "*b 3"] dirs)
 
Int32[torch.Tensor, "*b"] intersects_first (OptixAccelStructureWrapper accel_structure, Float32[torch.Tensor, "*b 3"] origins, Float32[torch.Tensor, "*b 3"] dirs)
 
Tuple[ Bool[torch.Tensor, "*b"], # hit Bool[torch.Tensor, "*b"], # front Int32[torch.Tensor, "*b"], # triangle index Float32[torch.Tensor, "*b 3"], # intersect location Float32[torch.Tensor, "*b 2"], # uv] intersects_closest (OptixAccelStructureWrapper accel_structure, Float32[torch.Tensor, "*b 3"] origins, Float32[torch.Tensor, "*b 3"] dirs)
 
Int32[torch.Tensor, "*b"] intersects_count (OptixAccelStructureWrapper accel_structure, Float32[torch.Tensor, "*b 3"] origins, Float32[torch.Tensor, "*b 3"] dirs)
 
Tuple[ Float32[torch.Tensor, "h 3"], Int32[torch.Tensor, "h"], Int32[torch.Tensor, "h"]] intersects_location (OptixAccelStructureWrapper accel_structure, Float32[torch.Tensor, "*b 3"] origins, Float32[torch.Tensor, "*b 3"] dirs)
 

Variables

 triro_module = None
 

Function Documentation

◆ build_sbts()

ops.build_sbts ( )
Build the SBTs (Shader Binding Tables).

Definition at line 77 of file ops.py.

◆ create_optix_context()

ops.create_optix_context ( )
Create an OptiX context.

Definition at line 56 of file ops.py.

◆ create_optix_module()

ops.create_optix_module ( )
Create an OptiX module.

Definition at line 63 of file ops.py.

◆ create_optix_pipelines()

ops.create_optix_pipelines ( )
Create OptiX pipelines.

Definition at line 70 of file ops.py.

◆ get_module()

ops.get_module ( )
Get the triro module by compiling it if necessary and importing it.

Returns:
    The triro module.

Definition at line 12 of file ops.py.

◆ init_optix()

ops.init_optix ( )
Initialize OptiX.

Definition at line 49 of file ops.py.

◆ intersects_any()

Bool[torch.Tensor, "*b"] ops.intersects_any ( OptixAccelStructureWrapper  accel_structure,
Float32[torch.Tensor, "*b 3"]  origins,
Float32[torch.Tensor, "*b 3"]  dirs 
)
Check if any ray intersects with the acceleration structure.

Args:
    accel_structure: The acceleration structure.
    origins: The origins of the rays.
    dirs: The directions of the rays.

Returns:
    A boolean tensor indicating if each ray intersects with the acceleration structure.

Definition at line 84 of file ops.py.

◆ intersects_closest()

Tuple[ Bool[torch.Tensor, "*b"], # hit Bool[torch.Tensor, "*b"], # front Int32[torch.Tensor, "*b"], # triangle index Float32[torch.Tensor, "*b 3"], # intersect location Float32[torch.Tensor, "*b 2"], # uv ] ops.intersects_closest ( OptixAccelStructureWrapper  accel_structure,
Float32[torch.Tensor, "*b 3"]  origins,
Float32[torch.Tensor, "*b 3"]  dirs 
)
Find the closest intersection for each ray.

Args:
    accel_structure: The acceleration structure.
    origins: The origins of the rays.
    dirs: The directions of the rays.

Returns:
    A tuple containing the following tensors:
    - A boolean tensor indicating if each ray hits an object.
    - A boolean tensor indicating if each ray hits the front face of an object.
    - An integer tensor indicating the index of the triangle that each ray intersects with.
    - A float tensor indicating the location of the intersection for each ray.
    - A float tensor indicating the UV coordinates of the intersection for each ray.

Definition at line 122 of file ops.py.

◆ intersects_count()

Int32[torch.Tensor, "*b"] ops.intersects_count ( OptixAccelStructureWrapper  accel_structure,
Float32[torch.Tensor, "*b 3"]  origins,
Float32[torch.Tensor, "*b 3"]  dirs 
)
Count the number of intersections for each ray.

Args:
    accel_structure: The acceleration structure.
    origins: The origins of the rays.
    dirs: The directions of the rays.

Returns:
    An integer tensor indicating the number of intersections for each ray.

Definition at line 152 of file ops.py.

◆ intersects_first()

Int32[torch.Tensor, "*b"] ops.intersects_first ( OptixAccelStructureWrapper  accel_structure,
Float32[torch.Tensor, "*b 3"]  origins,
Float32[torch.Tensor, "*b 3"]  dirs 
)
Find the index of the first intersection for each ray.

Args:
    accel_structure: The acceleration structure.
    origins: The origins of the rays.
    dirs: The directions of the rays.

Returns:
    An integer tensor indicating the index of the first intersection for each ray.

Definition at line 103 of file ops.py.

◆ intersects_location()

Tuple[ Float32[torch.Tensor, "h 3"], Int32[torch.Tensor, "h"], Int32[torch.Tensor, "h"] ] ops.intersects_location ( OptixAccelStructureWrapper  accel_structure,
Float32[torch.Tensor, "*b 3"]  origins,
Float32[torch.Tensor, "*b 3"]  dirs 
)
Find the location of intersections for each ray.

Args:
    accel_structure: The acceleration structure.
    origins: The origins of the rays.
    dirs: The directions of the rays.

Returns:
    A tuple containing the following tensors:
    - A float tensor indicating the location of the intersection for each ray.
    - The index of the ray that had the intersection.
    - An integer tensor indicating the index of the instance that each ray intersects with.

Definition at line 171 of file ops.py.

Variable Documentation

◆ triro_module

ops.triro_module = None

Definition at line 9 of file ops.py.