voxcity.importer.windowsยถ

Stamp imported window geometry as a glass skin (code -16) on building voxels.

Window groups are surface-voxelized (not volume-filled) so thin/planar panes rasterize reliably. Each physically-distinct window (a connected component of the surface cells) has its opening filled in the facade plane โ€“ so a mullioned frame becomes a solid pane rather than thin bars. The filled footprint is then snapped, one building voxel per facade column, onto the buildingโ€™s VISIBLE OUTER SURFACE (the hull facing exterior air, not interior room faces): a tight band scan along the window normal places a thick/recessed window mesh onto a single flat plane (no depth scatter, which reads as sparse/dashed from outside), with an EDT-nearest-hull fallback so a wall that is staircased relative to the window (rotated facades) is still reached. A facade window (normal x/y) snaps to the lateral hull only โ€“ never the roof; a skylight (normal z) snaps to the roof/floor hull. A window farther than skin_radius from any matching surface snaps to nothing and is dropped (no floating glass). Windows never create new occupancy; they only reclassify existing building cells, so building footprint/height metadata is unaffected.

Attributesยถ

Functionsยถ

stamp_windows(voxcity, window_groups, transform, *[, ...])

Recolor facade building cells touched by window meshes to window_value.

Module Contentsยถ

voxcity.importer.windows.BUILDING_CODE = -3ยถ
voxcity.importer.windows.GLASS_CODE = -16ยถ
voxcity.importer.windows.stamp_windows(voxcity, window_groups, transform, *, window_value=GLASS_CODE, building_value=BUILDING_CODE, skin_radius=1)[source]ยถ

Recolor facade building cells touched by window meshes to window_value.

Parameters:
  • voxcity โ€“ VoxCity object; voxels.classes is modified in place.

  • window_groups โ€“ list of (name, trimesh.Trimesh) window groups.

  • transform โ€“ 4x4 affine mapping model coords -> voxel-index space (the same matrix used to voxelize the buildings).

  • window_value โ€“ code written for window cells (default -16, glass).

  • building_value โ€“ code identifying building cells eligible for recolor.

  • skin_radius โ€“ how far (in voxels) a window may sit from the wall and still snap to it. Each filled footprint cell is mapped to its nearest building surface face if that face is within skin_radius (measured as a full diagonal, skin_radius*sqrt(3)) โ€“ absorbing sub-voxel offsets between a pane plane and the wall. The recolored glass is always one voxel deep regardless of this value; windows farther than the radius snap to nothing.

Returns:

number of building cells recolored to window_value.

Return type:

int