I see whats happening - your Transformation command t(0,0,-corridorWidth)
is shifting along the Z-axis of the shape - so straight back, but that "straight back" is not aligned with your object since - like we know - your shape isn't square.
What I have done with the code below is isolated your ground floor - then split off the corridorWidth with a NIL so its gone. The result should be what you are looking for - on the left...
/**
* File: Thibault-NEW.cga
* Created: 17 Aug 2014 07:08:00 GMT
* Author: devlavigne
*/
version "2014.0"
attr HEIGHT = 9.5
attr groundFloorHeight = 4
attr floorHeight = 4
attr roofHeight = 1.5
attr groundFloorElevation = 0.20
attr corridorWidth = 2
@StartRule
Building-->
[extrude(groundFloorHeight) LowerMass]
UpperMass
UpperMass-->
t(0,groundFloorHeight,0)
extrude(HEIGHT-groundFloorHeight)
split(y){floorHeight:Floor | roofHeight:Roof}
LowerMass-->
split(y) {groundFloorElevation:GroundFloorElevation | GroundFloorBuilding}
GroundFloorBuilding-->
split(z) {GroundFloorFacades | corridorWidth:NIL }
GroundFloorFacades-->
comp(f){
front:GroundFloorFacade|
left:GroundFloorBuildingLeft|
right:GroundFloorBuildingRight|
back:GroundFloorBuildingBack}
GroundFloorFacade-->
color("#FFFF00")