Ray Tracer
Ray Tracer is an engine to trace the possible propagation paths from the scene.
- Initialization
- trace_outdoor
- direct_path
- trace_reflection
- trace_single_reflect
- trace_double_reflect
- trace_roof_edges
- is_outdoor
- terrain_height
- get_terrain_depth
Import
from radio_gyms.engines import Tracer
Initialization
inputs
- object_file_path: str, the .obj file path for tracing.
- ref_max: number, the maximum reflection bounce tracing.
Example
SCENE_PATH = "./my_map.obj"
tracer = Tracer(SCENE_PATH, 2)
trace_outdoor(tx_pos, rx_pos)
Trace the paths from the given transmitting point to the the given receiving point.
input
- tx_pos: Tuple[float,float,float], transmitting position.
- rx_pos: Tuple[float, float, flaot], receiving position.
output
- result, trace result object.
direct_path(tx_pos, rx_pos)
Check the given transmitting point and the given receiving point are in line-of-sight.
input
- tx_pos: Tuple[float, float, float], transmitting position
- rx_pos: Tuple[float, float, float], receiving position
output
- result: boolean, true if two given positions are line-of-sight.
trace_reflections(tx_pos, rx_pos)
Trace the reflection points between the given transmitting point and the given receiving point.
input
- tx_pos: Tuple[float, float, float], transmitting position.
- rx_pos: Tuple[float, float, float], receiving position.
output
- result: Object, reflection result object
trace_single_reflect(tx_pos, rx_pos)
Trace the single reflection points between the given transmitting point and the given receiving point.
input
- tx_pos: Tuple[float, float, float], transmitting position.
- rx_pos: Tuple[float, float, float], receiving position.
output
- result: List, list of single reflected points.
trace_double_reflect(tx_pos, rx_pos)
Trace the double reflection points between the given transmitting point and the given receiving point.
input
- tx_pos: Tuple[float, float, float], transmitting position
- rx_pos: Tuple[float, float, float], receiving position
output
- result: List, list of double reflected points
trace_roof_edges(tx_pos, rx_pos)
Trace the roof edges from the transmitting position to the receiving position. The top of positions must be an open sky. inputs
- tx_pos: Tuple[float, float, float], transmitting position.
- rx_pos: Tuple[float, float, float], receiving position. output
- result: List, list of roof edges.
is_outdoor(pos)
Check the given position is outdoor.
input
- pos: Tuple[float, float, float], position.
output
- result: boolean, indicate if the given position is outdoor.
terrain_height(x, z)
Provide the terrain height of the given position.
input
- x: float, x-coordinate point.
- z: float, z-coordinate point.
output
- y: float, height of the terrain.
get_terrain_depth(x_n, z_n)
Output the depth map of the scene terrain
input
- x_n: number, number of resolution on x-axis.
- z_n: number, number of resolution on z-axis.
output
- map: DataFrame, dataframe map of the depth map.