In order to provide architects with a method to compare different building geometries regarding the energy production, the aim of this project is to develop a flexible parametric design platform in order to optimize the shape of buildings according to their solar potential and energy consumption. To develop this algorithm, a case study of a standard domestic house in Beaumont (Fribourg, Switzerland) is chosen. With a Swiss standard consumption, the results show the impossibility to have a building more than 50% self-sufficient regarding the electricity without using a storage system. This happens due to the morning and evening electricity consumption peaks. In order to attempt to cover those peaks, the algorithm tells to implement the photovoltaic (PV) system on the best oriented facades and to cover the heat demand in winter, the solar thermal (ST) system is installed on the surfaces receiving the most irradiation in winter which are on the roof. As the objective is to cover the heat demand in winter, the area needed is huge (46m2). Therefore, a trade-off can be done between the area of panels installed and the building's autonomy in order to find the best geometry variant during the early design stage of the construction. Indeed, decreasing the area of ST panels from 40 to 20 m2 only decreases the self-suciency of 12%. Concerning the electricity production, a trade-off between East and West oriented panels and South oriented ones would decrease the surface of PV to install without decreasing the self-sufficiency. Indeed, the losses in the early morning and late evening production by removing some of the East and West oriented panels would be compensated by a better coverage of the midday consumption peak with South oriented panels.