functional language for computing with geometry
DEF AztecaPyramid (hStep::IsReal; side,nStep::IsInt) =
(T:<1,2>:<side/2,side/2> ~ STRUCT ~ CAT~DISTR):
<((CONS~AA:(S:<1,2>)):((TRANS~[ID,ID]):ScalingParams)):
ScaledBox, T:3:hStep>
WHERE
ScalingParams = (AA:/ ~ DISTR): <REVERSE:((side-nStep+1)..side),side>,
ScaledBox = T:<1,2>:<-:(side/2),-:(side/2)>:basis,
basis = CUBOID:<side,side,hStep>
END;
AztecaPyramid:<0.5,18,12>