Visualization API
The following provides utilities for visualization.
- lightplane.visualize_rays_plotly(rays: Rays, output_path: str | None = None, max_display_rays_per_grid: int = -1, ncols: int | None = None, ray_line_width: float = 1.0, ray_point_marker_size: float = 1.0, ray_pixel_colors: Tensor | None = None)[source]
Visualizes rays using plotly. The rays are visualized in a grid of subplots, where each subplot corresponds to a feature grid. The rays are visualized as lines and points, with the points (optionally) colored according to the provided pixel colors. The near and far points of the rays are also visualized as points. The resulting plotly figure can be saved as an html file using the output_path argument. The plotly figure can then be interactively explored in a web browser.
- Parameters:
rays – A Rays dataclass to visualize.
output_path – Optional path to save the plotly figure as an html file.
max_display_rays_per_grid – Maximum number of rays to display per feature grid.
ncols – Number of columns in the plot grid.
ray_line_width – Width of the plotted ray lines.
ray_point_marker_size – Size of the plotted ray points.
ray_pixel_colors – Optional tensor of shape (N, 3) containing RGB pixel colors. If provided, the ray points near the origin will be colored with these pixel colors. The pixel colors should be in the range [0, 1].
- Returns:
fig – The plotly figure.