Skip to content
vvoovv edited this page Dec 31, 2014 · 6 revisions

Operator hip_roof(..) creates a hip roof. At the moment it can be applied to convex polygons only. Support of concave polygons will be implemented later.

The terms pitch, overhang and fascia used by hip_roof(..) are explained on the images below.

Pitch:


Soffit is a horizontal part of a roof overhang. Soffit is shown with blue color on the image below:


Fascia is the vertical part of a roof overhang. Fascia is shown with green color on the image below:


Each roof face starts from the corresponding edge of the polygon to which hip_roof(..) is applied.

If pitch and soffit size are the same for all edges of the polygon, hip_roof(..) has the signature as in the example below:

hip_roof(
    30, # pitch in degrees
    0.5, # optional: soffit size, default is zero
    face>>RoofFace(), # optional: an operator or a rule for each roof face
    soffit>>Soffit(), # optional: an operator or a rule for each soffit
    fascia>>Fascia(), # optional: an operator or a rule for each fascia
    fasciaSize=0.3 # optional: fascia size, default is zero
)

Note, that fasciaSize as a parameter defined with the equals sign = must be placed after all the other parameters.

Example:

hip_roof(
    30, # pitch in degrees
    0.5, # soffit size
    face>>texture("roof_face.jpg", 1.5, 1.5), # operator for each roof face
    soffit>>texture("soffit.jpg", 0.6, 0.6), # operator for each soffit
    fascia>>texture("fascia.jpg", 0.6, 0.6), # operator for each fascia
    fasciaSize=0.3 # optional: # fascia size
)

The resulting roofs are shown on the images below depending on the shape of the original polygon for the roof:


If pitch or soffit size differs from edge to edge of the original polygon, just list them consecutively starting from the first edge of the polygon as in the example below:

hip_roof(
    90, 0, # pitch in degrees and soffit size for the first edge of the polygon
    30, 0.5, # pitch in degrees and soffit size for the second edge of the polygon
    30, 0.5, # pitch in degrees and soffit size for the third edge of the polygon
    30, 0.5, # pitch in degrees and soffit size for the fourth edge of the polygon
    face>>texture("roof_face.jpg", 1.5, 1.5), # operator for each roof face
    fascia>>texture("soffit.jpg", 0.6, 0.6), # operator for each soffit
    soffit>>texture("fascia.jpg", 0.6, 0.6), # operator for each fascia
    fasciaSize=0.3 # fascia size
)

Note, that the number of pairs pitch, soffit size must be equal to the number of edges in the original polygon for the roof. So the above example can be applied to a quadrangle only. The resulting roof is shown on the image below:

Clone this wiki locally