- The successful deployment of distributed photovoltaic (PV) systems requires assessment of the potential of possible installations. This depends mainly on their exposure to solar radiation, which can vary substantially with location, especially in the urban landscape. This paper seeks to estimate the potential for electricity generation by building-integrated PV in typical residential building types in dense urban locations, accounting for shading by adjacent structures. 3D modeling of the shadows cast by buildings is carried out with a new R package, developed as part of the study. The algorithm can assess the shadows cast on vertical surfaces (typically walls) or horizontal ones (typically roofs), given a database of obstacles representing buildings in the form of extruded polygons, and the sun's position at any desired time interval. The methodology is demonstrated for a case-study neighborhood in Rishon LeZion, Israel, with diverse building typologies. The simulation shows which building typologies offer the greatest solar potential, calculated per dwelling, building plot area or for the entire neighborhood. The results show that although roofs are less affected by mutual shading than vertical facades, some facades (mainly south and east oriented) can still make a substantial contribution to the overall solar potential of urban buildings.