public void purifyFaces() { for (int i = triangle.size() - 1; i >= 0; i--) { Triangle tri = triangle.get(i); for (int ix = 0; ix < triangle.size(); ix++) { Triangle trix = triangle.get(ix); if (trix != tri) { if (trix.equalRefsNoIds(tri)) // Changed this from "sameVerts" -- this means that // triangles with the same vertices but in a different order will no // longer be purged automatically. { triangle.remove(tri); break; } } } } }