Cutting off the pieces of pattern along lines