Rule below, and also attached.
version "2014.1"
attr heightToRoof = 3.2
attr roofAngle = 40
attr overhangX = 0.5
attr overhangY = 0.5
attr roofExtrusion = 0.15
@Range (0,10)
attr wallThatYourFrontDoorGoesOn = 0
@Color
attr roofColor = "#804000"
@StartRule
BuildingFootprint -->
alignScopeToAxes(y)
s('1,0,'1)
extrude(heightToRoof)
comp(f) { top: Roof | side: Wall }
Roof -->
roofGable(roofAngle, overhangX, overhangY)
comp(f) {top: ExtrudeRoof | aslant: ExtrudeRoof | side: X.}
ExtrudeRoof -->
extrude(world.y, roofExtrusion)
color(roofColor)
Wall -->
case comp.index == rint(wallThatYourFrontDoorGoesOn) % comp.total:
WallWithDoorAndWindow
else:
X.
WallWithDoorAndWindow -->
split(x) {~0.3: X. |
1: DoorWall |
0.5: X. |
1.2: WindowWall |
~0.3: X.
}
DoorWall -->
split(y) {2.2: Inset | ~1: X.}
WindowWall -->
split(y) {0.8: X. | 1.4: Inset | ~1: X.}
Inset -->
extrude(-0.08)
comp(f){side: reverseNormals X. | top: reverseNormals X.}