Sketch of a clipping algorithm