public List <Vector2f[]> GenerateOutlines() { List <Outline> outlines = new List <Outline>(); for (int i = 0; i < m_triangles.Count; i++) { bool isKnown = false; for (int j = 0; j < outlines.Count; j++) { if (outlines[j].IsContain(i)) { isKnown = true; break; } } if (isKnown) { continue; } Outline outline = new Outline(m_triangles, i); outline.GenerateOutline(); outlines.Add(outline); } List <Vector2f[]> result = new List <Vector2f[]>(); List <Vector2f> resultLine = new List <Vector2f>(); for (int i = 0; i < outlines.Count; i++) { resultLine.Clear(); Outline outline = outlines[i]; for (int j = 0; j < outline.GeneratedOutline.Count; j++) { int vertex = outline.GeneratedOutline[j]; // include outlines that has common vertex with current outline /*for (int k = i + 1; k < outlines.Count; k++) * { * Outline nextOutline = outlines[k]; * int index = nextOutline.GeneratedOutline.IndexOf(vertex); * if (index != -1) * { * for (int l = index; l < nextOutline.GeneratedOutline.Count; l++) * { * int nextVertex = nextOutline.GeneratedOutline[l]; * resultLine.Add((Vector2f)m_vertices[nextVertex]); * } * for (int m = 0; m < index; m++) * { * int nextVertex = nextOutline.GeneratedOutline[m]; * resultLine.Add((Vector2f)m_vertices[nextVertex]); * } * outlines.RemoveAt(k--); * } * }*/ resultLine.Add((Vector2f)m_vertices[vertex]); } result.Add(resultLine.ToArray()); } return(result); }