Plasm code

Function toolbox

The Q function extends the predefined operator QUOTE; the mirror function allows for mirroring geometric models without changing their containment box; the stack function returns a stack assembly of n instances of a polyhedral obj. The multistack function conversely aggregates n instances of Obj along any sequence of coordinates.

DEF XQ = Q~CAT~AA:(IF:< IsSeq,ID,LIST>)~IF:< IsSeq,ID,LIST>;
DEF ButFirstButLast = REVERSE~TAIL~REVERSE~TAIL;
DEF Stack (Obj::IsPol)(n::IsInt) =
  (STRUCT~AA:STRUCT~DISTR):<
    (AA:(T:3)~AA:*~DISTR):< 0..(n - 1),height>, Obj >;
DEF MultiStack (coords::IsSeq)(Obj::IsPol)(n::IsInt) =
  (STRUCT~AA:STRUCT~DISTR):<
    (AA:(T:coords)~(AA:(AA:*))~AA:DISTL~DISTR):< 0..(n - 1),param>, Obj >
WHERE
  param = IF:< IsSeq,ID,LIST>:(SIZE:coords:Obj)
END;

Design parameters

It was supposed that only the number of floors nFloors, the inter-floor height, as well as the numeric series xSeq, xSeq that span the tower fronts, are considered design parameters, and allocated in a specialized package.

DEF nFloors = 20;
DEF xSeq = < 12,12,12 >;
DEF ySeq  = < 6,6,-6,6,6 >;
DEF height = 3;

Floor layout

DEF buildingFloor = (Q:xSeq * Q:ySeq) STRUCT
            ((Q~[-~S1,S2]):xSeq * (Q~AA:-):ySeq)  ;
VIEW:(buildingFloor STRUCT @1:buildingFloor);

Mirroring of geometric objects

DEF mirror (coord::IsInt)(obj::IsPol) =
  ( T:coord:param ~ S:coord:-1 ):Obj
WHERE
  param = min:coord:Obj - min:coord:(S:coord:-1:Obj)
END;

Stacking along the z coordinate

DEF Stack (Obj::IsPol)(n::IsInt) =
  (STRUCT~AA:STRUCT~DISTR):<
    (AA:(T:3)~AA:*~DISTR):<0..(n - 1),height>, Obj >;
VIEW:(Stack:((STRUCT~[ID,@1]):(EMBED:1:buildingFloor)):20);

Wire frame beams and pillars

DEF beamsPillars = @1:(buildingFloor * Q:height);
VIEW:beamsPillars;

Solid beams and pillars

DEF beamsPillars =
    (OffSet:<0.2,0.2,-0.4>~@1):(buildingFloor * Q:height);
VIEW:beamsPillars;

floor layout including static frame

DEF myFloor = STRUCT:<
  EMBED:1:buildingFloor,
  beamsPillars  >;
VIEW:myFloor;

Building skeleton

DEF BuildingSK  = Stack:myFloor:nFloors;
VIEW:BuildingSK;

The stair ramp

DEF nstep = 12;
DEF zstep = height/(nstep*2);
DEF stair (x,y,z::IsReal)(n::IsInt) =
  MultiStack:<3,1>:(CUBOID:< x,y,z >):n;
VIEW:(stair:< 0.25,1,zstep >:nstep);

Double stair ramp

DEF doubleStair = STRUCT:<
  stair: <0.25,1,zstep >:nstep,
  T:2:5, S:3:-1,
  stair:< 0.25,1,zstep>:nstep  >;
VIEW:doubleStair;

Stair case including kernel

DEF boundry = @1:(Q:(12*0.25) * Q:<2,2>) * Q:height;
DEF stairCase = STRUCT:<
  (EMBED:1~CUBOID):< 1.5,6 >,
  T:1:1.5,
  T:2:1:boundry,
  doubleStair,
  T:<1,3>:< 12*0.25,12*zstep>,
  (EMBED:1~CUBOID):< 1,6 >  >;
VIEW:stairCase;

Double stair case (by mirroring)

DEF doubleStairCase = stairCase RIGHT mirror:1:stairCase;
VIEW:doubleStairCase;

Full stair case (whole building height)

DEF fullStairCase = Stack:doubleStairCase:nFloors;
VIEW:fullStairCase;

Building frame, stairs and kernel integration

DEF myBuilding = STRUCT:< BuildingSK,
  T:<1,2>:< tx1,ty1>:fullStairCase,
  T:<1,2>:< tx2,ty1>:fullStairCase >
WHERE
  tx1 = S1:xSeq - size:1:doubleStairCase,
  ty1 = (S1 + S2):ySeq,
  tx2 = (+~TAIL~REVERSE):xSeq
END;
VIEW:myBuilding;

Panel partition into full and empty panes

The panel function accepts two numeric series xRithm,yRithm as input and generates a 2D partition of a rectangular domain into a grid of either full or empty panes, according to the sign of the corresponding numbers.

DEF Panel (xRithm,yRithm::IsSeqOf:IsReal) = STRUCT:<
  Q:xRithm * Q:yRithm,
  Q:xVoid  * Q:yRithm,
  Q:xRithm * Q:yVoid ,
  @1:(Q:xVoid * Q:yVoid)  >
WHERE
  xVoid = AA:-:xRithm,
  yVoid = AA:-:yRithm
END;

Preliminary design of panel1

DEF color2 = RGBcolor:<0.40,0.91,0.35>;
DEF panel1 = Panel:<< x1,-:x2,x2,-:x2,x1>,< y1,-:y2,-:y3,y4>>
  color color2
WHERE
  x1 = S1:xSeq / 24,
  x2 = 2*x1,
  y1 = 1.2,
  y2 = (height - y1) / 2,
  y3 = (height - y1 - y2) / 3,
  y4 = height - (y1 + y2 + y3)
END;
VIEW:panel1;

Preliminary design of panel2

DEF color1 = RGBcolor:<0.64,0.6,0.06>;
DEF panel2 = Panel:<< x1,-:x1,-4*x1,-:x1,x1>,< -:y1,y2>>
  color color1
WHERE
  x1 = S1:xSeq / 24,
  y1 = height - 0.3,
  y2 = height - y1
END;
VIEW:panel2;

Preliminary design of panel3

DEF color3 = RGBcolor:<0.69,0.23,0.01>;
DEF panel3 = Panel:<< x1,-:x2,-:x2,-:x2,-:x2,x1>,< y1,-:y1,y2>>
  color color3
WHERE
  x1 = S1:xSeq / 24,
  x2 = (S1:xSeq - 2*x1)/4,
  y1 = height - 2,
  y2 = y1
END;
VIEW:panel3;

Preliminary design of panel4

DEF color4 = RGBcolor:<0.75,0.50,0.20>;
DEF panel4 = Panel:<< x1,-:x2,2*x1,-:x2,x1>,< y1,-:y2,-:y3,y4>>
  color color4
WHERE
  x1 = S1:xSeq / 24,
  x2 = (S1:ySeq - 4*x1)/2,
  y1 = 1.2,
  y2 = (height - y1) / 2,
  y3 = (height - y1 - y2) / 3,
  y4 = height - (y1 + y2 + y3)
END;
VIEW:panel4;

Preliminary design of panel5

DEF color5 = RGBcolor:<0.99,0.70,0.20>;
DEF panel5 = Panel:<< x1,-:x2,-:x2,2*x1,-:x2,-:x2,x1>,< -:y1,y2>>
  color color5
WHERE
  x1 = S1:xSeq / 24,
  x2 = (S1:ySeq - 4*x1)/4,
  y1 = height - 0.3,
  y2 = height - y1
END;
VIEW:panel5;

Preliminary design of panel6

DEF color6 = RGBcolor:<0.75,0.99,0.25>;
DEF panel6 = Panel:<< x1,-:x2,-:x2,-:x2,x1>,< y1,-:y1,y2>>
  color color6
WHERE
  x1 = S1:xSeq / 24,
  x2 = (S1:ySeq - 2*x1)/3,
  y1 = height - 2,
  y2 = y1
END;
VIEW:panel6;
DEF width7 = SIZE:1:doubleStairCase - S1:xSeq;
DEF panel7 = Q:x * Q:y
WHERE
  x = width7,
  y = height
END;

Panel catalog

DEF Catalog (x,y::IsSeq) (objs::IsSeq) = (STRUCT~AA:fun~TRANS):
        < pairs, objs >
WHERE
  pairs = x CAT~AA:DISTR~DISTL y,
  fun = APPLY~[T:<1,2>~s1,s2]
END;
VIEW:(Catalog:<<0,7>,<0,4,8>>:
  < panel1,panel2,panel4,panel6,panel5,panel3 >);

Courtain wall stripes

DEF Stripe (obj::IsPol)(coord::IsInt)(n::IsInt) =
  multistack:<coord>:obj:n;
DEF Stripe1x = Stripe:panel1:1:(3*3);
DEF Stripe2x = Stripe:panel2:1:(3*3);
DEF Stripe3x = Stripe:panel3:1:3;
DEF Stripe4x = STRUCT:< Stripe7,T:1:((+~AA:ABS):xSeq - width7), Stripe7 >;
DEF Stripe4 = Stripe:panel4:1:2;
DEF Stripe5 = Stripe:panel5:1:2;
DEF Stripe6 = Stripe:panel6:1:2;
DEF Stripe7 = (R:<2,3>:(PI/2)~EMBED:1):panel7;
DEF Stripe1y = STRUCT:< Stripe4, T:1:((+~AA:ABS~[s1,s2,s3]):ySeq), Stripe4 >;
DEF Stripe2y = STRUCT:< Stripe5, T:1:((+~AA:ABS~[s1,s2,s3]):ySeq), Stripe5 >;
DEF Stripe3y = STRUCT:< Stripe6, T:1:((+~AA:ABS~[s1,s2,s3]):ySeq), Stripe6 >;
VIEW:(
Catalog:<(0),<0,4,8,12,16,20,24,28,32>>:<
  Stripe1x, Stripe2x, Stripe3x,
  Stripe4, Stripe5, Stripe6,
  Stripe1y, Stripe2y, Stripe3y
>);

Courtain wall at south

DEF SouthWall =
  (R:<2,3>:(PI/2)~EMBED:1~STRUCT):<
    Stripe2x,
    T:2:height, Stripe3x,
    T:2:height, Stripe:Stripe1x:2:17,
    T:2:(height*17), Stripe3x  >;
VIEW:SouthWall;

Courtain wall at west

DEF WestWall =
  (R:<1,2>:(PI/2)~R:<2,3>:(PI/2)~EMBED:1~STRUCT):<
    Stripe2y,
    T:2:height, Stripe3y,
    T:2:height, Stripe:Stripe1y:2:17 ,
    T:2:(height*17), Stripe3y  >;
VIEW:WestWall;

Building envelope

DEF OtherWalls = STRUCT:< T:2:(S1:ySeq + S2:ySeq), Stripe:Stripe4x:3:20,
                          T:2:((-~S3):ySeq), Stripe:Stripe4x:3:20 >;
DEF NorthWall = T:2:((+~AA:ABS):ySeq):SouthWall;
DEF EasthWall = T:1:((+~AA:ABS):xSeq):WestWall;
DEF Envelope = STRUCT:<
  SouthWall,NorthWall,WestWall,EasthWall,OtherWalls>;
VIEW:Envelope;

Complete PLaSM model of the Tower Building

DEF out = STRUCT:< myBuilding, Envelope >;
VIEW:out;
 

PLaSM is Free Software and may be distributed under GNU LGPL