voxcity.utils.shapeยถ
Functionsยถ
|
Return a new VoxCity with arrays padded/cropped to target (x, y, z). |
Module Contentsยถ
- voxcity.utils.shape.normalize_voxcity_shape(city: voxcity.models.VoxCity, target_shape: Tuple[int, int, int], *, align_xy: str = 'center', pad_values: Dict[str, Any] | None = None, allow_crop_xy: bool = True, allow_crop_z: bool = False) voxcity.models.VoxCity[source]ยถ
Return a new VoxCity with arrays padded/cropped to target (x, y, z).
XY alignment can be โcenterโ (default) or โtop-leftโ.
Z padding is added at the TOP to preserve ground level at z=0.
By default, Z is never cropped (allow_crop_z=False). If target z is smaller than current, target z is expanded to current to avoid losing data.