voxcity.simulator_gpu.visibility.view.SurfaceViewFactorCalculator

class voxcity.simulator_gpu.visibility.view.SurfaceViewFactorCalculator(domain, n_azimuth: int = 120, n_elevation: int = 20, ray_sampling: str = 'grid', n_rays: int = None, precompute_directions: bool = True)

GPU-accelerated Surface View Factor calculator.

Computes view factors for building surface faces by tracing rays from face centers through the voxel domain.

This emulates voxcity.simulator.visibility.view.get_surface_view_factor using Taichi GPU acceleration.

domain
nx
ny
nz
dx
dy
dz
meshsize
n_azimuth = 120
n_elevation = 20
ray_sampling = 'grid'
n_rays
compute_surface_view_factor(face_centers: numpy.ndarray, face_normals: numpy.ndarray, voxel_data: numpy.ndarray = None, target_values: Tuple[int, Ellipsis] = (0,), inclusion_mode: bool = False, tree_k: float = 0.6, tree_lad: float = 1.0, boundary_epsilon: float = None, workspace=None) numpy.ndarray

Compute view factors for building surface faces.

Parameters:
  • face_centers – Array of face center positions (n_faces, 3) in world coords

  • face_normals – Array of face normal vectors (n_faces, 3)

  • voxel_data – 3D voxel class array

  • target_values – Target voxel values for visibility

  • inclusion_mode – If True, count hits on targets; if False, count unblocked rays

  • tree_k – Tree extinction coefficient

  • tree_lad – Leaf area density

  • boundary_epsilon – Epsilon for boundary detection

  • workspace – Optional pre-allocated SurfaceViewWorkspace whose Taichi fields are reused instead of allocating new ones on every call.

Returns:

1D array of view factor values for each face