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