preparing the poly clipping function