%---------------------------------
Parametric layout
----------------------------------%
DEF plan (a,b::isRealPos) =
IF:<K:ok, ID, ERROR>:ThePlan
WHERE
ok = GE:b:a,
ThePlan = STRUCT:<rooms, T:<1,2>: <a,-:b/2>:corridor>,
rooms = QUOTE:<a,-:b,a> * Q:<a, a>,
corridor = QUOTE:<b> * Q:<b, 2*(a-b), b>,
ERROR = SIGNAL ~ [K:'no good plan ', ID]
END
DEFAULT
a = 4, b = 2
END;
%-----------------------------------
Polyhedral product times a set of intervals
----------------------------------%
DEF block (plan::IsPol; height::IsRealPos; n_floor::IsIntPos)
= STRUCT:<
plan * @0:stages,
@1:(plan * stages)
>
WHERE
stages = (QUOTE ~ #:n_floor): height
END;
%-----------------------------------
Expressions which generate the VRML model
-----------------------------------%
DEF thePlan = plan:<4,2>;
block:<thePlan, 2.5, 12>;