  The oriented area function $A$ is (generically) a Morse function on the space
of planar configurations of a polygonal linkage. We are lucky to have an easy
description of its critical points as cyclic polygons and a simple formula for
the Morse index of a critical point. However, for planar polygons, the function
$A$ in many cases is not a perfect Morse function. In particular, for an
equilateral pentagonal linkage it has one extra local maximum (except for the
global maximum) and one extra local minimum. In the present paper we consider
the space of 3D configurations of a polygonal linkage. For an appropriate
generalization $S$ of the area function $A$ the situation becomes nicer: we
again have an easy description of critical points and a simple formula for the
Morse index. In particular, unlike the planar case, for an equilateral linkage
with odd number of edges the function $S$ is always a perfect Morse function
and fits the lacunary principle. Therefore cyclic equilateral polygons can be
interpreted as independent generators of the homology groups of the (decorated)
configuration space.
