DEF out = House
WHERE
IsPattern = IsSeqOf:IsReal,
!^! = INSL:* ~ AA:QUOTE,
Grid2D (patX,patY::IsPattern) = STRUCT:<
!^!:<patX, patY>,
!^!:<AA:-:patX, patY>,
!^!:<patX, AA:-:patY>
>,
Grid3D1 (patX,patY,patZ::IsPattern) = QUOTE:patX * Grid2D:<patY,patZ> ,
Grid3D2 (patX,patY,patZ::IsPattern) = (S:1:-1~R:<1,2>:(PI/2)): (QUOTE:patY * Grid2D:<patX,patZ>),
Grid3D3 (patX,patY,patZ::IsPattern) = Grid2D:<patX,patY> * QUOTE:patZ , xWalls = grid3D2: <<1.2, -0.8, 1.2, -0.8, 3>,<0.2,-5,0.2>,<1.1,-1.4,0.5>>,
yWalls = (T:2:2.2 ~ grid3D1):<<0.2,-6.6,0.2>,<0.4,-1,0.2,-1,0.4>,<1.1,-1.4,0.5>>,
Ext_door = (T:1:6.8 ~ grid3D1):<<0.2>,<0.8,-1.2,0.2>,<-2.5, 0.5>>,
doors = (T:2:2.1 ~grid3D2):<<1.6,-0.8,0.4,-0.8,1.2,-0.8,1.2>,<0.1>,<-2.2,0.8>>,
backwall = CUBOID:<0.2,2.2,3>,
wall1 = T:1:2.55: (CUBOID:<0.1,2.1,3>),
wall2 = T:<1,2>:<4.2,2.2>: (CUBOID:<0.1,3,3>),
House = STRUCT:<
xWalls,yWalls,Ext_door,backwall,
doors,wall1,wall2,
(EMBED:1~BOX:<1,2>):xWalls
>
END;