  In this work, we propose a detailed computational framework for modelling the
envelope of the swept volume, that is the boundary of the volume obtained by
sweeping an input solid along a trajectory of rigid motions. Our framework is
adapted to the well-established industry-standard brep format to enable its
implementation in modern CAD systems. This is achieved via a "local analysis",
which covers parametrization and singularities, as well as a "global theory"
which tackles face-boundaries, self-intersections and trim curves. Central to
the local analysis is the "funnel" which serves as a natural parameter space
for the basic surfaces constituting the sweep. The trimming problem is reduced
to the problem of surface-surface intersections of these basic surfaces. Based
on the complexity of these intersections, we introduce a novel classification
of sweeps as either decomposable or non-decomposable. Further, we construct an
{\em invariant} function $\theta$ on the funnel which efficiently separates
decomposable and non-decomposable sweeps. Through a geometric theorem we also
show intimate connections between $\theta$, local curvatures and the inverse
trajectory used in earlier works as an approach towards trimming. In contrast
to the inverse trajectory approach, $\theta$ is robust and is the key to a
complete structural understanding, and an efficient computation of both, the
singular locus and the trim curves, which are central to a stable
implementation. Several illustrative outputs of a pilot implementation are
included.
