public int ClipStart(Slot slot, ClippingAttachment clip) { if (clipAttachment != null) { return(0); } clipAttachment = clip; int n = clip.worldVerticesLength; float[] vertices = clippingPolygon.Resize(n).Items; clip.ComputeWorldVertices(slot, 0, n, vertices, 0, 2); MakeClockwise(clippingPolygon); clippingPolygons = triangulator.Decompose(clippingPolygon, triangulator.Triangulate(clippingPolygon)); foreach (var polygon in clippingPolygons) { MakeClockwise(polygon); polygon.Add(polygon.Items[0]); polygon.Add(polygon.Items[1]); } return(clippingPolygons.Count); }