voxcity.importer.windows ======================== .. py:module:: voxcity.importer.windows .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: voxcity.importer.windows.BUILDING_CODE voxcity.importer.windows.GLASS_CODE Functions --------- .. autoapisummary:: voxcity.importer.windows.stamp_windows Module Contents --------------- .. py:data:: BUILDING_CODE :value: -3 .. py:data:: GLASS_CODE :value: -16 .. py:function:: stamp_windows(voxcity, window_groups, transform, *, window_value=GLASS_CODE, building_value=BUILDING_CODE, skin_radius=1) Recolor facade building cells touched by window meshes to *window_value*. :param voxcity: VoxCity object; ``voxels.classes`` is modified in place. :param window_groups: list of ``(name, trimesh.Trimesh)`` window groups. :param transform: 4x4 affine mapping model coords -> voxel-index space (the same matrix used to voxelize the buildings). :param window_value: code written for window cells (default -16, glass). :param building_value: code identifying building cells eligible for recolor. :param 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*. :rtype: int