The Complex Pitched Roof Algorithm builds off of the Geometric Boolean Operation Algorithm Suite to allow the creation of a multi-wing pitched roof building structure with minimal user inputs. The user only needs to define the shape of the gutterline, select the a point on each gutterline, and select a point on the ground. With these inputs the algorithm generates a full volumetric pitched roof object.

The algorithm operates in two stages, first the gutterline is drawn. This gives the algorithm the general shape of the building. The shape is interpreted and the algorithm determines where the ridgelines are likely to be located. For this E-shaped building, the algorithm finds four potential ridgelines from the gutterline shape.

The ridgeline guess locations are coplanar with the building gutterline. Depending on the heights of each ridgeline, the building shape can change in structure, so the ridgeline guesses are not drawn in the ambiguous zones (i.e. the intersection zones between orthogonal wings). The user then must select the height and skew of the ridgeline. The initial guess of the ridgeline peak is in the middle of the wing, but may be located skewed to the left or right. The user also selects the distance to the ground.

This information allows the ridgeline structure to be determined. For this algorithm, the lower ridgeline peaks are always assumed to terminate at the taller ones and same height ridgelines always form a hip roof intersection. This is a good assumption for most buildings, but more complex roof structures (like Dutch Gables) can still be drawn manually added using the Boolean tool suite. The wing path sections are shown below.

These paths are used to create primitve sections of the building. The red and orange paths represent simple extrusions, the cyan path is a swept (non-linear extrusion) path. Note: the paths are centered in each wing, but if an offset is inserted into the ridgeline location, the primitive will be drawn with the rooftop asymmetric.

The primives are finally unioned into a composite object. Because the orange and green ridgelines were selected to be at the same height, those wings create a flat hipped roof intersection. The higher ridgeline in the red wing causes the ridgeline to extend all the way to the back of the building and the green ridgeline to terminate inside the red wing.

The algorithm can be used to generate many pitched roof variants.