voxcity.visualizer.PyVistaRendererΒΆ

class voxcity.visualizer.PyVistaRendererΒΆ

Renderer that uses PyVista to produce multi-view images from meshes or VoxCity.

render_city(city: voxcity.models.VoxCity, projection_type: str = 'perspective', distance_factor: float = 1.0, output_directory: str = 'output', voxel_color_map: str | dict = 'default', *, rotation: bool = False, rotation_frames_per_segment: int = 60, rotation_close_loop: bool = False, rotation_file_prefix: str = 'city_rotation', image_size: tuple[int, int] | None = None, fixed_scene_bounds_real: tuple[tuple[float, float, float], tuple[float, float, float]] | None = None, building_sim_mesh=None, building_value_name: str = 'svf_values', building_colormap: str = 'viridis', building_vmin=None, building_vmax=None, building_nan_color: str = 'gray', building_opacity: float = 1.0, render_voxel_buildings: bool = False, ground_sim_grid=None, ground_dem_grid=None, ground_z_offset: float | None = None, ground_view_point_height: float | None = None, ground_colormap: str = 'viridis', ground_vmin=None, ground_vmax=None)ΒΆ

Render city to static images with optional simulation overlays.

Parameters:
  • city (VoxCity) – VoxCity object to render

  • projection_type (str) – β€œperspective” or β€œorthographic”

  • distance_factor (float) – Camera distance multiplier

  • output_directory (str) – Directory to save rendered images

  • voxel_color_map (str or dict) – Color mapping for voxel classes

  • rotation (bool) – If True, generate rotating isometric frames instead of multi-view snapshots.

  • rotation_frames_per_segment (int) – Number of frames between each isometric anchor when rotation=True.

  • rotation_close_loop (bool) – If True, returns smoothly to the starting anchor when rotation=True.

  • rotation_file_prefix (str) – Filename prefix for rotation frames when rotation=True.

  • image_size ((int, int) or None) – Static rendering output image size (width, height). If None, uses default.

  • building_sim_mesh (trimesh.Trimesh, optional) – Building mesh with simulation results

  • building_value_name (str) – Metadata key for building values

  • building_colormap (str) – Colormap for building values

  • building_vmin (float, optional) – Color scale limits for buildings

  • building_vmax (float, optional) – Color scale limits for buildings

  • building_nan_color (str) – Color for NaN values

  • building_opacity (float) – Building mesh opacity

  • render_voxel_buildings (bool) – Whether to render voxel buildings when building_sim_mesh is provided

  • ground_sim_grid (np.ndarray, optional) – Ground-level simulation grid

  • ground_dem_grid (np.ndarray, optional) – DEM grid for ground surface positioning

  • ground_z_offset (float, optional) – Height offset for ground surface

  • ground_view_point_height (float, optional) – Alternative height parameter

  • ground_colormap (str) – Colormap for ground values

  • ground_vmin (float, optional) – Color scale limits for ground

  • ground_vmax (float, optional) – Color scale limits for ground